All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Upton <oupton@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, "Radim Krčmář" <rkrcmar@redhat.com>,
	"Jim Mattson" <jmattson@google.com>,
	"Peter Shier" <pshier@google.com>,
	"Krish Sadhukhan" <krish.sadhukhan@oracle.com>,
	"Sean Christopherson" <sean.j.christopherson@intel.com>
Subject: Re: [PATCH v5 0/8] KVM: nVMX: Add full nested support for "load IA32_PERF_GLOBAL_CTRL" VM-{Entry,Exit} control
Date: Mon, 18 Nov 2019 21:17:38 -0800	[thread overview]
Message-ID: <20191119051738.GA2386@google.com> (raw)
In-Reply-To: <828732bd-4b22-6ae8-7dd9-a8ec54c927ec@redhat.com>

On Fri, Nov 15, 2019 at 01:19:46PM +0100, Paolo Bonzini wrote:
> On 14/11/19 01:17, Oliver Upton wrote:
> > [v1] https://lore.kernel.org/r/20190828234134.132704-1-oupton@google.com
> > [v2] https://lore.kernel.org/r/20190903213044.168494-1-oupton@google.com
> > [v3] https://lore.kernel.org/r/20190903215801.183193-1-oupton@google.com
> > [v4] https://lore.kernel.org/r/20190906210313.128316-1-oupton@google.com
> > 
> > v1 => v2:
> >  - Add Krish's Co-developed-by and Signed-off-by tags.
> >  - Fix minor nit to kvm-unit-tests to use 'host' local variable
> >    throughout test_load_pgc()
> >  - Teach guest_state_test_main() to check guest state from within nested
> >    VM
> >  - Update proposed tests to use guest/host state checks, wherein the
> >    value is checked from MSR_CORE_PERF_GLOBAL_CTRL.
> >  - Changelog line wrapping
> > 
> > v2 => v3:
> >  - Remove the value unchanged condition from
> >    kvm_is_valid_perf_global_ctrl
> >  - Add line to changelog for patch 3/8
> > 
> > v3 => v4:
> >  - Allow tests to set the guest func multiple times
> >  - Style fixes throughout kvm-unit-tests patches, per Krish's review
> > 
> > v4 => v5:
> >  - Rebased kernel and kvm-unit-tests patches
> >  - Reordered and reworked patches to now WARN on a failed
> >    kvm_set_msr()
> >  - Dropped patch to alow resetting guest in kvm-unit-tests, as the
> >    functionality is no longer needed.
> > 
> > This patchset exposes the "load IA32_PERF_GLOBAL_CTRL" to guests for nested
> > VM-entry and VM-exit. There already was some existing code that supported
> > the VM-exit ctrl, though it had an issue and was not exposed to the guest
> > anyway. These patches are based on the original set that Krish Sadhukhan
> > sent out earlier this year.
> > 
> > Oliver Upton (6):
> >   KVM: nVMX: Expose load IA32_PERF_GLOBAL_CTRL VM-{Entry,Exit} control
> >   KVM: nVMX: Load GUEST_IA32_PERF_GLOBAL_CTRL MSR on VM-Entry
> >   KVM: nVMX: Use kvm_set_msr to load IA32_PERF_GLOBAL_CTRL on VM-Exit
> >   KVM: nVMX: Check HOST_IA32_PERF_GLOBAL_CTRL on VM-Entry
> >   KVM: nVMX: Check GUEST_IA32_PERF_GLOBAL_CTRL on VM-Entry
> >   KVM: VMX: Add helper to check reserved bits in IA32_PERF_GLOBAL_CTRL
> > 
> >  arch/x86/kvm/pmu.h           |  6 ++++++
> >  arch/x86/kvm/vmx/nested.c    | 51 +++++++++++++++++++++++++++++++++++++++++++++++++--
> >  arch/x86/kvm/vmx/nested.h    |  1 +
> >  arch/x86/kvm/vmx/pmu_intel.c |  5 ++++-
> > 
> 
> Queued, thanks.
> 
> But I had to squash this in patch 8:
> 
> diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> index 3129385..b6233ae 100644
> --- a/x86/vmx_tests.c
> +++ b/x86/vmx_tests.c
> @@ -7161,6 +7161,7 @@ static void test_perf_global_ctrl(u32 nr, const
> char *name, u32 ctrl_nr,
>  		report_prefix_pop();
>  	}
> 
> +	data->enabled = false;
>  	report_prefix_pop();
>  	vmcs_write(ctrl_nr, ctrl_saved);
>  	vmcs_write(nr, pgc_saved);
> 
> and I'm not sure about how this could have worked for you.
> 
> Paolo

Thanks for the fix. This was an oversight of mine as I had only run the
tests I introduced individually. I'll be more thorough in future
changes, apologies.

--
Best,
Oliver

      reply	other threads:[~2019-11-19  5:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14  0:17 [PATCH v5 0/8] KVM: nVMX: Add full nested support for "load IA32_PERF_GLOBAL_CTRL" VM-{Entry,Exit} control Oliver Upton
2019-11-14  0:17 ` [PATCH v5 1/8] KVM: VMX: Add helper to check reserved bits in IA32_PERF_GLOBAL_CTRL Oliver Upton
2019-11-14  0:17 ` [PATCH v5 2/8] KVM: nVMX: Check GUEST_IA32_PERF_GLOBAL_CTRL on VM-Entry Oliver Upton
2019-11-14  0:17 ` [PATCH v5 3/8] KVM: nVMX: Check HOST_IA32_PERF_GLOBAL_CTRL " Oliver Upton
2019-11-14  0:17 ` [PATCH v5 4/8] KVM: nVMX: Use kvm_set_msr to load IA32_PERF_GLOBAL_CTRL on VM-Exit Oliver Upton
2019-11-14  0:17 ` [PATCH v5 5/8] KVM: nVMX: Load GUEST_IA32_PERF_GLOBAL_CTRL MSR on VM-Entry Oliver Upton
2019-11-14  0:17 ` [PATCH v5 6/8] KVM: nVMX: Expose load IA32_PERF_GLOBAL_CTRL VM-{Entry,Exit} control Oliver Upton
2019-11-14  0:17 ` [kvm-unit-tests PATCH v5 7/8] x86: VMX: Make guest_state_test_main() check state from nested VM Oliver Upton
2019-11-14  0:17 ` [kvm-unit-tests PATCH v5 8/8] x86: VMX: Add tests for nested "load IA32_PERF_GLOBAL_CTRL" Oliver Upton
2019-11-15 12:19 ` [PATCH v5 0/8] KVM: nVMX: Add full nested support for "load IA32_PERF_GLOBAL_CTRL" VM-{Entry,Exit} control Paolo Bonzini
2019-11-19  5:17   ` Oliver Upton [this message]

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=20191119051738.GA2386@google.com \
    --to=oupton@google.com \
    --cc=jmattson@google.com \
    --cc=krish.sadhukhan@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=pshier@google.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.