Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmPso-0001oW-Hf for qemu-devel@nongnu.org; Tue, 02 Mar 2010 06:03:22 -0500 Received: from [199.232.76.173] (port=35167 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmPsn-0001nf-9s for qemu-devel@nongnu.org; Tue, 02 Mar 2010 06:03:21 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NmPsl-000247-5I for qemu-devel@nongnu.org; Tue, 02 Mar 2010 06:03:21 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59944 helo=mx2.suse.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NmPsk-000243-N1 for qemu-devel@nongnu.org; Tue, 02 Mar 2010 06:03:19 -0500 Subject: Re: [Qemu-devel] [PATCH] VirtIO: Fix QEMU crash during Windows PNP tests Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <20100302100957.GA6150@redhat.com> Date: Tue, 2 Mar 2010 12:03:15 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1252935086-8856-1-git-send-email-yvugenfi@redhat.com> <20100301112637.GH16909@redhat.com> <20100302100957.GA6150@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S.Tsirkin" Cc: Yan Vugenfirer , "qemu-devel@nongnu.org Developers" , Gleb Natapov On 02.03.2010, at 11:09, Michael S. Tsirkin wrote: > On Mon, Mar 01, 2010 at 01:26:37PM +0200, Gleb Natapov wrote: >> On Mon, Mar 01, 2010 at 12:14:43PM +0100, Alexander Graf wrote: >>>=20 >>> On 14.09.2009, at 15:31, Yan Vugenfirer wrote: >>>=20 >>>> Signed-off-by: Yan Vugenfirer >>>>=20 >>>> --- >>>> hw/virtio-pci.c | 14 ++++++++++++-- >>>> 1 files changed, 12 insertions(+), 2 deletions(-) >>>>=20 >>>> diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c >>>> index f812ab7..a0a22c4 100644 >>>> --- a/hw/virtio-pci.c >>>> +++ b/hw/virtio-pci.c >>>> @@ -364,8 +364,17 @@ static void virtio_map(PCIDevice *pci_dev, int = region_num, >>>> static void virtio_write_config(PCIDevice *pci_dev, uint32_t = address, >>>> uint32_t val, int len) >>>> { >>>> + VirtIOPCIProxy *proxy =3D DO_UPCAST(VirtIOPCIProxy, pci_dev, = pci_dev); >>>> + >>>> + if (PCI_COMMAND =3D=3D address) { >>>> + if (!(val & PCI_COMMAND_MASTER)) { >>>> + proxy->vdev->status &=3D ~VIRTIO_CONFIG_S_DRIVER_OK; >>>=20 >>> This part breaks PCI hotplug with Linux guests. >>>=20 >>> What happens is the following: >> Looks like something is broken even without this patch. >>=20 >>>=20 >>> (qemu) pci_add auto nic model=3Dvirtio,vlan=3D0 >>> - Virtio dev 1 -> write config (0) >>> - Virtio dev 1 -> write config (0x3) >>> - Virtio dev 1 -> set status explicitly to OK >> Why Linux doesn't enable bus mastering on this device? >=20 > I fixed this, and Rusty said he has applied the patch, > but it seems the patch got lost later: >=20 > http://lkml.org/lkml/2009/11/29/73 >=20 > Alexander, could you please check whether applying > this patch fixes hotplug for you? > If yes I will queue it up for 2.6.34. So we're looking at a guest bug? It's still a qemu regression then. This configuration used to work with = 0.10. There should at least be a feature bit from the guest saying "I'm = good with bus mastering", so we can enable the check only for those. Alex=