kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] x86: VMX: INVEPT after modifying PA mapping in ept_untwiddle
@ 2019-08-28  8:29 Oliver Upton
  2019-09-11 15:45 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Upton @ 2019-08-28  8:29 UTC (permalink / raw)
  To: kvm, Paolo Bonzini, Radim Krčmář
  Cc: Jim Mattson, Oliver Upton, Peter Shier

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@google.com>
Signed-off-by: Oliver Upton <oupton@google.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [kvm-unit-tests PATCH] x86: VMX: INVEPT after modifying PA mapping in ept_untwiddle
  2019-08-28  8:29 [kvm-unit-tests PATCH] x86: VMX: INVEPT after modifying PA mapping in ept_untwiddle Oliver Upton
@ 2019-09-11 15:45 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2019-09-11 15:45 UTC (permalink / raw)
  To: Oliver Upton, kvm, Radim Krčmář; +Cc: Jim Mattson, Peter Shier

On 28/08/19 10:29, Oliver Upton wrote:
> 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@google.com>
> Signed-off-by: Oliver Upton <oupton@google.com>
> ---
>  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,
> 

Queued, thanks.

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-11 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28  8:29 [kvm-unit-tests PATCH] x86: VMX: INVEPT after modifying PA mapping in ept_untwiddle Oliver Upton
2019-09-11 15:45 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).