Received: from eggs.gnu.org ([2001:4830:134:3::10]:45641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgYgW-0006MB-F7 for qemu-devel@nongnu.org; Tue, 21 Oct 2014 08:37:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgYgH-0005zJ-Jy for qemu-devel@nongnu.org; Tue, 21 Oct 2014 08:37:08 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:33840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgYgH-0005z9-Ax for qemu-devel@nongnu.org; Tue, 21 Oct 2014 08:36:53 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 21 Oct 2014 13:36:52 +0100 Date: Tue, 21 Oct 2014 14:36:42 +0200 From: Greg Kurz Message-ID: <20141021143642.6027afe9@bahia.local> In-Reply-To: <20141021121022.GA23466@redhat.com> References: <1413788223-16235-1-git-send-email-mst@redhat.com> <54453398.2060102@suse.de> <20141021101650.GA22793@redhat.com> <5446450B.8000600@suse.de> <20141021121022.GA23466@redhat.com> 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: "Michael S. Tsirkin" Cc: qemu-ppc@nongnu.org, Alexander Graf , Anthony Liguori , qemu-devel@nongnu.org On Tue, 21 Oct 2014 15:10:22 +0300 "Michael S. Tsirkin" wrote: > On Tue, Oct 21, 2014 at 01:35:39PM +0200, Alexander Graf wrote: > > > > > > On 21.10.14 12:16, Michael S. Tsirkin wrote: > > > On Mon, Oct 20, 2014 at 06:08:56PM +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. > > >> > > >> > > >> Alex > > > > > > Yes. The point is that since 2.1 the broken flag isn't effective > > > anymore: when bus master is off, PCI blocks outgoing transactions and > > > setting internal flags isn't going to help. > > > > > > Instead, we detect a buggy guest and immediately enable bus master for > > > it - no need for a separate flag. > > > > Ok, works for me then. > > > > > > Alex > > cool. > Gerd tells me there's a conflict with your next tree: > would you like for me to wait until it's merged, > or go ahead and send pull request and rebase yours on top? > This patch also needs to be rebased on current master actually because PC_COMPAT_2_1 in include/hw/i386/pc.h got changed. Cheers. -- Greg