From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Sheng" Subject: [PATCH] KVM: VMX: Flush all VPID tagged TLB when VMXON Date: Tue, 17 Jun 2008 17:39:58 +0800 Message-ID: <200806171739.58655.sheng.yang@intel.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_uZ4VICYKMLQFy4X" To: kvm@vger.kernel.org Return-path: Received: from mga01.intel.com ([192.55.52.88]:60553 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754631AbYFQJkK (ORCPT ); Tue, 17 Jun 2008 05:40:10 -0400 Sender: kvm-owner@vger.kernel.org List-ID: --Boundary-00=_uZ4VICYKMLQFy4X Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =46rom efba05901f8ffca03208217d075f679f78f3469d Mon Sep 17 00:00:00 2001 =46rom: Sheng Yang Date: Tue, 17 Jun 2008 17:41:10 +0800 Subject: [PATCH] KVM: VMX: Flush all VPID tagged TLB when VMXON Signed-off-by: Sheng Yang =2D-- arch/x86/kvm/vmx.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6e4278d..d6caea3 100644 =2D-- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -358,6 +358,12 @@ static inline void vpid_sync_vcpu_all(struct=20 vcpu_vmx *vmx) __invvpid(VMX_VPID_EXTENT_SINGLE_CONTEXT, vmx->vpid, 0); } +static inline void vpid_sync_all(void) +{ + if (cpu_has_vmx_vpid()) + __invvpid(VMX_VPID_EXTENT_ALL_CONTEXT, 0, 0); +} + static inline void ept_sync_global(void) { if (cpu_has_vmx_invept_global()) @@ -3292,6 +3298,7 @@ static int __init vmx_init(void) kvm_mmu_set_nonpresent_ptes(~0xffeull, 0ull); ept_sync_global(); + vpid_sync_all(); return 0; =2D- 1.5.5 --Boundary-00=_uZ4VICYKMLQFy4X Content-Type: text/x-diff; charset="utf-8"; name="0001-KVM-VMX-Flush-all-VPID-tagged-TLB-when-VMXON.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-KVM-VMX-Flush-all-VPID-tagged-TLB-when-VMXON.patch" =46rom efba05901f8ffca03208217d075f679f78f3469d Mon Sep 17 00:00:00 2001 =46rom: Sheng Yang Date: Tue, 17 Jun 2008 17:41:10 +0800 Subject: [PATCH] KVM: VMX: Flush all VPID tagged TLB when VMXON Signed-off-by: Sheng Yang =2D-- arch/x86/kvm/vmx.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6e4278d..d6caea3 100644 =2D-- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -358,6 +358,12 @@ static inline void vpid_sync_vcpu_all(struct vcpu_vmx = *vmx) __invvpid(VMX_VPID_EXTENT_SINGLE_CONTEXT, vmx->vpid, 0); } =20 +static inline void vpid_sync_all(void) +{ + if (cpu_has_vmx_vpid()) + __invvpid(VMX_VPID_EXTENT_ALL_CONTEXT, 0, 0); +} + static inline void ept_sync_global(void) { if (cpu_has_vmx_invept_global()) @@ -3292,6 +3298,7 @@ static int __init vmx_init(void) kvm_mmu_set_nonpresent_ptes(~0xffeull, 0ull); =20 ept_sync_global(); + vpid_sync_all(); =20 return 0; =20 =2D-=20 1.5.5 --Boundary-00=_uZ4VICYKMLQFy4X--