public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Binbin Wu <binbin.wu@linux.intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: Update comments about MSR lists exposed to userspace
Date: Tue, 13 Jun 2023 09:06:27 -0700	[thread overview]
Message-ID: <ZIiUAz7VIBughj/J@google.com> (raw)
In-Reply-To: <fd000efe-315f-a2c7-b42b-7ebbce922928@linux.intel.com>

On Wed, Jun 07, 2023, Binbin Wu wrote:
> 
> 
> On 6/7/2023 8:46 AM, Sean Christopherson wrote:
> > Refresh comments about msrs_to_save, emulated_msrs, and msr_based_features
> > to remove stale references left behind by commit 2374b7310b66 (KVM:
> > x86/pmu: Use separate array for defining "PMU MSRs to save"), and to
> > better reflect the current reality, e.g. emulated_msrs is no longer just
> > for MSRs that are "kvm-specific".
> > 
> > Reported-by: Binbin Wu <binbin.wu@linux.intel.com>
> > Signed-off-by: Sean Christopherson <seanjc@google.com>
> > ---
> >   arch/x86/kvm/x86.c | 27 +++++++++++++--------------
> >   1 file changed, 13 insertions(+), 14 deletions(-)
> > 
> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> > index 5ad55ef71433..c77f72cf6dc8 100644
> > --- a/arch/x86/kvm/x86.c
> > +++ b/arch/x86/kvm/x86.c
> > @@ -1427,15 +1427,14 @@ int kvm_emulate_rdpmc(struct kvm_vcpu *vcpu)
> >   EXPORT_SYMBOL_GPL(kvm_emulate_rdpmc);
> >   /*
> > - * List of msr numbers which we expose to userspace through KVM_GET_MSRS
> > - * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST.
> > - *
> > - * 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
> > - * 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.
> > + * The three MSR lists(msrs_to_save, emulated_msrs, msr_based_features) track
> > + * the set of MSRs that KVM exposes to userspace through KVM_GET_MSRS,
> > + * KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST.  msrs_to_save holds MSRs that
> > + * require host support, i.e. should be probed via RDMSR.  emulated_msrs holds
> > + * MSRs that emulates without strictly requiring host support.
> emulates -> emulate/emulated?

Ah, no, that's supposed to be "that KVM emulates".  I'll fix that up when applying.

> BTW, do you think is it better to use msrs_emulated instead of emulated_msrs
> to align the naming style?

No, "emulated" is used as an adjective that describes each MSR, versus the "to save"
part of msrs_to_save being a description of the list, not each MSR.

If I were going to rename anything, it would be msr_based_features, because that
reads as "MSR-based features", i.e. reads as "a list of features that are tied
to MSRs", whereas the list actually tracks "feature-based MSRs", i.e. "a list of
MSRs that track features".

  reply	other threads:[~2023-06-13 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07  0:46 [PATCH] KVM: x86: Update comments about MSR lists exposed to userspace Sean Christopherson
2023-06-07  1:52 ` Binbin Wu
2023-06-13 16:06   ` Sean Christopherson [this message]
2023-06-13 23:21 ` 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=ZIiUAz7VIBughj/J@google.com \
    --to=seanjc@google.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.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