From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, Karl Heubaum <karl.heubaum@oracle.com>,
Oliver Upton <oupton@google.com>,
Jim Mattson <jmattson@google.com>
Subject: Re: [kvm-unit-tests PATCH 1/2] nVMX: Restore active host RIP/CR4 after test_host_addr_size()
Date: Wed, 15 Jul 2020 11:48:10 -0700 [thread overview]
Message-ID: <20200715184810.GC12349@linux.intel.com> (raw)
In-Reply-To: <378edd35-38eb-1d62-8471-f111c17afee7@oracle.com>
On Wed, Jul 15, 2020 at 11:34:46AM -0700, Krish Sadhukhan wrote:
>
> On 7/13/20 5:23 PM, Sean Christopherson wrote:
> >Perform one last VMX transition to actually load the host's RIP and CR4
> >at the end of test_host_addr_size(). Simply writing the VMCS doesn't
> >restore the values in hardware, e.g. as is, CR4.PCIDE can be left set,
> >which causes spectacularly confusing explosions when other misguided
> >tests assume setting bit 63 in CR3 will cause a non-canonical #GP.
> >
> >Fixes: 0786c0316ac05 ("kvm-unit-test: nVMX: Check Host Address Space Size on vmentry of nested guests")
> >Cc: Krish Sadhukhan <krish.sadhukhan@oracle.com>
> >Cc: Karl Heubaum <karl.heubaum@oracle.com>
> >Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> >---
> > x86/vmx_tests.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> >diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> >index 29f3d0e..cb42a2d 100644
> >--- a/x86/vmx_tests.c
> >+++ b/x86/vmx_tests.c
> >@@ -7673,6 +7673,11 @@ static void test_host_addr_size(void)
> > vmcs_write(ENT_CONTROLS, entry_ctrl_saved | ENT_GUEST_64);
> > vmcs_write(HOST_RIP, rip_saved);
> > vmcs_write(HOST_CR4, cr4_saved);
> >+
> >+ /* Restore host's active RIP and CR4 values. */
> >+ report_prefix_pushf("restore host state");
> >+ test_vmx_vmlaunch(0);
> >+ report_prefix_pop();
> > }
> > }
> Just for my understanding. When you say, "other misguided tests", which
> tests are you referring to ? In the current sequence of tests in
> vmx_host_state_area_test(), test_load_host_perf_global_ctrl() is the one
> that follows and it runs fine.
See test_mtf_guest() in patch 2/2. https://patchwork.kernel.org/patch/11661189/
next prev parent reply other threads:[~2020-07-15 18:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-14 0:23 [kvm-unit-tests PATCH 0/2] nVMX: Two PCIDE related fixes Sean Christopherson
2020-07-14 0:23 ` [kvm-unit-tests PATCH 1/2] nVMX: Restore active host RIP/CR4 after test_host_addr_size() Sean Christopherson
2020-07-14 4:43 ` Oliver Upton
2020-07-15 18:34 ` Krish Sadhukhan
2020-07-15 18:48 ` Sean Christopherson [this message]
2020-07-15 21:34 ` Krish Sadhukhan
2020-07-15 22:22 ` Sean Christopherson
2020-07-16 0:41 ` Krish Sadhukhan
2020-07-14 0:23 ` [kvm-unit-tests PATCH 2/2] nVMX: Use the standard non-canonical value in test_mtf3 Sean Christopherson
2020-07-14 4:41 ` Oliver Upton
2020-07-15 21:31 ` [kvm-unit-tests PATCH 0/2] nVMX: Two PCIDE related fixes Krish Sadhukhan
2020-07-28 21:26 ` Paolo Bonzini
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=20200715184810.GC12349@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=jmattson@google.com \
--cc=karl.heubaum@oracle.com \
--cc=krish.sadhukhan@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=oupton@google.com \
--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 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.