From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v5] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices Date: Tue, 29 Jun 2010 16:28:35 +0300 Message-ID: <4C29F503.7020400@redhat.com> References: <4C286CCE.10309@redhat.com> <1277781419-13227-1-git-send-email-sheng@linux.intel.com> <20100629132541.GB27338@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Sheng Yang , Jan Kiszka , Joerg Roedel , kvm@vger.kernel.org, "Yaozu (Eddie) Dong" To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51863 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754103Ab0F2N2l (ORCPT ); Tue, 29 Jun 2010 09:28:41 -0400 In-Reply-To: <20100629132541.GB27338@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 06/29/2010 04:25 PM, Marcelo Tosatti wrote: > >> + smp_call_function_single(vcpu->cpu, >> + wbinvd_ipi, NULL, 1); >> + } >> + >> kvm_x86_ops->vcpu_load(vcpu, cpu); >> if (unlikely(per_cpu(cpu_tsc_khz, cpu) == 0)) { >> unsigned long khz = cpufreq_quick_get(cpu); >> @@ -3650,6 +3670,21 @@ int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address) >> return X86EMUL_CONTINUE; >> } >> >> +int kvm_emulate_wbinvd(struct kvm_vcpu *vcpu) >> +{ >> + if (!need_emulate_wbinvd(vcpu)) >> + return X86EMUL_CONTINUE; >> + >> + if (kvm_x86_ops->has_wbinvd_exit()) { >> + smp_call_function_many(vcpu->arch.wbinvd_dirty_mask, >> + wbinvd_ipi, NULL, 1); >> > work_on_cpu() loop instead of smp_call_function_many(), to avoid executing > wbinvd with interrupts disabled. > Why? wbinvd is not interruptible. -- error compiling committee.c: too many arguments to function