From: Marcelo Tosatti Date: Thu, 1 Oct 2009 22:16:58 +0000 (-0300) Subject: KVM: VMX: flush TLB with INVEPT on cpu migration X-Git-Tag: v2.6.32-rc4~55^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb5109e311b5152c0614a28d7d615d087f268f19;p=profile%2Fivi%2Fkernel-x86-ivi.git KVM: VMX: flush TLB with INVEPT on cpu migration It is possible that stale EPTP-tagged mappings are used, if a vcpu migrates to a different pcpu. Set KVM_REQ_TLB_FLUSH in vmx_vcpu_load, when switching pcpus, which will invalidate both VPID and EPT mappings on the next vm-entry. Cc: stable@kernel.org Signed-off-by: Marcelo Tosatti --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index f381201..ed53b42 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -709,7 +709,7 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu) if (vcpu->cpu != cpu) { vcpu_clear(vmx); kvm_migrate_timers(vcpu); - vpid_sync_vcpu_all(vmx); + set_bit(KVM_REQ_TLB_FLUSH, &vcpu->requests); local_irq_disable(); list_add(&vmx->local_vcpus_link, &per_cpu(vcpus_on_cpu, cpu));