Thread (19 messages) 19 messages, 3 authors, 2021-08-12

[kvm-unit-tests PATCH 02/12] nSVM: Replace open coded NX manipulation with appropriate macros

STALE1877d

From: Sean Christopherson <seanjc@google.com>
Date: 2021-06-22 21:00:57
Subsystem: the rest · Maintainer: Linus Torvalds

Use PT64_NX_MASK and EFER_NX to set/clear the NX bits in the NPT tests.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 x86/svm_tests.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/x86/svm_tests.c b/x86/svm_tests.c
index df4c60a..4bfde2c 100644
--- a/x86/svm_tests.c
+++ b/x86/svm_tests.c
@@ -707,16 +707,16 @@ static void npt_nx_prepare(struct svm_test *test)
     vmcb_ident(vmcb);
     pte = npt_get_pte((u64)null_test);
 
-    *pte |= (1ULL << 63);
+    *pte |= PT64_NX_MASK;
 }
 
 static bool npt_nx_check(struct svm_test *test)
 {
     u64 *pte = npt_get_pte((u64)null_test);
 
-    *pte &= ~(1ULL << 63);
+    *pte &= ~PT64_NX_MASK;
 
-    vmcb->save.efer |= (1 << 11);
+    vmcb->save.efer |= EFER_NX;
 
     return (vmcb->control.exit_code == SVM_EXIT_NPF)
            && (vmcb->control.exit_info_1 == 0x100000015ULL);
-- 
2.32.0.288.g62a8d224e6-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help