]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: VMX: flush TLB with INVEPT on cpu migration
authorMarcelo Tosatti <mtosatti@redhat.com>
Thu, 1 Oct 2009 22:16:58 +0000 (19:16 -0300)
committerMarcelo Tosatti <mtosatti@redhat.com>
Thu, 1 Oct 2009 23:47:11 +0000 (20:47 -0300)
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.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c

index e86f1a66316c5b450093bd65839e4e83b71079e5..97f4265cda3852107590edec2482a925b296d307 100644 (file)
@@ -708,7 +708,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));