linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] KVM: nVMX: fix flush vpid01 during nested vmentry/vmexit
       [not found] <1443004018-45326-1-git-send-email-wanpeng.li@hotmail.com>
@ 2015-09-23 10:26 ` Wanpeng Li
  0 siblings, 0 replies; only message in thread
From: Wanpeng Li @ 2015-09-23 10:26 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Jan Kiszka, Bandan Das, Wincy Van, kvm, linux-kernel, Wanpeng Li

vpid_sync_vcpu_single() still handles vpid01 during nested 
vmentry/vmexit since vmx->vpid is used for invvpid. This 
patch fix it by specific the vpid02 through __vmx_flush_tlb() 
to flush the right vpid.

Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
 arch/x86/kvm/vmx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 7188c5e..31fb631 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7207,7 +7207,7 @@ static int handle_invvpid(struct kvm_vcpu *vcpu)
 	case VMX_VPID_EXTENT_INDIVIDUAL_ADDR:
 	case VMX_VPID_EXTENT_SINGLE_CONTEXT:
 	case VMX_VPID_EXTENT_ALL_CONTEXT:
-		vmx_flush_tlb(vcpu);
+		__vmx_flush_tlb(vcpu, to_vmx(vcpu)->nested.vpid02);
 		nested_vmx_succeed(vcpu);
 		break;
 	default:
@@ -9501,7 +9501,7 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
 			vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->nested.vpid02);
 			if (vmcs12->virtual_processor_id != vmx->nested.last_vpid) {
 				vmx->nested.last_vpid = vmcs12->virtual_processor_id;
-				vmx_flush_tlb(vcpu);
+				__vmx_flush_tlb(vcpu, to_vmx(vcpu)->nested.vpid02);
 			}
 		} else {
 			vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-23 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1443004018-45326-1-git-send-email-wanpeng.li@hotmail.com>
2015-09-23 10:26 ` [PATCH 2/2] KVM: nVMX: fix flush vpid01 during nested vmentry/vmexit Wanpeng Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).