kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Restore cr3 after tests on PCID
@ 2012-09-01  8:12 Mao, Junjie
  2012-09-04 11:59 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Mao, Junjie @ 2012-09-01  8:12 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti, 'kvm@vger.kernel.org'

The INVPCID enabling test assumes cr3[11:0] is 0. But at present PCID enabling
test sets cr3[11:0] to 1 for its own purpose and doesn't restore the register,
which leads to a failure when INVPCID test tries to enable PCIDE.

This patch restores cr3 after PCID enabling test is done so that PCIDE can be
enabled normally in later tests.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
---
 x86/pcid.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/x86/pcid.c b/x86/pcid.c
index de0f6fe..8bfeba2 100644
--- a/x86/pcid.c
+++ b/x86/pcid.c
@@ -79,6 +79,7 @@ void test_pcid_enabled(void)
     write_cr3(cr3 | 0x001);
     if (write_cr4_checking(cr4 | X86_CR4_PCIDE) != GP_VECTOR)
         goto report;
+    write_cr3(cr3);

     passed = 1;

--
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Restore cr3 after tests on PCID
  2012-09-01  8:12 [PATCH] Restore cr3 after tests on PCID Mao, Junjie
@ 2012-09-04 11:59 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2012-09-04 11:59 UTC (permalink / raw)
  To: Mao, Junjie; +Cc: Marcelo Tosatti, 'kvm@vger.kernel.org'

On 09/01/2012 11:12 AM, Mao, Junjie wrote:
> The INVPCID enabling test assumes cr3[11:0] is 0. But at present PCID enabling
> test sets cr3[11:0] to 1 for its own purpose and doesn't restore the register,
> which leads to a failure when INVPCID test tries to enable PCIDE.
> 
> This patch restores cr3 after PCID enabling test is done so that PCIDE can be
> enabled normally in later tests.

Thanks, applied.


-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-04 11:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-01  8:12 [PATCH] Restore cr3 after tests on PCID Mao, Junjie
2012-09-04 11:59 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).