From patchwork Fri Feb 10 00:31:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 55160 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp660942wrn; Thu, 9 Feb 2023 16:34:32 -0800 (PST) X-Google-Smtp-Source: AK7set95bPjuI2fuHfbiHuGP+sefnS5oCLb31tKCqdkWXehUGt9KzZ01M/zd30ljKMM2/tTIXay8 X-Received: by 2002:a17:903:1245:b0:196:780a:ada8 with SMTP id u5-20020a170903124500b00196780aada8mr15606643plh.6.1675989272160; Thu, 09 Feb 2023 16:34:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675989272; cv=none; d=google.com; s=arc-20160816; b=Azkn5cXVH8OpBZ07jvZhUrYJ8tQu3xHMGMFaaLzZ8aD+BZHUfbcNEBooRb0rh5+YFU kgZlMB6Y+wNstPKPDRBxczZgWoUSoHc3i7srIaJHjUippa7sbwiMQEUED6RHfUUnQaGR 5Yt12txLinkou0lgtSrz7MlI1mlyX4auXJHgQVc8UJH3tWcNZKAvQvrXzgP+cTRsTY+5 KHPpceoyLNIuk7Vh0rZC2S9GBMqGEAkiZah61D9mVaBGaf1ohfSl17EXEwux26gtZc3u eY+teL7lk+VXub+VG8D+NGQ9wA65CVXCgl9JTFRzFqsPXdZ6aNJOTJ7a6z9AAIxI1AgT At7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=/yC4dBTyHw4BCiIIE+mQoyLNyewJpNpr9hXU3HEhe04=; b=DehAv6CmbYX16HqHbonQ093k3S2IVoJRn0iu/H5ohNKk9FZDlplG1El+OTS2mZXkzM lsofQflPcaP2ccyZvAVUwk6dqMid0h0SOv58WJnAVvUa3LPTU+pmMGD0MCeMn3t5EdnU +DAWn/sPV5s6wDQTJz2c5FlSCVTfq3P1iw3CBRI9Vpm7soxiPl9YFAXPDh0aOVPg/UZz uQ2rJQLFeut5hOyIfCyQkq667EM6NHY0C3NsHqHdJIFspRXoLgVDJkk03wfgIw1Wu2OH BtjSady54DeomdXaVWQiWWlnbQYJ5UYD3ChFFgc1eIXETMrJfZflJF5cIpihAI8OUvtB yYsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=dlFTWIrj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b16-20020a170902d51000b00194bf71a8e8si3178929plg.515.2023.02.09.16.34.19; Thu, 09 Feb 2023 16:34:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=dlFTWIrj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230253AbjBJAdf (ORCPT + 99 others); Thu, 9 Feb 2023 19:33:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230472AbjBJAcw (ORCPT ); Thu, 9 Feb 2023 19:32:52 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE1C23A84D for ; Thu, 9 Feb 2023 16:32:19 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-52ec7c792b1so11488637b3.5 for ; Thu, 09 Feb 2023 16:32:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=/yC4dBTyHw4BCiIIE+mQoyLNyewJpNpr9hXU3HEhe04=; b=dlFTWIrj5xuEqCgUwiK8eF69WB3PynzH9yUbo/CRFqeCmeAV07IDNmKLTxj9gfHIEl QRajxEu3mwYakZTPaC3A8Ilm9JHeauGNoJ5/n+EKd77uEAO2oU6czqKqSEEkCQC89dRf jYvdefaqRkNNtezzCdDpemGQ7PUWxHdUDLhqeAVUxpK5E7cS5f2j1ytsC3l2e0aYnUQt 4uSrDnSM93RiTBzgzciApnWIjjNdLp0Sk3xWXLxMvJqtZZ062vrjOpR3NNd01Cnn4IfE U1wJoTYNzFVkN+DlYGsS7Bngc9fZm5k/+FOWfI5/Jl+q3L65nbV6Nv3++BK4z3QKVIOz TAjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/yC4dBTyHw4BCiIIE+mQoyLNyewJpNpr9hXU3HEhe04=; b=naYU92Qgtt0lRSxf1jpYI7x0MquM3bCnpNnHz++6kAzUd8Fd5cx6mbQAcIOAw2vkS+ XJ7ybwEhuJj3BTUE1cQD6j80SsahVjJ0zM82VlJmHunwk5MZ7Q1RQB0vU3lk081kEvaH 7DC2JKZPLofnitiJEZS44fUekg0+wDzvr6mZanJxBT14BXHigYlgfRsiEpykfxGbbFJG k+vWXvkoprc+bCzUiKd4ys4S2onb0NgOFaQ7/AFLYOJL0cbauBcw6rd15gnMyyc6lNa7 EY4wSjuklJ0lJVEvEEX+/6csEGVrnYuhnEO3kicfzSazJltaEwYFauih3RlEtHO4KmX9 Ui8Q== X-Gm-Message-State: AO0yUKXIqdGqt6OU4AxoyeYmmKeiBq/iF9wfx/GhSxvFKHgUmR9rY2p1 NtMswLmMbzyTKqwfYsh5BdQfd72cg9M= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:81c2:0:b0:527:98b2:bce with SMTP id r185-20020a8181c2000000b0052798b20bcemr1538735ywf.222.1675989132992; Thu, 09 Feb 2023 16:32:12 -0800 (PST) Reply-To: Sean Christopherson Date: Fri, 10 Feb 2023 00:31:40 +0000 In-Reply-To: <20230210003148.2646712-1-seanjc@google.com> Mime-Version: 1.0 References: <20230210003148.2646712-1-seanjc@google.com> X-Mailer: git-send-email 2.39.1.581.gbfd45094c4-goog Message-ID: <20230210003148.2646712-14-seanjc@google.com> Subject: [PATCH v2 13/21] KVM: selftests: Drop now-redundant checks on PERF_CAPABILITIES writes From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Xiaoyao Li , Like Xu X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757402126995027557?= X-GMAIL-MSGID: =?utf-8?q?1757402126995027557?= Now that vcpu_set_msr() verifies the expected "read what was wrote" semantics of all durable MSRs, including PERF_CAPABILITIES, drop the now-redundant manual checks in the VMX PMU caps test. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c b/tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c index 035470b38400..f7a27b5c949b 100644 --- a/tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c +++ b/tools/testing/selftests/kvm/x86_64/vmx_pmu_caps_test.c @@ -51,10 +51,7 @@ static void test_basic_perf_capabilities(union perf_capabilities host_cap) struct kvm_vm *vm = vm_create_with_one_vcpu(&vcpu, NULL); vcpu_set_msr(vcpu, MSR_IA32_PERF_CAPABILITIES, 0); - ASSERT_EQ(vcpu_get_msr(vcpu, MSR_IA32_PERF_CAPABILITIES), 0); - vcpu_set_msr(vcpu, MSR_IA32_PERF_CAPABILITIES, host_cap.capabilities); - ASSERT_EQ(vcpu_get_msr(vcpu, MSR_IA32_PERF_CAPABILITIES), host_cap.capabilities); kvm_vm_free(vm); } @@ -67,9 +64,6 @@ static void test_fungible_perf_capabilities(union perf_capabilities host_cap) /* testcase 1, set capabilities when we have PDCM bit */ vcpu_set_msr(vcpu, MSR_IA32_PERF_CAPABILITIES, PMU_CAP_FW_WRITES); - /* check capabilities can be retrieved with KVM_GET_MSR */ - ASSERT_EQ(vcpu_get_msr(vcpu, MSR_IA32_PERF_CAPABILITIES), PMU_CAP_FW_WRITES); - /* check whatever we write with KVM_SET_MSR is _not_ modified */ vcpu_run(vcpu); ASSERT_EQ(vcpu_get_msr(vcpu, MSR_IA32_PERF_CAPABILITIES), PMU_CAP_FW_WRITES);