diff mbox

[kvm-unit-tests,1/3] x86: svm: fix exitinfo values for NPT tests

Message ID 1409670328-14384-2-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini Sept. 2, 2014, 3:05 p.m. UTC
The exitinfo values were plain wrong for the page-walk tests
(including npt_rsvd), or else they were missing bits 32:33.
Expect the right values.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 x86/svm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Joerg Roedel Sept. 2, 2014, 4:14 p.m. UTC | #1
On Tue, Sep 02, 2014 at 05:05:26PM +0200, Paolo Bonzini wrote:
> The exitinfo values were plain wrong for the page-walk tests
> (including npt_rsvd), or else they were missing bits 32:33.
> Expect the right values.

Are bits 32:33 really emulated? IIRC they were not emulated in the
inital implementation, and they are missing in some hardware NPT
implementations as well.


	Joerg

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/x86/svm.c b/x86/svm.c
index 00b3191..c4d6d94 100644
--- a/x86/svm.c
+++ b/x86/svm.c
@@ -703,7 +703,7 @@  static bool npt_nx_check(struct test *test)
     test->vmcb->save.efer |= (1 << 11);
 
     return (test->vmcb->control.exit_code == SVM_EXIT_NPF)
-           && (test->vmcb->control.exit_info_1 == 0x15);
+           && (test->vmcb->control.exit_info_1 == 0x100000015ULL);
 }
 
 static void npt_us_prepare(struct test *test)
@@ -728,7 +728,7 @@  static bool npt_us_check(struct test *test)
     *pte |= (1ULL << 2);
 
     return (test->vmcb->control.exit_code == SVM_EXIT_NPF)
-           && (test->vmcb->control.exit_info_1 == 0x05);
+           && (test->vmcb->control.exit_info_1 == 0x100000005ULL);
 }
 
 static void npt_rsvd_prepare(struct test *test)
@@ -744,7 +744,7 @@  static bool npt_rsvd_check(struct test *test)
     pdpe[0] &= ~(1ULL << 8);
 
     return (test->vmcb->control.exit_code == SVM_EXIT_NPF)
-            && (test->vmcb->control.exit_info_1 == 0x0f);
+            && (test->vmcb->control.exit_info_1 == 0x200000006ULL);
 }
 
 static void npt_rw_prepare(struct test *test)
@@ -772,7 +772,7 @@  static bool npt_rw_check(struct test *test)
     *pte |= (1ULL << 1);
 
     return (test->vmcb->control.exit_code == SVM_EXIT_NPF)
-           && (test->vmcb->control.exit_info_1 == 0x07);
+           && (test->vmcb->control.exit_info_1 == 0x100000007ULL);
 }
 
 static void npt_pfwalk_prepare(struct test *test)
@@ -793,7 +793,7 @@  static bool npt_pfwalk_check(struct test *test)
     *pte |= (1ULL << 1);
 
     return (test->vmcb->control.exit_code == SVM_EXIT_NPF)
-           && (test->vmcb->control.exit_info_1 == 0x7)
+           && (test->vmcb->control.exit_info_1 == 0x200000006ULL)
 	   && (test->vmcb->control.exit_info_2 == read_cr3());
 }