diff mbox series

[kvm-unit-tests,2/4] x86: svm: present bit is set on nested page-faults

Message ID 20200710183320.27266-3-namit@vmware.com (mailing list archive)
State New, archived
Headers show
Series x86: svm: bare-metal fixes | expand

Commit Message

Nadav Amit July 10, 2020, 6:33 p.m. UTC
On nested page-faults due to write-protect or reserved bits, the
present-bit in EXITINFO1 is set, as confirmed on bare-metal.  Set the
expected result accordingly.

This indicates that KVM has a bug.

Signed-off-by: Nadav Amit <namit@vmware.com>
---
 x86/svm_tests.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/x86/svm_tests.c b/x86/svm_tests.c
index 9adee23..7069e0b 100644
--- a/x86/svm_tests.c
+++ b/x86/svm_tests.c
@@ -816,7 +816,7 @@  static bool npt_rw_pfwalk_check(struct svm_test *test)
     *pte |= (1ULL << 1);
 
     return (vmcb->control.exit_code == SVM_EXIT_NPF)
-           && (vmcb->control.exit_info_1 == 0x200000006ULL)
+           && (vmcb->control.exit_info_1 == 0x200000007ULL)
 	   && (vmcb->control.exit_info_2 == read_cr3());
 }
 
@@ -835,7 +835,7 @@  static bool npt_rsvd_pfwalk_check(struct svm_test *test)
     pdpe[0] &= ~(1ULL << 8);
 
     return (vmcb->control.exit_code == SVM_EXIT_NPF)
-            && (vmcb->control.exit_info_1 == 0x20000000eULL);
+            && (vmcb->control.exit_info_1 == 0x20000000fULL);
 }
 
 static void npt_l1mmio_prepare(struct svm_test *test)