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 13:42:57 +0300 Message-ID: <4C29CE31.4080101@redhat.com> References: <4C286CCE.10309@redhat.com> <1277781419-13227-1-git-send-email-sheng@linux.intel.com> <4C29BF58.20107@redhat.com> <4C29CBD1.1060604@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Sheng Yang , Marcelo Tosatti , Joerg Roedel , "kvm@vger.kernel.org" , "Yaozu (Eddie) Dong" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37807 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755153Ab0F2KnD (ORCPT ); Tue, 29 Jun 2010 06:43:03 -0400 In-Reply-To: <4C29CBD1.1060604@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On 06/29/2010 01:32 PM, Jan Kiszka wrote: > Avi Kivity wrote: > >> On 06/29/2010 06:16 AM, Sheng Yang wrote: >> >>> Some guest device driver may leverage the "Non-Snoop" I/O, and explicitly >>> WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD or >>> CLFLUSH, we need to maintain data consistency either by: >>> 1: flushing cache (wbinvd) when the guest is scheduled out if there is no >>> wbinvd exit, or >>> 2: execute wbinvd on all dirty physical CPUs when guest wbinvd exits. >>> >>> >>> >> Looks good. >> >> > There is just the question remaining if we want to add some disable > knob, maybe as an option in the device assignment configuration. > Patches welcome. Also an alternative implementation that uses clflush could also work. > I wonder what the performance impact of this feature is when using CPUs > without wbinvd exiting. Can we afford to enable it unconditionally (in > the presence of pass-through) even if the guest doesn't need it? > Correctness is more important than performance. Since we don't know whether the guest needs it or not, we have to enable it. The user may disable it if he likes. Maybe we should emit a warning that performance may degrade when pci snooping is not available. -- error compiling committee.c: too many arguments to function