KVM Archive on lore.kernel.org
 help / color / Atom feed
From: Jim Mattson <jmattson@google.com>
To: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: "Krish Sadhukhan" <krish.sadhukhan@oracle.com>,
	"kvm list" <kvm@vger.kernel.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH 7/8][KVM nVMX]: Enable "load IA32_PERF_GLOBAL_CTRL VM-{entry,exit} controls
Date: Thu, 15 Aug 2019 16:02:56 -0700
Message-ID: <CALMp9eQy+rf7qvsTd9AfzrUhU_k76vzOZLU4MLpGCFG-fM0fPQ@mail.gmail.com> (raw)
In-Reply-To: <20190513191254.GJ28561@linux.intel.com>

On Mon, May 13, 2019 at 12:12 PM Sean Christopherson
<sean.j.christopherson@intel.com> wrote:
>
> On Wed, Apr 24, 2019 at 07:17:23PM -0400, Krish Sadhukhan wrote:
> >  ...based on whether the guest CPU supports PMU
> >
> > Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
> > Suggested-by: Jim Mattson <jmattson@google.com>
> > Reviewed-by: Karl Heubaum <karl.heubaum@oracle.com>
> > ---
> >  arch/x86/kvm/vmx/vmx.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> >
> > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> > index 4d39f731bc33..fa9c786afcfa 100644
> > --- a/arch/x86/kvm/vmx/vmx.c
> > +++ b/arch/x86/kvm/vmx/vmx.c
> > @@ -6964,6 +6964,7 @@ static void nested_vmx_cr_fixed1_bits_update(struct kvm_vcpu *vcpu)
> >  static void nested_vmx_entry_exit_ctls_update(struct kvm_vcpu *vcpu)
> >  {
> >       struct vcpu_vmx *vmx = to_vmx(vcpu);
> > +     bool pmu_enabled = guest_cpuid_has_pmu(vcpu);
>
> A revert has been sent for the patch that added guest_cpuid_has_pmu().
>
> Regardless, checking only the guest's CPUID 0xA is not sufficient, e.g.
> at the bare minimum, exposing the controls can be done if and only if
> cpu_has_load_perf_global_ctrl() is true.

I don't think cpu_has_load_perf_global_ctrl() is required. Support for
the VM-entry and VM-exit controls, "load IA32_PERF_GLOBAL_CTRL," can
be completely emulated by kvm, since add_atomic_switch_msr() is
capable of falling back on the VM-entry and VM-exit MSR-load lists if
!cpu_has_load_perf_global_ctrl().

The only requirement should be kvm_pmu_is_valid_msr(MSR_CORE_PERF_GLOBAL_CTRL).

> In general, it's difficult for me to understand exactly what functionality
> you intend to introduce.  Proper changelogs would be very helpful.

I concur!

  reply index

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 23:17 [KVM nVMX]: Check "load IA32_PERF_GLOBAL_CTRL" on vmentry of nested guests Krish Sadhukhan
2019-04-24 23:17 ` [PATCH 1/8][KVMnVMX]: Enable "load IA32_PERF_GLOBAL_CTRL" VM-exit control for " Krish Sadhukhan
2019-05-13 18:49   ` Sean Christopherson
2019-05-13 22:08     ` Krish Sadhukhan
2019-04-24 23:17 ` [PATCH 2/8][KVM nVMX]: Enable "load IA32_PERF_GLOBAL_CTRL" VM-entry " Krish Sadhukhan
2019-05-13 18:49   ` Sean Christopherson
2019-04-24 23:17 ` [PATCH 3/8][KVM VMX]: Add a function to check reserved bits in MSR_CORE_PERF_GLOBAL_CTRL Krish Sadhukhan
2019-05-13 18:57   ` Sean Christopherson
2019-08-15 22:29     ` Jim Mattson
2019-04-24 23:17 ` [PATCH 4/8][KVM nVMX]: Check "load IA32_PERF_GLOBAL_CTRL" VM-exit control on vmentry of nested guests Krish Sadhukhan
2019-05-13 19:00   ` Sean Christopherson
2019-05-16 22:07     ` Krish Sadhukhan
2019-05-17 20:34       ` Sean Christopherson
2019-08-15 22:54         ` Jim Mattson
2019-04-24 23:17 ` [PATCH 5/8][KVM nVMX]: Check "load IA32_PERF_GLOBAL_CTRL" VM-entry " Krish Sadhukhan
2019-08-15 22:36   ` Jim Mattson
2019-04-24 23:17 ` [PATCH 6/8][KVM nVMX]: Load IA32_PERF_GLOBAL_CTRL MSR " Krish Sadhukhan
2019-08-15 22:44   ` Jim Mattson
2019-04-24 23:17 ` [PATCH 7/8][KVM nVMX]: Enable "load IA32_PERF_GLOBAL_CTRL VM-{entry,exit} controls Krish Sadhukhan
2019-05-13 19:12   ` Sean Christopherson
2019-08-15 23:02     ` Jim Mattson [this message]
2019-04-24 23:17 ` [PATCH 8/8][KVM nVMX]: Test "load IA32_PERF_GLOBAL_CTRL" controls on vmentry of nested guests Krish Sadhukhan
2019-05-13 18:46 ` [KVM nVMX]: Check "load IA32_PERF_GLOBAL_CTRL" " Sean Christopherson

Reply instructions:

You may reply publically 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=CALMp9eQy+rf7qvsTd9AfzrUhU_k76vzOZLU4MLpGCFG-fM0fPQ@mail.gmail.com \
    --to=jmattson@google.com \
    --cc=krish.sadhukhan@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=sean.j.christopherson@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

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org kvm@archiver.kernel.org
	public-inbox-index kvm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox