From: Keir Fraser Date: Thu, 1 May 2008 15:07:56 +0000 (+0100) Subject: Intel vpid: Invalidate VPID mapping on INVLPG. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14215^2~92 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2608f924e4f35ae59e84a29008a004e6fd53f909;p=xen.git Intel vpid: Invalidate VPID mapping on INVLPG. Signed-off-by: Gianluca Guida --- diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 33e105753c..387637b87c 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -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) \ diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h index 58834e7f7d..b7681f0e29 100644 --- a/xen/include/asm-x86/hvm/vmx/vmx.h +++ b/xen/include/asm-x86/hvm/vmx/vmx.h @@ -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 )