diff mbox series

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

Message ID 20210622210047.3691840-3-seanjc@google.com (mailing list archive)
State New, archived
Headers show
Series nSVM: NPT improvements and cleanups | expand

Commit Message

Sean Christopherson June 22, 2021, 9 p.m. UTC
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 mbox series

Patch

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);