diff mbox

[kvm-unit-tests] x86: pcid: fix clearing of CR0.PG

Message ID 1407234727-529-1-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini Aug. 5, 2014, 10:32 a.m. UTC
The test was trying to set CR0.PG, not clear it (and it was
already set, even).

Reported-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 x86/pcid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/x86/pcid.c b/x86/pcid.c
index 164e9a1..e3ccfdb 100644
--- a/x86/pcid.c
+++ b/x86/pcid.c
@@ -53,7 +53,7 @@  void test_pcid_enabled(void)
         goto report;
 
     /* try clearing CR0.PG when CR4.PCIDE=1, #GP expected */
-    if (write_cr0_checking(cr0 | X86_CR0_PG) != GP_VECTOR)
+    if (write_cr0_checking(cr0 & ~X86_CR0_PG) != GP_VECTOR)
         goto report;
 
     write_cr4(cr4);