x86: VMX: INVEPT after modifying PA mapping in ept_untwiddle
PATCH 1/1 x86: VMX: INVEPT after modifying PA mapping in ept_untwiddle
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".
--- x86/vmx_tests.c | 1 + 1 file changed, 1 insertion(+)
x86/vmx_tests.c +1 -0
@@ -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,
Signature · 1 line
2.23.0.187.g17f5b7556c-goog
Quoted 18 lines · Oliver Upton
ept_untwiddlemodifies 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 <[email protected]>Signed-off-by Oliver Upton <[email protected]>--- x86/vmx_tests.c | 1 + 1 file changed, 1 insertion(+)x86/vmx_tests.c +0
-0
x86/vmx_tests.c static unsigned long ept_twiddle(unsigned long gpa, bool mkhuge, int level, · line 2382
Quoted 7 lines
x86/vmx_tests.c +1
-0@@ -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,
Queued, thanks.
Paolo