From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gianluca Guida Subject: [VPID] Invalidate VPID mapping on INVLPG? [PATCH] Date: Wed, 30 Apr 2008 15:25:32 +0100 Message-ID: <4818815C.2040000@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000402010100010302040704" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------000402010100010302040704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------000402010100010302040704 Content-Type: text/x-patch; name="vpid_invlpg.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="vpid_invlpg.patch" 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 ) --------------000402010100010302040704 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000402010100010302040704--