From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adCdV-0002Vv-18 for qemu-devel@nongnu.org; Tue, 08 Mar 2016 03:04:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adCdR-0003Cj-Lg for qemu-devel@nongnu.org; Tue, 08 Mar 2016 03:04:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adCdR-0003Cf-GZ for qemu-devel@nongnu.org; Tue, 08 Mar 2016 03:04:53 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 708223C88E2 for ; Tue, 8 Mar 2016 08:04:52 +0000 (UTC) Message-ID: <1457424290.22567.24.camel@redhat.com> From: Gerd Hoffmann Date: Tue, 08 Mar 2016 09:04:50 +0100 In-Reply-To: <20160307144151.5d17dfb4@t450s.home> References: <1457080913-30018-1-git-send-email-kraxel@redhat.com> <20160307144151.5d17dfb4@t450s.home> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2] vfio/igd: handle q35 machine type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: qemu-devel@nongnu.org On Mo, 2016-03-07 at 14:41 -0700, Alex Williamson wrote: > On Fri, 4 Mar 2016 09:41:53 +0100 > Gerd Hoffmann wrote: >=20 > > Basically skip the lpc quirks with -M q35. > > Applies on top of the vfio-igd patch series by alex. > >=20 > > Signed-off-by: Gerd Hoffmann > > --- > > hw/vfio/pci-quirks.c | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > >=20 > > diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c > > index 5828362..1757e3d 100644 > > --- a/hw/vfio/pci-quirks.c > > +++ b/hw/vfio/pci-quirks.c > > @@ -12,6 +12,7 @@ > > =20 > > #include "qemu/osdep.h" > > #include "hw/nvram/fw_cfg.h" > > +#include "hw/i386/ich9.h" > > #include "pci.h" > > #include "trace.h" > > #include "qemu/range.h" > > @@ -1410,6 +1411,7 @@ int vfio_pci_igd_lpc_init(VFIOPCIDevice *vdev, > > struct vfio_region_info *region) > > { > > DeviceClass *dc =3D DEVICE_GET_CLASS(vdev); > > + PCIBus *bus; > > PCIDevice *lpc_bridge; > > int ret; > > =20 > > @@ -1423,6 +1425,19 @@ int vfio_pci_igd_lpc_init(VFIOPCIDevice *vdev, > > =20 > > dc->hotpluggable =3D false; > > =20 > > + bus =3D pci_device_root_bus(&vdev->pdev); > > + lpc_bridge =3D pci_find_device(bus, 0, PCI_DEVFN(0x1f, 0)); > > + if (lpc_bridge) { > > + const char *type =3D object_get_typename(OBJECT(lpc_bridge)); > > + if (strcmp(type, TYPE_ICH9_LPC_DEVICE) =3D=3D 0) { > > + /* > > + * q35 lpc present, leave it as-is. > > + * linux kernel 4.5+ can deal with this. >=20 > What about anything older? I assume we want to support current > distributions. Based on this patch it seems like we also want to test > first if the lpc device is present, create it if not, then probably > copy host data into it. Thanks, q35 already has a isa bridge @ 1f.0, and it's not a dummy device but emulates the ich9 lpc. Just overwriting the identity of that device isn't a good idea I think. cheers, Gerd