[PATCH kvm-unit-tests 1/2] vmx: always perform access with modified page table for PADDR tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Even if we do not expect a violation, we should try and perform the
access while the EPT page tables have been modified.  Without this
change, ept_access_paddr is basically a no-op with expect_violation
equal to false.

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 x86/vmx_tests.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 734d785..e1f92d4 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -2340,12 +2340,15 @@ static void ept_access_paddr(unsigned long ept_access, unsigned long pte_ad,
 	orig_epte = ept_twiddle(gpa, /*mkhuge=*/0, /*level=*/1,
 				/*clear=*/EPT_PRESENT, /*set=*/ept_access);
 
-	if (expect_violation)
+	if (expect_violation) {
 		do_ept_violation(/*leaf=*/true, op,
 				 expected_qual | EPT_VLT_LADDR_VLD, gpa);
-
-	ept_untwiddle(gpa, /*level=*/1, orig_epte);
-	do_ept_access_op(op);
+		ept_untwiddle(gpa, /*level=*/1, orig_epte);
+		do_ept_access_op(op);
+	} else {
+		do_ept_access_op(op);
+		ept_untwiddle(gpa, /*level=*/1, orig_epte);
+	}
 
 	TEST_ASSERT(*ptep & PT_ACCESSED_MASK);
 	if ((pte_ad & PT_DIRTY_MASK) || op == OP_WRITE)
-- 
1.8.3.1





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux