All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gianluca Guida <gianluca.guida@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [VPID] Invalidate VPID mapping on INVLPG? [PATCH]
Date: Wed, 30 Apr 2008 15:25:32 +0100	[thread overview]
Message-ID: <4818815C.2040000@eu.citrix.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

Hello,

In processors supporting VPID I think we should invalidate the VPID 
mapping in the TLB after a shadow invlpg (in case EPT is turned off).

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>

Gianluca

[-- Attachment #2: vpid_invlpg.patch --]
[-- Type: text/x-patch, Size: 1043 bytes --]

diff -r 483d006cc607 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Fri Apr 25 13:46:27 2008 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Apr 30 15:07:48 2008 +0100
@@ -1368,7 +1368,8 @@ static void vmx_invlpg_intercept(unsigne
 {
     struct vcpu *curr = current;
     HVMTRACE_2D(INVLPG, curr, /*invlpga=*/ 0, vaddr);
-    paging_invlpg(curr, vaddr);
+    if ( paging_invlpg(curr, vaddr) )
+        vpid_sync_vcpu_gva(curr, vaddr);
 }
 
 #define CASE_SET_REG(REG, reg)      \
diff -r 483d006cc607 xen/include/asm-x86/hvm/vmx/vmx.h
--- a/xen/include/asm-x86/hvm/vmx/vmx.h	Fri Apr 25 13:46:27 2008 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vmx.h	Wed Apr 30 15:07:48 2008 +0100
@@ -301,6 +301,12 @@ static inline void ept_sync_all(void)
 
 void ept_sync_domain(struct domain *d);
 
+static inline void vpid_sync_vcpu_gva(struct vcpu *v, unsigned long gva)
+{
+    if ( cpu_has_vmx_vpid )
+        __invvpid(0, v->arch.hvm_vmx.vpid, (u64)gva);
+}
+
 static inline void vpid_sync_vcpu_all(struct vcpu *v)
 {
     if ( cpu_has_vmx_vpid )

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2008-04-30 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30 14:25 Gianluca Guida [this message]
2008-05-01 15:50 ` [VPID] Invalidate VPID mapping on INVLPG? [PATCH] Li, Xin B

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4818815C.2040000@eu.citrix.com \
    --to=gianluca.guida@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.