From: Yu Zhang <yu.c.zhang@linux.intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Aaron Lewis <aaronlewis@google.com>,
Weijiang Yang <weijiang.yang@intel.com>,
Like Xu <likexu@tencent.com>
Subject: Re: [PATCH 3/6] KVM: x86/pmu: Use separate array for defining "PMU MSRs to save"
Date: Fri, 10 Feb 2023 21:23:35 +0800 [thread overview]
Message-ID: <20230210132335.nrahzzhv62vegey4@linux.intel.com> (raw)
In-Reply-To: <20230124234905.3774678-4-seanjc@google.com>
On Tue, Jan 24, 2023 at 11:49:02PM +0000, Sean Christopherson wrote:
> Move all potential to-be-saved PMU MSRs into a separate array so that a
> future patch can easily omit all PMU MSRs from the list when the PMU is
> disabled.
>
> No functional change intended.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> arch/x86/kvm/x86.c | 153 ++++++++++++++++++++++++---------------------
> 1 file changed, 82 insertions(+), 71 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index d4a610ffe2b8..9b6e1af63531 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -1419,7 +1419,7 @@ EXPORT_SYMBOL_GPL(kvm_emulate_rdpmc);
> * may depend on host virtualization features rather than host cpu features.
> */
>
> -static const u32 msrs_to_save_all[] = {
> +static const u32 msrs_to_save_base[] = {
I guess the comments relating to msr_to_save_all should be updated as well. :)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 186cb6a81643..4bce96cd615e 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1413,7 +1413,7 @@ EXPORT_SYMBOL_GPL(kvm_emulate_rdpmc);
*
* The three MSR lists(msrs_to_save, emulated_msrs, msr_based_features)
* extract the supported MSRs from the related const lists.
- * msrs_to_save is selected from the msrs_to_save_all to reflect the
+ * msrs_to_save is selected from the msrs_to_save_base to reflect the
* capabilities of the host cpu. This capabilities test skips MSRs that are
* kvm-specific. Those are put in emulated_msrs_all; filtering of emulated_msrs
* may depend on host virtualization features rather than host cpu features.
@@ -1516,7 +1516,7 @@ static const u32 emulated_msrs_all[] = {
* by arch/x86/kvm/vmx/nested.c based on CPUID or other MSRs.
* We always support the "true" VMX control MSRs, even if the host
* processor does not, so I am putting these registers here rather
- * than in msrs_to_save_all.
+ * than in msrs_to_save_base.
*/
MSR_IA32_VMX_BASIC,
MSR_IA32_VMX_TRUE_PINBASED_CTLS,
For the comments of emulated_msrs_all, after renaming msrs_to_save_all to
msrs_to_save_base, maybe we do not need to take pains to explain that?
B.R.
Yu
next prev parent reply other threads:[~2023-02-10 13:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-24 23:48 [PATCH 0/6] KVM: x86/pmu: Misc PMU MSR fixes Sean Christopherson
2023-01-24 23:49 ` [PATCH 1/6] KVM: x86/pmu: Cap kvm_pmu_cap.num_counters_gp at KVM's internal max Sean Christopherson
2023-01-24 23:49 ` [PATCH 2/6] KVM: x86/pmu: Gate all "unimplemented MSR" prints on report_ignored_msrs Sean Christopherson
2023-01-25 9:29 ` Vitaly Kuznetsov
2023-01-31 11:46 ` Like Xu
2023-01-31 16:08 ` Sean Christopherson
2023-01-24 23:49 ` [PATCH 3/6] KVM: x86/pmu: Use separate array for defining "PMU MSRs to save" Sean Christopherson
2023-02-10 13:23 ` Yu Zhang [this message]
2023-02-10 16:32 ` Sean Christopherson
2023-01-24 23:49 ` [PATCH 4/6] KVM: x86/pmu: Don't tell userspace to save PMU MSRs if PMU is disabled Sean Christopherson
2023-01-24 23:49 ` [PATCH 5/6] KVM: x86/pmu: Don't tell userspace to save MSRs for non-existent fixed PMCs Sean Christopherson
2023-01-24 23:49 ` [PATCH 6/6] KVM: x86/pmu: Provide "error" semantics for unsupported-but-known PMU MSRs Sean Christopherson
2023-01-28 0:07 ` [PATCH 0/6] KVM: x86/pmu: Misc PMU MSR fixes Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230210132335.nrahzzhv62vegey4@linux.intel.com \
--to=yu.c.zhang@linux.intel.com \
--cc=aaronlewis@google.com \
--cc=kvm@vger.kernel.org \
--cc=likexu@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=vkuznets@redhat.com \
--cc=weijiang.yang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox