[PATCH kvm-unit-tests] x86: fix access.flat on non-SMEP machines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We need to restore PDPE.U=1, similar to what the tests do after printing
the "Set SMEP in CR4 - expect #GP: FAIL" message.

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 x86/access.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/x86/access.c b/x86/access.c
index a0c19dc..11f561b 100644
--- a/x86/access.c
+++ b/x86/access.c
@@ -207,7 +207,7 @@ unsigned set_cr4_smep(int smep)
     if (smep)
         ptl2[2] &= ~PT_USER_MASK;
     r = write_cr4_checking(cr4);
-    if (!smep)
+    if (r || !smep)
         ptl2[2] |= PT_USER_MASK;
     return r;
 }
-- 
1.8.3.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux