public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: Flush all VPID tagged TLB when VMXON
@ 2008-06-17  9:39 Yang, Sheng
  2008-06-22  7:35 ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Yang, Sheng @ 2008-06-17  9:39 UTC (permalink / raw)
  To: kvm

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

From efba05901f8ffca03208217d075f679f78f3469d Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
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 <sheng.yang@intel.com>
---
 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
--- 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);
 }

+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;

--
1.5.5


[-- Attachment #2: 0001-KVM-VMX-Flush-all-VPID-tagged-TLB-when-VMXON.patch --]
[-- Type: text/x-diff, Size: 1047 bytes --]

From efba05901f8ffca03208217d075f679f78f3469d Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
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 <sheng.yang@intel.com>
---
 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
--- 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);
 }
 
+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;
 
-- 
1.5.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: VMX: Flush all VPID tagged TLB when VMXON
  2008-06-17  9:39 [PATCH] KVM: VMX: Flush all VPID tagged TLB when VMXON Yang, Sheng
@ 2008-06-22  7:35 ` Avi Kivity
  2008-06-23  1:30   ` Yang, Sheng
  0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2008-06-22  7:35 UTC (permalink / raw)
  To: Yang, Sheng; +Cc: kvm

Yang, Sheng wrote:
> From efba05901f8ffca03208217d075f679f78f3469d Mon Sep 17 00:00:00 2001
> From: Sheng Yang <sheng.yang@intel.com>
> Date: Tue, 17 Jun 2008 17:41:10 +0800
> Subject: [PATCH] KVM: VMX: Flush all VPID tagged TLB when VMXON
>
>   

Why is this needed?  Don't we flush a vpid immediately after allocating it?

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: VMX: Flush all VPID tagged TLB when VMXON
  2008-06-22  7:35 ` Avi Kivity
@ 2008-06-23  1:30   ` Yang, Sheng
  0 siblings, 0 replies; 3+ messages in thread
From: Yang, Sheng @ 2008-06-23  1:30 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm

On Sunday 22 June 2008 15:35:35 Avi Kivity wrote:
> Yang, Sheng wrote:
> > From efba05901f8ffca03208217d075f679f78f3469d Mon Sep 17 00:00:00 2001
> > From: Sheng Yang <sheng.yang@intel.com>
> > Date: Tue, 17 Jun 2008 17:41:10 +0800
> > Subject: [PATCH] KVM: VMX: Flush all VPID tagged TLB when VMXON
>
> Why is this needed?  Don't we flush a vpid immediately after allocating it?

O, damn, I had a bad memory...

Please ignore this...

-- 
Thanks
Yang, Sheng



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-23  1:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-17  9:39 [PATCH] KVM: VMX: Flush all VPID tagged TLB when VMXON Yang, Sheng
2008-06-22  7:35 ` Avi Kivity
2008-06-23  1:30   ` Yang, Sheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox