From mboxrd@z Thu Jan 1 00:00:00 1970 From: Max Laier Subject: Re: KVM: VMX: flush TLB with INVEPT on cpu migration Date: Wed, 21 Oct 2009 03:18:26 +0200 Message-ID: <200910210318.27624.max@love2party.net> References: <20091001221658.GA22916@amt.cnet> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit To: Marcelo Tosatti , kvm Return-path: Received: from moutng.kundenserver.de ([212.227.17.8]:62498 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751516AbZJUBSN (ORCPT ); Tue, 20 Oct 2009 21:18:13 -0400 In-Reply-To: <20091001221658.GA22916@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Friday 02 October 2009 00:16:58 you wrote: > 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. Thank you - I was at the brink of a nervous break-down before discovering this. Maybe it would help for the future to add a comment to ept_misconfig_inspect_spte that explains that this might be caused by out of sync tlbs, too (esp. when it doesn't show an apparent cause of the misconfig) > Signed-off-by: Marcelo Tosatti > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index e86f1a6..97f4265 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -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)); > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > !DSPAM:4ac52dbb832371894110002! > -- /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News