From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgG0j-0002QS-Kl for qemu-devel@nongnu.org; Mon, 20 Oct 2014 12:40:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgG0Z-0002Ca-9V for qemu-devel@nongnu.org; Mon, 20 Oct 2014 12:40:45 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:34800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgG0Y-0002C7-Kz for qemu-devel@nongnu.org; Mon, 20 Oct 2014 12:40:35 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Oct 2014 17:40:33 +0100 Date: Mon, 20 Oct 2014 18:40:12 +0200 From: Greg Kurz Message-ID: <20141020184012.2253b39a@bahia.local> In-Reply-To: <54453398.2060102@suse.de> References: <1413788223-16235-1-git-send-email-mst@redhat.com> <54453398.2060102@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3] virtio-pci: fix migration for pci bus master List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Anthony Liguori , "Michael S. Tsirkin" On Mon, 20 Oct 2014 18:08:56 +0200 Alexander Graf wrote: > > > On 20.10.14 08:58, Michael S. Tsirkin wrote: > > Current support for bus master (clearing OK bit) together with the need to > > support guests which do not enable PCI bus mastering, leads to extra state in > > VIRTIO_PCI_FLAG_BUS_MASTER_BUG bit, which isn't robust in case of cross-version > > migration for the case when guests use the device before setting DRIVER_OK. > > > > Rip out this code, and replace it: > > - Modern QEMU doesn't need VIRTIO_PCI_FLAG_BUS_MASTER_BUG > > so just drop it for latest machine type. > > - For compat machine types, set PCI_COMMAND if DRIVER_OK > > is set. > > > > As this is needed for 2.1 for both pc and ppc, move PC_COMPAT macros from pc.h > > to a new common header. > > > > Reviewed-by: Greg Kurz > > Tested-by: Greg Kurz > > Signed-off-by: Michael S. Tsirkin > > --- > > > > Alexander, could you pls ack me merging this? > > Thanks! > > Have you tried whether this works with old kernel versions? We > introduced the broken flag for very specific old kernel versions that > got their flags wrong IIRC. > This is a follow-up to the following commit: commit e43c0b2ea5574efb0bedebf6a7d05916eefeba52 Author: Michael S. Tsirkin Date: Thu Sep 11 18:45:33 2014 +0200 virtio-pci: enable bus master for old guests The goal was to support *again* buggy guests that do DMA without enabling bus master, since QEMU now uses the bus master address space for delivering MSI/MSI-x messages. We were missing some bits to support cross version migration. Thanks to Michael's patch, I could migrate a buggy RHEL 6.5 guest from QEMU v2.1 to QEMU master. > > Alex > Cheers. -- Greg