KVM Archive on lore.kernel.org
 help / color / 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	[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, back to index

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

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org kvm@archiver.kernel.org
	public-inbox-index kvm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox