diff options
author | Nadav Amit <namit@vmware.com> | 2020-06-30 02:45:15 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-07-01 08:10:30 -0400 |
commit | c6405e37295930dbb545be178d18a46adcae629f (patch) | |
tree | 68fb052550c7e462b8a4349ed66c6d62bda10ab8 | |
parent | c803b19b843ff13d052fca76cb8685e8d5d564d9 (diff) | |
download | kvm-unit-tests-c6405e37295930dbb545be178d18a46adcae629f.tar.gz |
x86: svm: use PML4E in npt_rsvd_pfwalk_prepare
According to AMD manual bit 8 of the PDPE is not reserved, but it is in PML4E.
Reported-by: Nadav Amit <namit@vmware.com>
Message-Id: <20200630094516.22983-5-namit@vmware.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | x86/svm.c | 5 | ||||
-rw-r--r-- | x86/svm.h | 1 | ||||
-rw-r--r-- | x86/svm_tests.c | 4 |
3 files changed, 8 insertions, 2 deletions
@@ -49,6 +49,11 @@ u64 *npt_get_pdpe(void) return pdpe; } +u64 *npt_get_pml4e(void) +{ + return pml4e; +} + bool smp_supported(void) { return cpu_count() > 1; @@ -365,6 +365,7 @@ typedef void (*test_guest_func)(struct svm_test *); u64 *npt_get_pte(u64 address); u64 *npt_get_pde(u64 address); u64 *npt_get_pdpe(void); +u64 *npt_get_pml4e(void); bool smp_supported(void); bool default_supported(void); void default_prepare(struct svm_test *test); diff --git a/x86/svm_tests.c b/x86/svm_tests.c index 92cefaf..b540527 100644 --- a/x86/svm_tests.c +++ b/x86/svm_tests.c @@ -824,13 +824,13 @@ static void npt_rsvd_pfwalk_prepare(struct svm_test *test) u64 *pdpe; vmcb_ident(vmcb); - pdpe = npt_get_pdpe(); + pdpe = npt_get_pml4e(); pdpe[0] |= (1ULL << 8); } static bool npt_rsvd_pfwalk_check(struct svm_test *test) { - u64 *pdpe = npt_get_pdpe(); + u64 *pdpe = npt_get_pml4e(); pdpe[0] &= ~(1ULL << 8); return (vmcb->control.exit_code == SVM_EXIT_NPF) |