]> xenbits.xensource.com Git - xen.git/commitdiff
Intel vpid: Invalidate VPID mapping on INVLPG.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 1 May 2008 15:07:56 +0000 (16:07 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 1 May 2008 15:07:56 +0000 (16:07 +0100)
Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/vmx/vmx.h

index 33e105753c998f652714564bd3b408d12fa6c2ab..387637b87cd45d50ce9a1f1159ad403c4519f576 100644 (file)
@@ -1368,7 +1368,8 @@ static void vmx_invlpg_intercept(unsigned long vaddr)
 {
     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)      \
index 58834e7f7d9565493fb3c52ec1e063c63cf9339d..b7681f0e29fa75c81ba8d21056ac206a4409d02b 100644 (file)
@@ -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 )