[kvm-unit-tests PATCH] x86: VMX: INVEPT after modifying PA mapping in ept_untwiddle

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

 



ept_untwiddle modifies a PA mapping in the EPT paging structure.
According to the SDM 28.3.3.4, "Software should use the INVEPT
instruction with the "single-context" INVEPT type after making any of
the following changes to an EPT paging-structure entry ... Changing
the physical address in bits 51:12".

Suggested-by: Peter Shier <pshier@xxxxxxxxxx>
Signed-off-by: Oliver Upton <oupton@xxxxxxxxxx>
---
 x86/vmx_tests.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 8ad26741277f..94be937da41d 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -2376,6 +2376,7 @@ static unsigned long ept_twiddle(unsigned long gpa, bool mkhuge, int level,
 static void ept_untwiddle(unsigned long gpa, int level, unsigned long orig_pte)
 {
 	set_ept_pte(pml4, gpa, level, orig_pte);
+	ept_sync(INVEPT_SINGLE, eptp);
 }
 
 static void do_ept_violation(bool leaf, enum ept_access_op op,
-- 
2.23.0.187.g17f5b7556c-goog




[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