[kvm-unit-tests PATCH 2/3] x86/access: Skip running guest physical bits tests on AMD with NPT enabled

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

 



Since we can't handle NPT VM exits properly. We won't run
guest physical bits tests if NPT is enabled.

Signed-off-by: Mohammed Gamal <mgamal@xxxxxxxxxx>
---
 x86/access.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/x86/access.c b/x86/access.c
index 7dc9eb6..90c5fe4 100644
--- a/x86/access.c
+++ b/x86/access.c
@@ -973,6 +973,14 @@ static int ac_test_run(void)
         invalid_mask |= AC_PTE_BIT36_MASK;
     }
 
+    if (this_cpu_has(X86_FEATURE_NPT)) {
+        printf("NPT enabled. Skipping physical bits tests\n");
+        invalid_mask |= AC_PDE_BIT51_MASK;
+        invalid_mask |= AC_PTE_BIT51_MASK;
+        invalid_mask |= AC_PDE_BIT36_MASK;
+        invalid_mask |= AC_PTE_BIT36_MASK;
+    }
+
     if (this_cpu_has(X86_FEATURE_PKU)) {
         set_cr4_pke(1);
         set_cr4_pke(0);
-- 
2.26.2




[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