From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ram Pai Subject: Re: KVM: VMX: flush TLB with INVEPT on cpu migration Date: Fri, 02 Oct 2009 13:56:45 -0700 Message-ID: <1254517005.22711.19.camel@localhost> References: <20091001221658.GA22916@amt.cnet> Reply-To: linuxram@us.ibm.com Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm , Avi Kivity , "Yang, Sheng" To: Marcelo Tosatti Return-path: Received: from e36.co.us.ibm.com ([32.97.110.154]:55656 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758210AbZJBU4r (ORCPT ); Fri, 2 Oct 2009 16:56:47 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e36.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id n92KsoNG013268 for ; Fri, 2 Oct 2009 14:54:50 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n92Kul9F175178 for ; Fri, 2 Oct 2009 14:56:47 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n92Kulrd001583 for ; Fri, 2 Oct 2009 14:56:47 -0600 In-Reply-To: <20091001221658.GA22916@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 2009-10-01 at 19:16 -0300, Marcelo Tosatti 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. > > 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)); > -- This patch fixes my ept misconfig problem seen very so often while installing sles11 guest. thanks, RP