All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Upton <oupton@google.com>
To: Jim Mattson <jmattson@google.com>
Cc: "kvm list" <kvm@vger.kernel.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Peter Shier" <pshier@google.com>
Subject: Re: [kvm-unit-tests PATCH 7/7] x86: VMX: Add tests for nested "load IA32_PERF_GLOBAL_CTRL"
Date: Thu, 29 Aug 2019 12:58:41 -0700	[thread overview]
Message-ID: <20190829195841.GA188698@google.com> (raw)
In-Reply-To: <CALMp9eTsd2YQxqDu9cXfJiMr1DK41oJbnBW3zRAw10k+uNuGmA@mail.gmail.com>

On Thu, Aug 29, 2019 at 10:33:48AM -0700, Jim Mattson wrote:
> On Wed, Aug 28, 2019 at 4:41 PM Oliver Upton <oupton@google.com> wrote:
> >
> > Tests to verify that KVM performs the correct checks on Host/Guest state
> > at VM-entry, as described in SDM 26.3.1.1 "Checks on Guest Control
> > Registers, Debug Registers, and MSRs" and SDM 26.2.2 "Checks on Host
> > Control Registers and MSRs".
> >
> > Test that KVM does the following:
> >
> >     If the "load IA32_PERF_GLOBAL_CTRL" VM-entry control is 1, the
> >     reserved bits of the IA32_PERF_GLOBAL_CTRL MSR must be 0 in the
> >     GUEST_IA32_PERF_GLOBAL_CTRL VMCS field. Otherwise, the VM-entry
> >     should fail with an exit reason of "VM-entry failure due to invalid
> >     guest state" (33).
> >
> >     If the "load IA32_PERF_GLOBAL_CTRL" VM-exit control is 1, the
> >     reserved bits of the IA32_PERF_GLOBAL_CTRL MSR must be 0 in the
> >     HOST_IA32_PERF_GLOBAL_CTRL VMCS field. Otherwise, the VM-entry
> >     should fail with a VM-instruction error of "VM entry with invalid
> >     host-state field(s)" (8).
> 
> Could you add a simple functionality test as well? That is, after a
> successful nested VM-entry, the L2 guest should be able to observe the
> GUEST_IA32_PERF_GLOBAL_CTRL value when it reads the
> IA32_PERF_GLOBAL_CTRL MSR, and after a subsequent nested VM-exit, the
> L1 guest should be able to observe the HOST_IA32_PERF_GLOBAL_CTRL
> value when it reads the IA32_PERF_GLOBAL_CTRL MSR.

Definitely should. I think I can just add it as an additional check to
the common test code for host and guest tests, since we already have the
guest brought up and configured correctly anyway.

I have a couple style nits to correct in this patch as well. I'll add
this to the v2 I'm going to send out for the series.

      reply	other threads:[~2019-08-29 19:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 23:41 [PATCH 0/7] KVM: VMX: Add full nested support for IA32_PERF_GLOBAL_CTRL Oliver Upton
2019-08-28 23:41 ` [PATCH 1/7] KVM: nVMX: Use kvm_set_msr to load IA32_PERF_GLOBAL_CTRL on vmexit Oliver Upton
2019-08-29  1:30   ` Krish Sadhukhan
2019-08-29  2:02     ` Oliver Upton
2019-08-29  7:19       ` Krish Sadhukhan
2019-08-29  8:07         ` Oliver Upton
2019-08-29 16:47           ` Krish Sadhukhan
2019-08-29 17:02   ` Jim Mattson
2019-08-28 23:41 ` [PATCH 2/7] KVM: nVMX: Load GUEST_IA32_PERF_GLOBAL_CTRL MSR on vmentry Oliver Upton
2019-08-30 17:58   ` Sean Christopherson
2019-08-28 23:41 ` [PATCH 3/7] KVM: VMX: Add helper to check reserved bits in MSR_CORE_PERF_GLOBAL_CTRL Oliver Upton
2019-08-30 18:26   ` Sean Christopherson
2019-08-30 19:20     ` Jim Mattson
2019-08-30 19:50       ` Oliver Upton
2019-08-28 23:41 ` [PATCH 4/7] KVM: nVMX: check GUEST_IA32_PERF_GLOBAL_CTRL on VM-Entry Oliver Upton
2019-08-30 18:37   ` Sean Christopherson
2019-08-30 20:12     ` Oliver Upton
2019-08-28 23:41 ` [PATCH 5/7] KVM: nVMX: Check HOST_IA32_PERF_GLOBAL_CTRL on VM-entry Oliver Upton
2019-08-28 23:41 ` [PATCH 6/7] KVM: nVMX: Enable load IA32_PERF_GLOBAL_CTRL vm control if supported Oliver Upton
2019-08-29 17:28   ` Jim Mattson
2019-08-28 23:41 ` [kvm-unit-tests PATCH 7/7] x86: VMX: Add tests for nested "load IA32_PERF_GLOBAL_CTRL" Oliver Upton
2019-08-29 17:33   ` Jim Mattson
2019-08-29 19:58     ` 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=20190829195841.GA188698@google.com \
    --to=oupton@google.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=pshier@google.com \
    --cc=rkrcmar@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 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.