All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names
@ 2017-09-27 19:56 Eduardo Habkost
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 1/5] pci: conventional-pci-device and pci-express-device interfaces Eduardo Habkost
                   ` (5 more replies)
  0 siblings, 6 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-27 19:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin, Marcel Apfelbaum

Changes v1 -> v2:
* Use "Conventional PCI" instead of "legacy PCI"
  * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
* Mark base-xhci as hybrid too
  * Reported-by: Marcel Apfelbaum <marcel@redhat.com>
* Mark pcie-pci-bridge as PCI Express only
* New Conventional PCI devices: sungem, sunhme

v1 was a reimplementation of one portion of an old RFC:
  Subject: [RFC v2 00/20] qmp: Report bus information on
           'query-machines'

This series marks each PCI device type as Conventional PCI, PCI
Express, or "hybrid".  It uses two new QOM interface names to do
that: INTERFACE_CONVENTIONAL_PCI_DEVICE
("conventional-pci-device") and INTERFACE_PCIE_DEVICE
("pci-express-device").  Conventional PCI devices will implement
only the former; PCIe-only devices will implement only the
latter; hybrid devices will implement both interfaces.

With this, management software will then be able to use
qom-list-types to find out which PCI devices are
conventional/express/hybrid.

In the future, the new interface names can be used in the
bus/slot querying commands, to indicate which types of devices
are accepted on each slot.

The last patch in the series adds an assertion to the PCI device
class code, to ensure we won't forget to add the corresponding
interface names to new PCI device classes.

Eduardo Habkost (5):
  pci: conventional-pci-device and pci-express-device interfaces
  pci: Add interface names to hybrid PCI devices
  pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices
  pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
  pci: Validate interfaces on base_class_init

 include/hw/pci/pci.h                |  6 ++++++
 hw/acpi/piix4.c                     |  1 +
 hw/audio/ac97.c                     |  4 ++++
 hw/audio/es1370.c                   |  4 ++++
 hw/audio/intel-hda.c                |  4 ++++
 hw/block/nvme.c                     |  4 ++++
 hw/char/serial-pci.c                | 12 ++++++++++++
 hw/display/cirrus_vga.c             |  4 ++++
 hw/display/qxl.c                    |  4 ++++
 hw/display/sm501.c                  |  4 ++++
 hw/display/vga-pci.c                |  4 ++++
 hw/display/vmware_vga.c             |  4 ++++
 hw/i2c/smbus_ich9.c                 |  4 ++++
 hw/i386/amd_iommu.c                 |  4 ++++
 hw/i386/kvm/pci-assign.c            |  4 ++++
 hw/i386/pc_piix.c                   |  4 ++++
 hw/i386/xen/xen_platform.c          |  4 ++++
 hw/i386/xen/xen_pvdevice.c          |  4 ++++
 hw/ide/ich.c                        |  4 ++++
 hw/ide/pci.c                        |  4 ++++
 hw/ipack/tpci200.c                  |  4 ++++
 hw/isa/i82378.c                     |  4 ++++
 hw/isa/lpc_ich9.c                   |  1 +
 hw/isa/piix4.c                      |  4 ++++
 hw/isa/vt82c686.c                   | 16 ++++++++++++++++
 hw/mips/gt64xxx_pci.c               |  4 ++++
 hw/misc/edu.c                       |  5 +++++
 hw/misc/ivshmem.c                   |  4 ++++
 hw/misc/macio/macio.c               |  4 ++++
 hw/misc/pci-testdev.c               |  4 ++++
 hw/net/e1000.c                      |  4 ++++
 hw/net/e1000e.c                     |  4 ++++
 hw/net/eepro100.c                   |  4 ++++
 hw/net/ne2000.c                     |  4 ++++
 hw/net/pcnet-pci.c                  |  4 ++++
 hw/net/rocker/rocker.c              |  4 ++++
 hw/net/rtl8139.c                    |  4 ++++
 hw/net/sungem.c                     |  4 ++++
 hw/net/sunhme.c                     |  4 ++++
 hw/net/vmxnet3.c                    |  5 +++++
 hw/pci-bridge/dec.c                 |  8 ++++++++
 hw/pci-bridge/i82801b11.c           |  4 ++++
 hw/pci-bridge/pci_bridge_dev.c      |  1 +
 hw/pci-bridge/pci_expander_bridge.c |  8 ++++++++
 hw/pci-bridge/pcie_pci_bridge.c     |  1 +
 hw/pci-bridge/pcie_root_port.c      |  4 ++++
 hw/pci-bridge/xio3130_downstream.c  |  4 ++++
 hw/pci-bridge/xio3130_upstream.c    |  4 ++++
 hw/pci-host/apb.c                   |  8 ++++++++
 hw/pci-host/bonito.c                |  4 ++++
 hw/pci-host/gpex.c                  |  4 ++++
 hw/pci-host/grackle.c               |  4 ++++
 hw/pci-host/piix.c                  |  8 ++++++++
 hw/pci-host/ppce500.c               |  4 ++++
 hw/pci-host/prep.c                  |  4 ++++
 hw/pci-host/q35.c                   |  4 ++++
 hw/pci-host/uninorth.c              | 16 ++++++++++++++++
 hw/pci-host/versatile.c             |  4 ++++
 hw/pci-host/xilinx-pcie.c           |  4 ++++
 hw/pci/pci.c                        | 24 ++++++++++++++++++++++++
 hw/ppc/ppc4xx_pci.c                 |  4 ++++
 hw/scsi/esp-pci.c                   |  4 ++++
 hw/scsi/lsi53c895a.c                |  4 ++++
 hw/scsi/megasas.c                   | 10 ++++++++++
 hw/scsi/mptsas.c                    |  4 ++++
 hw/scsi/vmw_pvscsi.c                |  2 ++
 hw/sd/sdhci.c                       |  4 ++++
 hw/sh4/sh_pci.c                     |  4 ++++
 hw/sparc64/sun4u.c                  |  4 ++++
 hw/usb/hcd-ehci-pci.c               |  4 ++++
 hw/usb/hcd-ohci.c                   |  4 ++++
 hw/usb/hcd-uhci.c                   |  4 ++++
 hw/usb/hcd-xhci.c                   |  5 +++++
 hw/vfio/pci-quirks.c                |  4 ++++
 hw/vfio/pci.c                       |  5 +++++
 hw/virtio/virtio-pci.c              |  5 +++++
 hw/watchdog/wdt_i6300esb.c          |  4 ++++
 hw/xen/xen_pt.c                     |  4 ++++
 78 files changed, 379 insertions(+)

-- 
2.13.5

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Qemu-devel] [PATCH v2 1/5] pci: conventional-pci-device and pci-express-device interfaces
  2017-09-27 19:56 [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names Eduardo Habkost
@ 2017-09-27 19:56 ` Eduardo Habkost
  2017-09-28  4:04   ` David Gibson
  2017-09-28  9:08   ` Marcel Apfelbaum
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 2/5] pci: Add interface names to hybrid PCI devices Eduardo Habkost
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-27 19:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin, Marcel Apfelbaum

Those two interfaces will be used to indicate which device types
support Conventional PCI or PCI Express buses.  Management
software will be able to use the qom-list-types QMP command to
query that information.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
* s/legacy/conventional/
  * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
---
 include/hw/pci/pci.h |  6 ++++++
 hw/pci/pci.c         | 12 ++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index aa7ef9cf69..8d02a0a383 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -198,6 +198,12 @@ enum {
 #define PCI_DEVICE_GET_CLASS(obj) \
      OBJECT_GET_CLASS(PCIDeviceClass, (obj), TYPE_PCI_DEVICE)
 
+/* Implemented by devices that can be plugged on PCI Express buses */
+#define INTERFACE_PCIE_DEVICE "pci-express-device"
+
+/* Implemented by devices that can be plugged on Conventional PCI buses */
+#define INTERFACE_CONVENTIONAL_PCI_DEVICE "conventional-pci-device"
+
 typedef struct PCIINTxRoute {
     enum {
         PCI_INTX_ENABLED,
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 1e6fb88eba..1b08e18205 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -170,6 +170,16 @@ static const TypeInfo pci_bus_info = {
     .class_init = pci_bus_class_init,
 };
 
+static const TypeInfo pcie_interface_info = {
+    .name          = INTERFACE_PCIE_DEVICE,
+    .parent        = TYPE_INTERFACE,
+};
+
+static const TypeInfo conventional_pci_interface_info = {
+    .name          = INTERFACE_CONVENTIONAL_PCI_DEVICE,
+    .parent        = TYPE_INTERFACE,
+};
+
 static const TypeInfo pcie_bus_info = {
     .name = TYPE_PCIE_BUS,
     .parent = TYPE_PCI_BUS,
@@ -2667,6 +2677,8 @@ static void pci_register_types(void)
 {
     type_register_static(&pci_bus_info);
     type_register_static(&pcie_bus_info);
+    type_register_static(&conventional_pci_interface_info);
+    type_register_static(&pcie_interface_info);
     type_register_static(&pci_device_type_info);
 }
 
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [Qemu-devel] [PATCH v2 2/5] pci: Add interface names to hybrid PCI devices
  2017-09-27 19:56 [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names Eduardo Habkost
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 1/5] pci: conventional-pci-device and pci-express-device interfaces Eduardo Habkost
@ 2017-09-27 19:56 ` Eduardo Habkost
  2017-09-28  4:08   ` David Gibson
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 3/5] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices Eduardo Habkost
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-27 19:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin, Marcel Apfelbaum, Dmitry Fleytman,
	Jason Wang, Paolo Bonzini, Gerd Hoffmann

The following devices support both PCI Express and Conventional
PCI, by including special code to handle the QEMU_PCI_CAP_EXPRESS
flag and/or conditional pcie_endpoint_cap_init() calls:

* vfio-pci (is_express=1, but legacy PCI handled by
  vfio_populate_device())
* vmxnet3 (is_express=0, but PCIe handled by vmxnet3_realize())
* pvscsi (is_express=0, but PCIe handled by pvscsi_realize())
* virtio-pci (is_express=0, but PCIe handled by
  virtio_pci_dc_realize(), and additional legacy PCI code at
  virtio_pci_realize())
* base-xhci (is_express=1, but pcie_endpoint_cap_init() call
  is conditional on pci_bus_is_express(dev->bus)
  * Note that xhci does not clear QEMU_PCI_CAP_EXPRESS like the
    other hybrid devices

Cc: Dmitry Fleytman <dmitry@daynix.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
* s/legacy/conventional/
  * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
* Mark base-xhci as hybrid too
---
 hw/net/vmxnet3.c       | 5 +++++
 hw/scsi/vmw_pvscsi.c   | 2 ++
 hw/usb/hcd-xhci.c      | 5 +++++
 hw/vfio/pci.c          | 5 +++++
 hw/virtio/virtio-pci.c | 5 +++++
 5 files changed, 22 insertions(+)

diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index a19a7a31dd..f99d9a69ec 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -2651,6 +2651,11 @@ static const TypeInfo vmxnet3_info = {
     .instance_size = sizeof(VMXNET3State),
     .class_init    = vmxnet3_class_init,
     .instance_init = vmxnet3_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_PCIE_DEVICE },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { }
+    },
 };
 
 static void vmxnet3_register_types(void)
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index 6d3f0bf11d..d6b315f8b2 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -1300,6 +1300,8 @@ static const TypeInfo pvscsi_info = {
     .class_init    = pvscsi_class_init,
     .interfaces = (InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
+        { INTERFACE_PCIE_DEVICE },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
 };
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index d75c085d94..af3a9d88de 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3670,6 +3670,11 @@ static const TypeInfo xhci_info = {
     .instance_size = sizeof(XHCIState),
     .class_init    = xhci_class_init,
     .abstract      = true,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_PCIE_DEVICE },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { }
+    },
 };
 
 static void qemu_xhci_class_init(ObjectClass *klass, void *data)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 31e1edf447..913433d6ba 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3023,6 +3023,11 @@ static const TypeInfo vfio_pci_dev_info = {
     .class_init = vfio_pci_dev_class_init,
     .instance_init = vfio_instance_init,
     .instance_finalize = vfio_instance_finalize,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_PCIE_DEVICE },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { }
+    },
 };
 
 static void register_vfio_pci_dev_type(void)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 8b0d6b69cd..67c8ab63ad 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1958,6 +1958,11 @@ static const TypeInfo virtio_pci_info = {
     .class_init    = virtio_pci_class_init,
     .class_size    = sizeof(VirtioPCIClass),
     .abstract      = true,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_PCIE_DEVICE },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { }
+    },
 };
 
 /* virtio-blk-pci */
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [Qemu-devel] [PATCH v2 3/5] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices
  2017-09-27 19:56 [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names Eduardo Habkost
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 1/5] pci: conventional-pci-device and pci-express-device interfaces Eduardo Habkost
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 2/5] pci: Add interface names to hybrid PCI devices Eduardo Habkost
@ 2017-09-27 19:56 ` Eduardo Habkost
  2017-09-28  4:10   ` David Gibson
  2017-09-28  9:31   ` Marcel Apfelbaum
  2017-09-27 19:56   ` Eduardo Habkost
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-27 19:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin, Marcel Apfelbaum, Keith Busch, Kevin Wolf,
	Max Reitz, Dmitry Fleytman, Jason Wang, Paul Burton,
	Paolo Bonzini, Hannes Reinecke, qemu-block

Change all devices that set is_express=1 to implement
INTERFACE_PCIE_DEVICE.

Cc: Keith Busch <keith.busch@intel.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Max Reitz <mreitz@redhat.com>
Cc: Dmitry Fleytman <dmitry@daynix.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: qemu-block@nongnu.org
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
* base-xhci is marked as hybrid, now (in another patch)
* Included pcie-pci-bridge
---
 hw/block/nvme.c                    | 4 ++++
 hw/net/e1000e.c                    | 4 ++++
 hw/pci-bridge/pcie_pci_bridge.c    | 1 +
 hw/pci-bridge/pcie_root_port.c     | 4 ++++
 hw/pci-bridge/xio3130_downstream.c | 4 ++++
 hw/pci-bridge/xio3130_upstream.c   | 4 ++++
 hw/pci-host/xilinx-pcie.c          | 4 ++++
 hw/scsi/megasas.c                  | 6 ++++++
 8 files changed, 31 insertions(+)

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 9aa32692a3..441e21ed1f 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -1110,6 +1110,10 @@ static const TypeInfo nvme_info = {
     .instance_size = sizeof(NvmeCtrl),
     .class_init    = nvme_class_init,
     .instance_init = nvme_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_PCIE_DEVICE },
+        { }
+    },
 };
 
 static void nvme_register_types(void)
diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
index 6c42b4478c..81f7934a59 100644
--- a/hw/net/e1000e.c
+++ b/hw/net/e1000e.c
@@ -708,6 +708,10 @@ static const TypeInfo e1000e_info = {
     .instance_size = sizeof(E1000EState),
     .class_init = e1000e_class_init,
     .instance_init = e1000e_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_PCIE_DEVICE },
+        { }
+    },
 };
 
 static void e1000e_register_types(void)
diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridge.c
index 9aa5cc3e45..88db143633 100644
--- a/hw/pci-bridge/pcie_pci_bridge.c
+++ b/hw/pci-bridge/pcie_pci_bridge.c
@@ -180,6 +180,7 @@ static const TypeInfo pcie_pci_bridge_info = {
         .class_init = pcie_pci_bridge_class_init,
         .interfaces = (InterfaceInfo[]) {
             { TYPE_HOTPLUG_HANDLER },
+            { INTERFACE_PCIE_DEVICE },
             { },
         }
 };
diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c
index 4d588cb22e..9b6e4ce512 100644
--- a/hw/pci-bridge/pcie_root_port.c
+++ b/hw/pci-bridge/pcie_root_port.c
@@ -161,6 +161,10 @@ static const TypeInfo rp_info = {
     .class_init    = rp_class_init,
     .abstract      = true,
     .class_size = sizeof(PCIERootPortClass),
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_PCIE_DEVICE },
+        { }
+    },
 };
 
 static void rp_register_types(void)
diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
index e706f36cb7..7d2f7629c1 100644
--- a/hw/pci-bridge/xio3130_downstream.c
+++ b/hw/pci-bridge/xio3130_downstream.c
@@ -195,6 +195,10 @@ static const TypeInfo xio3130_downstream_info = {
     .name          = "xio3130-downstream",
     .parent        = TYPE_PCIE_SLOT,
     .class_init    = xio3130_downstream_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_PCIE_DEVICE },
+        { }
+    },
 };
 
 static void xio3130_downstream_register_types(void)
diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
index a052224bbf..227997ce46 100644
--- a/hw/pci-bridge/xio3130_upstream.c
+++ b/hw/pci-bridge/xio3130_upstream.c
@@ -166,6 +166,10 @@ static const TypeInfo xio3130_upstream_info = {
     .name          = "x3130-upstream",
     .parent        = TYPE_PCIE_PORT,
     .class_init    = xio3130_upstream_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_PCIE_DEVICE },
+        { }
+    },
 };
 
 static void xio3130_upstream_register_types(void)
diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c
index 4613dda1d2..7659253090 100644
--- a/hw/pci-host/xilinx-pcie.c
+++ b/hw/pci-host/xilinx-pcie.c
@@ -317,6 +317,10 @@ static const TypeInfo xilinx_pcie_root_info = {
     .parent = TYPE_PCI_BRIDGE,
     .instance_size = sizeof(XilinxPCIERoot),
     .class_init = xilinx_pcie_root_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_PCIE_DEVICE },
+        { }
+    },
 };
 
 static void xilinx_pcie_register(void)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 0db68aacee..535ee267c3 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -2451,6 +2451,7 @@ typedef struct MegasasInfo {
     int osts;
     const VMStateDescription *vmsd;
     Property *props;
+    InterfaceInfo *interfaces;
 } MegasasInfo;
 
 static struct MegasasInfo megasas_devices[] = {
@@ -2480,6 +2481,10 @@ static struct MegasasInfo megasas_devices[] = {
         .is_express = true,
         .vmsd = &vmstate_megasas_gen2,
         .props = megasas_properties_gen2,
+        .interfaces = (InterfaceInfo[]) {
+            { INTERFACE_PCIE_DEVICE },
+            { }
+        },
     }
 };
 
@@ -2531,6 +2536,7 @@ static void megasas_register_types(void)
         type_info.parent = TYPE_MEGASAS_BASE;
         type_info.class_data = (void *)info;
         type_info.class_init = megasas_class_init;
+        type_info.interfaces = info->interfaces;
 
         type_register(&type_info);
     }
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
  2017-09-27 19:56 [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names Eduardo Habkost
@ 2017-09-27 19:56   ` Eduardo Habkost
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 2/5] pci: Add interface names to hybrid PCI devices Eduardo Habkost
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-27 19:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin, Marcel Apfelbaum, Igor Mammedov,
	Gerd Hoffmann, Paolo Bonzini, Richard Henderson,
	Stefano Stabellini, Anthony Perard, John Snow, Alberto Garcia,
	Aurelien Jarno, Yongbok Kim, Jiri Slaby, Alexander Graf,
	Jason Wang, Jiri Pirko, Hervé Poussineau, Peter Maydell,
	David Gibson, Hannes Reinecke, Mark Cave-Ayland,
	Artyom Tarasenko, xen-devel, qemu-block, qemu-ppc, qemu-arm

Add INTERFACE_CONVENTIONAL_PCI_DEVICE to all direct subtypes of
TYPE_PCI_DEVICE, except:

1) The ones that already have INTERFACE_PCIE_DEVICE set:

* base-xhci
* e1000e
* nvme
* pvscsi
* vfio-pci
* virtio-pci
* vmxnet3

2) base-pci-bridge

Not all PCI bridges are Conventional PCI devices, so
INTERFACE_CONVENTIONAL_PCI_DEVICE is added only to the subtypes
that are actually Conventional PCI:

* dec-21154-p2p-bridge
* i82801b11-bridge
* pbm-bridge
* pci-bridge

The direct subtypes of base-pci-bridge not touched by this patch
are:

* xilinx-pcie-root: Already marked as PCIe-only.
* pcie-pci-bridge: Already marked as PCIe-only.
* pcie-port: all non-abstract subtypes of pcie-port are already
  marked as PCIe-only devices.

3) megasas-base

Not all megasas devices are Conventional PCI devices, so the
interface names are added to the subclasses registered by
megasas_register_types(), according to information in the
megasas_devices[] array.

"megasas-gen2" already implements INTERFACE_PCIE_DEVICE, so add
INTERFACE_CONVENTIONAL_PCI_DEVICE only to "megasas".

Acked-by: Alberto Garcia <berto@igalia.com>
Acked-by: John Snow <jsnow@redhat.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
* s/legacy/conventional/
  * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
* Note about pcie-pci-bridge on commit message.
* New devices: sungem, sunhme

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: John Snow <jsnow@redhat.com>
Cc: Alberto Garcia <berto@igalia.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Yongbok Kim <yongbok.kim@imgtec.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Alexander Graf <agraf@suse.de>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: "Hervé Poussineau" <hpoussin@reactos.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Artyom Tarasenko <atar4qemu@gmail.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: qemu-devel@nongnu.org
Cc: xen-devel@lists.xenproject.org
Cc: qemu-block@nongnu.org
Cc: qemu-ppc@nongnu.org
Cc: qemu-arm@nongnu.org
---
 hw/acpi/piix4.c                     |  1 +
 hw/audio/ac97.c                     |  4 ++++
 hw/audio/es1370.c                   |  4 ++++
 hw/audio/intel-hda.c                |  4 ++++
 hw/char/serial-pci.c                | 12 ++++++++++++
 hw/display/cirrus_vga.c             |  4 ++++
 hw/display/qxl.c                    |  4 ++++
 hw/display/sm501.c                  |  4 ++++
 hw/display/vga-pci.c                |  4 ++++
 hw/display/vmware_vga.c             |  4 ++++
 hw/i2c/smbus_ich9.c                 |  4 ++++
 hw/i386/amd_iommu.c                 |  4 ++++
 hw/i386/kvm/pci-assign.c            |  4 ++++
 hw/i386/pc_piix.c                   |  4 ++++
 hw/i386/xen/xen_platform.c          |  4 ++++
 hw/i386/xen/xen_pvdevice.c          |  4 ++++
 hw/ide/ich.c                        |  4 ++++
 hw/ide/pci.c                        |  4 ++++
 hw/ipack/tpci200.c                  |  4 ++++
 hw/isa/i82378.c                     |  4 ++++
 hw/isa/lpc_ich9.c                   |  1 +
 hw/isa/piix4.c                      |  4 ++++
 hw/isa/vt82c686.c                   | 16 ++++++++++++++++
 hw/mips/gt64xxx_pci.c               |  4 ++++
 hw/misc/edu.c                       |  5 +++++
 hw/misc/ivshmem.c                   |  4 ++++
 hw/misc/macio/macio.c               |  4 ++++
 hw/misc/pci-testdev.c               |  4 ++++
 hw/net/e1000.c                      |  4 ++++
 hw/net/eepro100.c                   |  4 ++++
 hw/net/ne2000.c                     |  4 ++++
 hw/net/pcnet-pci.c                  |  4 ++++
 hw/net/rocker/rocker.c              |  4 ++++
 hw/net/rtl8139.c                    |  4 ++++
 hw/net/sungem.c                     |  4 ++++
 hw/net/sunhme.c                     |  4 ++++
 hw/pci-bridge/dec.c                 |  8 ++++++++
 hw/pci-bridge/i82801b11.c           |  4 ++++
 hw/pci-bridge/pci_bridge_dev.c      |  1 +
 hw/pci-bridge/pci_expander_bridge.c |  8 ++++++++
 hw/pci-host/apb.c                   |  8 ++++++++
 hw/pci-host/bonito.c                |  4 ++++
 hw/pci-host/gpex.c                  |  4 ++++
 hw/pci-host/grackle.c               |  4 ++++
 hw/pci-host/piix.c                  |  8 ++++++++
 hw/pci-host/ppce500.c               |  4 ++++
 hw/pci-host/prep.c                  |  4 ++++
 hw/pci-host/q35.c                   |  4 ++++
 hw/pci-host/uninorth.c              | 16 ++++++++++++++++
 hw/pci-host/versatile.c             |  4 ++++
 hw/ppc/ppc4xx_pci.c                 |  4 ++++
 hw/scsi/esp-pci.c                   |  4 ++++
 hw/scsi/lsi53c895a.c                |  4 ++++
 hw/scsi/megasas.c                   |  4 ++++
 hw/scsi/mptsas.c                    |  4 ++++
 hw/sd/sdhci.c                       |  4 ++++
 hw/sh4/sh_pci.c                     |  4 ++++
 hw/sparc64/sun4u.c                  |  4 ++++
 hw/usb/hcd-ehci-pci.c               |  4 ++++
 hw/usb/hcd-ohci.c                   |  4 ++++
 hw/usb/hcd-uhci.c                   |  4 ++++
 hw/vfio/pci-quirks.c                |  4 ++++
 hw/watchdog/wdt_i6300esb.c          |  4 ++++
 hw/xen/xen_pt.c                     |  4 ++++
 64 files changed, 296 insertions(+)

diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index f4fd5907b8..a0fb1ce037 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -718,6 +718,7 @@ static const TypeInfo piix4_pm_info = {
     .interfaces = (InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { TYPE_ACPI_DEVICE_IF },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
 };
diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
index 959c786261..337402e9c6 100644
--- a/hw/audio/ac97.c
+++ b/hw/audio/ac97.c
@@ -1431,6 +1431,10 @@ static const TypeInfo ac97_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof (AC97LinkState),
     .class_init    = ac97_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ac97_register_types (void)
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index dd7c23d185..59cf252754 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -1082,6 +1082,10 @@ static const TypeInfo es1370_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof (ES1370State),
     .class_init    = es1370_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void es1370_register_types (void)
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index 18a50a8f83..a3e670c188 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -1263,6 +1263,10 @@ static const TypeInfo intel_hda_info = {
     .instance_size = sizeof(IntelHDAState),
     .class_init    = intel_hda_class_init,
     .abstract      = true,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const TypeInfo intel_hda_info_ich6 = {
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index 303104dd19..cb0d04c1d9 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -250,6 +250,10 @@ static const TypeInfo serial_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCISerialState),
     .class_init    = serial_pci_class_initfn,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const TypeInfo multi_2x_serial_pci_info = {
@@ -257,6 +261,10 @@ static const TypeInfo multi_2x_serial_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIMultiSerialState),
     .class_init    = multi_2x_serial_pci_class_initfn,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const TypeInfo multi_4x_serial_pci_info = {
@@ -264,6 +272,10 @@ static const TypeInfo multi_4x_serial_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIMultiSerialState),
     .class_init    = multi_4x_serial_pci_class_initfn,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void serial_pci_register_types(void)
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index afc290ab91..b4d579857a 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -3162,6 +3162,10 @@ static const TypeInfo cirrus_vga_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCICirrusVGAState),
     .class_init    = cirrus_vga_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void cirrus_vga_register_types(void)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index ae3677fd1e..b20e259122 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -2430,6 +2430,10 @@ static const TypeInfo qxl_pci_type_info = {
     .instance_size = sizeof(PCIQXLDevice),
     .abstract = true,
     .class_init = qxl_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void qxl_primary_class_init(ObjectClass *klass, void *data)
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 9aa515b3da..6eddac911e 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -1843,6 +1843,10 @@ static const TypeInfo sm501_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(SM501PCIState),
     .class_init    = sm501_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void sm501_register_types(void)
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index ac9a76499e..7adb89fcb4 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -338,6 +338,10 @@ static const TypeInfo vga_pci_type_info = {
     .instance_size = sizeof(PCIVGAState),
     .abstract = true,
     .class_init = vga_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void vga_class_init(ObjectClass *klass, void *data)
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 4a64b41259..cdc3fed6ca 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -1350,6 +1350,10 @@ static const TypeInfo vmsvga_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(struct pci_vmsvga_state_s),
     .class_init    = vmsvga_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void vmsvga_register_types(void)
diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
index ea51e09186..e47556c9d8 100644
--- a/hw/i2c/smbus_ich9.c
+++ b/hw/i2c/smbus_ich9.c
@@ -119,6 +119,10 @@ static const TypeInfo ich9_smb_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(ICH9SMBState),
     .class_init = ich9_smb_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ich9_smb_register(void)
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 334938a280..ad8155ca4c 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1227,6 +1227,10 @@ static const TypeInfo amdviPCI = {
     .name = "AMDVI-PCI",
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(AMDVIPCIState),
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void amdvi_iommu_memory_region_class_init(ObjectClass *klass, void *data)
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index 33e20cb3e8..d8559d8342 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -1864,6 +1864,10 @@ static const TypeInfo assign_info = {
     .instance_size      = sizeof(AssignedDevice),
     .class_init         = assign_class_init,
     .instance_init      = assigned_dev_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void assign_register_types(void)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 9ff79b1fd9..1a56465490 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -1055,6 +1055,10 @@ static TypeInfo isa_bridge_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = isa_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pt_graphics_register_types(void)
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index 9ba7474566..056b87de0b 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -517,6 +517,10 @@ static const TypeInfo xen_platform_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIXenPlatformState),
     .class_init    = xen_platform_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void xen_platform_register_types(void)
diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c
index c093b34458..f748823658 100644
--- a/hw/i386/xen/xen_pvdevice.c
+++ b/hw/i386/xen/xen_pvdevice.c
@@ -127,6 +127,10 @@ static const TypeInfo xen_pv_type_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(XenPVDevice),
     .class_init    = xen_pv_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void xen_pv_register_types(void)
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index 9472a60cab..8dd0ced6b3 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -184,6 +184,10 @@ static const TypeInfo ich_ahci_info = {
     .instance_size = sizeof(AHCIPCIState),
     .instance_init = pci_ich9_ahci_init,
     .class_init    = ich_ahci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ich_ahci_register_types(void)
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index f2dcc0ed77..053c0375c1 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -451,6 +451,10 @@ static const TypeInfo pci_ide_type_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIIDEState),
     .abstract = true,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_ide_register_types(void)
diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c
index 4dfa6b33f3..da05c8589d 100644
--- a/hw/ipack/tpci200.c
+++ b/hw/ipack/tpci200.c
@@ -646,6 +646,10 @@ static const TypeInfo tpci200_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(TPCI200State),
     .class_init    = tpci200_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void tpci200_register_types(void)
diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index 4d29a9900c..d20ea4c2ee 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -138,6 +138,10 @@ static const TypeInfo i82378_type_info = {
     .instance_size = sizeof(I82378State),
     .instance_init = i82378_init,
     .class_init = i82378_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void i82378_register_types(void)
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index ac8416d42b..39f56ba44e 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -823,6 +823,7 @@ static const TypeInfo ich9_lpc_info = {
     .interfaces = (InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { TYPE_ACPI_DEVICE_IF },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
 };
diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
index f811eba59d..6b8bc3faf0 100644
--- a/hw/isa/piix4.c
+++ b/hw/isa/piix4.c
@@ -132,6 +132,10 @@ static const TypeInfo piix4_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PIIX4State),
     .class_init    = piix4_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void piix4_register_types(void)
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 50dc83df77..c129985e2a 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -301,6 +301,10 @@ static const TypeInfo via_ac97_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(VT686AC97State),
     .class_init    = via_ac97_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void vt82c686b_mc97_realize(PCIDevice *dev, Error **errp)
@@ -341,6 +345,10 @@ static const TypeInfo via_mc97_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(VT686MC97State),
     .class_init    = via_mc97_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 /* vt82c686 pm init */
@@ -419,6 +427,10 @@ static const TypeInfo via_pm_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(VT686PMState),
     .class_init    = via_pm_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const VMStateDescription vmstate_via = {
@@ -502,6 +514,10 @@ static const TypeInfo via_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(VT82C686BState),
     .class_init    = via_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void vt82c686b_register_types(void)
diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c
index e8b2eef688..5a9dad9aae 100644
--- a/hw/mips/gt64xxx_pci.c
+++ b/hw/mips/gt64xxx_pci.c
@@ -1232,6 +1232,10 @@ static const TypeInfo gt64120_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = gt64120_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void gt64120_class_init(ObjectClass *klass, void *data)
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index 01acacf142..34eb05d213 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -408,12 +408,17 @@ static void edu_class_init(ObjectClass *class, void *data)
 
 static void pci_edu_register_types(void)
 {
+    static InterfaceInfo interfaces[] = {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    };
     static const TypeInfo edu_info = {
         .name          = "edu",
         .parent        = TYPE_PCI_DEVICE,
         .instance_size = sizeof(EduState),
         .instance_init = edu_instance_init,
         .class_init    = edu_class_init,
+        .interfaces = interfaces,
     };
 
     type_register_static(&edu_info);
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index b3ef3ec1e3..a5a46827fe 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -1010,6 +1010,10 @@ static const TypeInfo ivshmem_common_info = {
     .instance_size = sizeof(IVShmemState),
     .abstract      = true,
     .class_init    = ivshmem_common_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const VMStateDescription ivshmem_plain_vmsd = {
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 5d57f45dc6..298e65071c 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -415,6 +415,10 @@ static const TypeInfo macio_type_info = {
     .instance_init = macio_instance_init,
     .abstract      = true,
     .class_init    = macio_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void macio_register_types(void)
diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
index 7d5990213e..32041f535f 100644
--- a/hw/misc/pci-testdev.c
+++ b/hw/misc/pci-testdev.c
@@ -326,6 +326,10 @@ static const TypeInfo pci_testdev_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCITestDevState),
     .class_init    = pci_testdev_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_testdev_register_types(void)
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index eebe3a9c13..acdb935af5 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -1685,6 +1685,10 @@ static const TypeInfo e1000_base_info = {
     .instance_init = e1000_instance_init,
     .class_size    = sizeof(E1000BaseClass),
     .abstract      = true,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const E1000Info e1000_devices[] = {
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index a7b9f77519..80b8f47c4b 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -2116,6 +2116,10 @@ static void eepro100_register_types(void)
         type_info.class_init = eepro100_class_init;
         type_info.instance_size = sizeof(EEPRO100State);
         type_info.instance_init = eepro100_instance_init;
+        type_info.interfaces = (InterfaceInfo[]) {
+            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+            { },
+        };
 
         type_register(&type_info);
     }
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 798d681e25..3938e6ddd8 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -786,6 +786,10 @@ static const TypeInfo ne2000_info = {
     .instance_size = sizeof(PCINE2000State),
     .class_init    = ne2000_class_init,
     .instance_init = ne2000_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ne2000_register_types(void)
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
index 0acf8a4879..0ae5ca4701 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -365,6 +365,10 @@ static const TypeInfo pcnet_info = {
     .instance_size = sizeof(PCIPCNetState),
     .class_init    = pcnet_class_init,
     .instance_init = pcnet_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_pcnet_register_types(void)
diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
index 9273473d59..823a29df03 100644
--- a/hw/net/rocker/rocker.c
+++ b/hw/net/rocker/rocker.c
@@ -1525,6 +1525,10 @@ static const TypeInfo rocker_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(Rocker),
     .class_init    = rocker_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void rocker_register_types(void)
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 3be24bbee7..bef0464b2e 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -3442,6 +3442,10 @@ static const TypeInfo rtl8139_info = {
     .instance_size = sizeof(RTL8139State),
     .class_init    = rtl8139_class_init,
     .instance_init = rtl8139_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void rtl8139_register_types(void)
diff --git a/hw/net/sungem.c b/hw/net/sungem.c
index dffa0c90f3..6aa8d1117b 100644
--- a/hw/net/sungem.c
+++ b/hw/net/sungem.c
@@ -1437,6 +1437,10 @@ static const TypeInfo sungem_info = {
     .instance_size = sizeof(SunGEMState),
     .class_init    = sungem_class_init,
     .instance_init = sungem_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { }
+    }
 };
 
 static void sungem_register_types(void)
diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c
index 60277adcf1..b1efa1b88d 100644
--- a/hw/net/sunhme.c
+++ b/hw/net/sunhme.c
@@ -968,6 +968,10 @@ static const TypeInfo sunhme_info = {
     .class_init    = sunhme_class_init,
     .instance_size = sizeof(SunHMEState),
     .instance_init = sunhme_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { }
+    }
 };
 
 static void sunhme_register_types(void)
diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
index eb275e1a25..84492d5e5f 100644
--- a/hw/pci-bridge/dec.c
+++ b/hw/pci-bridge/dec.c
@@ -79,6 +79,10 @@ static const TypeInfo dec_21154_pci_bridge_info = {
     .parent        = TYPE_PCI_BRIDGE,
     .instance_size = sizeof(PCIBridge),
     .class_init    = dec_21154_pci_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
@@ -138,6 +142,10 @@ static const TypeInfo dec_21154_pci_host_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = dec_21154_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
index 2c1b747b4b..cb522bf30c 100644
--- a/hw/pci-bridge/i82801b11.c
+++ b/hw/pci-bridge/i82801b11.c
@@ -106,6 +106,10 @@ static const TypeInfo i82801b11_bridge_info = {
     .parent        = TYPE_PCI_BRIDGE,
     .instance_size = sizeof(I82801b11Bridge),
     .class_init    = i82801b11_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void d2pbr_register(void)
diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
index 4373f1d3e2..d56f6638c2 100644
--- a/hw/pci-bridge/pci_bridge_dev.c
+++ b/hw/pci-bridge/pci_bridge_dev.c
@@ -238,6 +238,7 @@ static const TypeInfo pci_bridge_dev_info = {
     .instance_finalize = pci_bridge_dev_instance_finalize,
     .interfaces = (InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
 };
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index ff59abf208..8c8ac737ad 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -316,6 +316,10 @@ static const TypeInfo pxb_dev_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PXBDev),
     .class_init    = pxb_dev_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pxb_pcie_dev_realize(PCIDevice *dev, Error **errp)
@@ -350,6 +354,10 @@ static const TypeInfo pxb_pcie_dev_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PXBDev),
     .class_init    = pxb_pcie_dev_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pxb_register_types(void)
diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
index b709456b97..1edf57f600 100644
--- a/hw/pci-host/apb.c
+++ b/hw/pci-host/apb.c
@@ -836,6 +836,10 @@ static const TypeInfo pbm_pci_host_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = pbm_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pbm_host_class_init(ObjectClass *klass, void *data)
@@ -883,6 +887,10 @@ static const TypeInfo pbm_pci_bridge_info = {
     .parent        = TYPE_PCI_BRIDGE,
     .class_init    = pbm_pci_bridge_class_init,
     .instance_size = sizeof(PBMPCIBridge),
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pbm_iommu_memory_region_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 89133a9dd3..9f61e27edc 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -833,6 +833,10 @@ static const TypeInfo bonito_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIBonitoState),
     .class_init    = bonito_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void bonito_pcihost_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
index be25245219..4090793cf0 100644
--- a/hw/pci-host/gpex.c
+++ b/hw/pci-host/gpex.c
@@ -166,6 +166,10 @@ static const TypeInfo gpex_root_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(GPEXRootState),
     .class_init = gpex_root_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void gpex_register(void)
diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c
index 2e281f6155..38cd279b6b 100644
--- a/hw/pci-host/grackle.c
+++ b/hw/pci-host/grackle.c
@@ -142,6 +142,10 @@ static const TypeInfo grackle_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = grackle_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_grackle_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index 894e131c00..2b8d90a853 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -694,6 +694,10 @@ static const TypeInfo piix3_pci_type_info = {
     .instance_size = sizeof(PIIX3State),
     .abstract = true,
     .class_init = pci_piix3_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void piix3_class_init(ObjectClass *klass, void *data)
@@ -748,6 +752,10 @@ static const TypeInfo i440fx_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCII440FXState),
     .class_init    = i440fx_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 /* IGD Passthrough Host Bridge. */
diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
index becc0eeb76..39cd24464d 100644
--- a/hw/pci-host/ppce500.c
+++ b/hw/pci-host/ppce500.c
@@ -516,6 +516,10 @@ static const TypeInfo e500_host_bridge_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PPCE500PCIBridgeState),
     .class_init    = e500_host_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static Property pcihost_properties[] = {
diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
index 8b293ba0f1..92eed0f3e1 100644
--- a/hw/pci-host/prep.c
+++ b/hw/pci-host/prep.c
@@ -372,6 +372,10 @@ static const TypeInfo raven_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(RavenPCIState),
     .class_init = raven_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static Property raven_pcihost_properties[] = {
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 1ff648e80c..ddaa7d1b44 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -591,6 +591,10 @@ static const TypeInfo mch_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(MCHPCIState),
     .class_init = mch_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void q35_register(void)
diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index 6cf5e59f86..ea5c265718 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -374,6 +374,10 @@ static const TypeInfo unin_main_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = unin_main_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void u3_agp_pci_host_class_init(ObjectClass *klass, void *data)
@@ -398,6 +402,10 @@ static const TypeInfo u3_agp_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = u3_agp_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void unin_agp_pci_host_class_init(ObjectClass *klass, void *data)
@@ -422,6 +430,10 @@ static const TypeInfo unin_agp_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = unin_agp_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void unin_internal_pci_host_class_init(ObjectClass *klass, void *data)
@@ -446,6 +458,10 @@ static const TypeInfo unin_internal_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = unin_internal_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_unin_main_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
index aa1fdf75fd..6394a520fc 100644
--- a/hw/pci-host/versatile.c
+++ b/hw/pci-host/versatile.c
@@ -487,6 +487,10 @@ static const TypeInfo versatile_pci_host_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = versatile_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static Property pci_vpb_properties[] = {
diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
index 6953f8b9ac..4765dcecca 100644
--- a/hw/ppc/ppc4xx_pci.c
+++ b/hw/ppc/ppc4xx_pci.c
@@ -359,6 +359,10 @@ static const TypeInfo ppc4xx_host_bridge_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = ppc4xx_host_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ppc4xx_pcihost_class_init(ObjectClass *klass, void *data)
diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index e295d88939..419fc668ac 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -398,6 +398,10 @@ static const TypeInfo esp_pci_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIESPState),
     .class_init = esp_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 typedef struct {
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 3e56ab267c..423a2848ea 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -2244,6 +2244,10 @@ static const TypeInfo lsi_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(LSIState),
     .class_init    = lsi_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void lsi53c810_class_init(ObjectClass *klass, void *data)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 535ee267c3..d5eae6239a 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -2468,6 +2468,10 @@ static struct MegasasInfo megasas_devices[] = {
         .is_express = false,
         .vmsd = &vmstate_megasas_gen1,
         .props = megasas_properties_gen1,
+        .interfaces = (InterfaceInfo[]) {
+            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+            { },
+        },
     },{
         .name = TYPE_MEGASAS_GEN2,
         .desc = "LSI MegaRAID SAS 2108",
diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
index d05fa9f549..f6db1b0103 100644
--- a/hw/scsi/mptsas.c
+++ b/hw/scsi/mptsas.c
@@ -1439,6 +1439,10 @@ static const TypeInfo mptsas_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(MPTSASState),
     .class_init = mptsas1068_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void mptsas_register_types(void)
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 6d6a791ee9..b064a087c9 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1315,6 +1315,10 @@ static const TypeInfo sdhci_pci_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(SDHCIState),
     .class_init = sdhci_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static Property sdhci_sysbus_properties[] = {
diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c
index 38395c082b..cbb01af57f 100644
--- a/hw/sh4/sh_pci.c
+++ b/hw/sh4/sh_pci.c
@@ -179,6 +179,10 @@ static const TypeInfo sh_pci_host_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = sh_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void sh_pci_device_class_init(ObjectClass *klass, void *data)
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index c3280aaf38..8282651aeb 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -275,6 +275,10 @@ static const TypeInfo ebus_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(EbusState),
     .class_init    = ebus_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 #define TYPE_OPENPROM "openprom"
diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index 6dedcb8989..8c0fc53a26 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -170,6 +170,10 @@ static const TypeInfo ehci_pci_type_info = {
     .instance_finalize = usb_ehci_pci_finalize,
     .abstract = true,
     .class_init = ehci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ehci_data_class_init(ObjectClass *klass, void *data)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 267982e160..a31df67daa 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -2139,6 +2139,10 @@ static const TypeInfo ohci_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(OHCIPCIState),
     .class_init    = ohci_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static Property ohci_sysbus_properties[] = {
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index e3562a4c60..836b11f177 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1323,6 +1323,10 @@ static const TypeInfo uhci_pci_type_info = {
     .class_size    = sizeof(UHCIPCIDeviceClass),
     .abstract = true,
     .class_init = uhci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void uhci_data_class_init(ObjectClass *klass, void *data)
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
index 349085ea12..2bd9d126d1 100644
--- a/hw/vfio/pci-quirks.c
+++ b/hw/vfio/pci-quirks.c
@@ -1197,6 +1197,10 @@ static TypeInfo vfio_pci_igd_lpc_bridge_info = {
     .name = "vfio-pci-igd-lpc-bridge",
     .parent = TYPE_PCI_DEVICE,
     .class_init = vfio_pci_igd_lpc_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void vfio_pci_igd_register_types(void)
diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
index 49b3cd188a..e596b0804d 100644
--- a/hw/watchdog/wdt_i6300esb.c
+++ b/hw/watchdog/wdt_i6300esb.c
@@ -463,6 +463,10 @@ static const TypeInfo i6300esb_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(I6300State),
     .class_init    = i6300esb_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void i6300esb_register_types(void)
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 375efa68f6..01df3414d3 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
     .instance_size = sizeof(XenPCIPassthroughState),
     .instance_finalize = xen_pci_passthrough_finalize,
     .class_init = xen_pci_passthrough_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void xen_pci_passthrough_register_types(void)
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
@ 2017-09-27 19:56   ` Eduardo Habkost
  0 siblings, 0 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-27 19:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	Gerd Hoffmann, David Gibson, Jiri Slaby, Hannes Reinecke,
	Stefano Stabellini, Alberto Garcia, qemu-block, Alexander Graf,
	Hervé Poussineau, Anthony Perard, xen-devel, David Gibson,
	Artyom Tarasenko, Jiri Pirko, Marcel Apfelbaum, Alex Williamson,
	qemu-arm, Laine Stump, Igor Mammedov

Add INTERFACE_CONVENTIONAL_PCI_DEVICE to all direct subtypes of
TYPE_PCI_DEVICE, except:

1) The ones that already have INTERFACE_PCIE_DEVICE set:

* base-xhci
* e1000e
* nvme
* pvscsi
* vfio-pci
* virtio-pci
* vmxnet3

2) base-pci-bridge

Not all PCI bridges are Conventional PCI devices, so
INTERFACE_CONVENTIONAL_PCI_DEVICE is added only to the subtypes
that are actually Conventional PCI:

* dec-21154-p2p-bridge
* i82801b11-bridge
* pbm-bridge
* pci-bridge

The direct subtypes of base-pci-bridge not touched by this patch
are:

* xilinx-pcie-root: Already marked as PCIe-only.
* pcie-pci-bridge: Already marked as PCIe-only.
* pcie-port: all non-abstract subtypes of pcie-port are already
  marked as PCIe-only devices.

3) megasas-base

Not all megasas devices are Conventional PCI devices, so the
interface names are added to the subclasses registered by
megasas_register_types(), according to information in the
megasas_devices[] array.

"megasas-gen2" already implements INTERFACE_PCIE_DEVICE, so add
INTERFACE_CONVENTIONAL_PCI_DEVICE only to "megasas".

Acked-by: Alberto Garcia <berto@igalia.com>
Acked-by: John Snow <jsnow@redhat.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
* s/legacy/conventional/
  * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
* Note about pcie-pci-bridge on commit message.
* New devices: sungem, sunhme

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: John Snow <jsnow@redhat.com>
Cc: Alberto Garcia <berto@igalia.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Yongbok Kim <yongbok.kim@imgtec.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Alexander Graf <agraf@suse.de>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: "Hervé Poussineau" <hpoussin@reactos.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Artyom Tarasenko <atar4qemu@gmail.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: qemu-devel@nongnu.org
Cc: xen-devel@lists.xenproject.org
Cc: qemu-block@nongnu.org
Cc: qemu-ppc@nongnu.org
Cc: qemu-arm@nongnu.org
---
 hw/acpi/piix4.c                     |  1 +
 hw/audio/ac97.c                     |  4 ++++
 hw/audio/es1370.c                   |  4 ++++
 hw/audio/intel-hda.c                |  4 ++++
 hw/char/serial-pci.c                | 12 ++++++++++++
 hw/display/cirrus_vga.c             |  4 ++++
 hw/display/qxl.c                    |  4 ++++
 hw/display/sm501.c                  |  4 ++++
 hw/display/vga-pci.c                |  4 ++++
 hw/display/vmware_vga.c             |  4 ++++
 hw/i2c/smbus_ich9.c                 |  4 ++++
 hw/i386/amd_iommu.c                 |  4 ++++
 hw/i386/kvm/pci-assign.c            |  4 ++++
 hw/i386/pc_piix.c                   |  4 ++++
 hw/i386/xen/xen_platform.c          |  4 ++++
 hw/i386/xen/xen_pvdevice.c          |  4 ++++
 hw/ide/ich.c                        |  4 ++++
 hw/ide/pci.c                        |  4 ++++
 hw/ipack/tpci200.c                  |  4 ++++
 hw/isa/i82378.c                     |  4 ++++
 hw/isa/lpc_ich9.c                   |  1 +
 hw/isa/piix4.c                      |  4 ++++
 hw/isa/vt82c686.c                   | 16 ++++++++++++++++
 hw/mips/gt64xxx_pci.c               |  4 ++++
 hw/misc/edu.c                       |  5 +++++
 hw/misc/ivshmem.c                   |  4 ++++
 hw/misc/macio/macio.c               |  4 ++++
 hw/misc/pci-testdev.c               |  4 ++++
 hw/net/e1000.c                      |  4 ++++
 hw/net/eepro100.c                   |  4 ++++
 hw/net/ne2000.c                     |  4 ++++
 hw/net/pcnet-pci.c                  |  4 ++++
 hw/net/rocker/rocker.c              |  4 ++++
 hw/net/rtl8139.c                    |  4 ++++
 hw/net/sungem.c                     |  4 ++++
 hw/net/sunhme.c                     |  4 ++++
 hw/pci-bridge/dec.c                 |  8 ++++++++
 hw/pci-bridge/i82801b11.c           |  4 ++++
 hw/pci-bridge/pci_bridge_dev.c      |  1 +
 hw/pci-bridge/pci_expander_bridge.c |  8 ++++++++
 hw/pci-host/apb.c                   |  8 ++++++++
 hw/pci-host/bonito.c                |  4 ++++
 hw/pci-host/gpex.c                  |  4 ++++
 hw/pci-host/grackle.c               |  4 ++++
 hw/pci-host/piix.c                  |  8 ++++++++
 hw/pci-host/ppce500.c               |  4 ++++
 hw/pci-host/prep.c                  |  4 ++++
 hw/pci-host/q35.c                   |  4 ++++
 hw/pci-host/uninorth.c              | 16 ++++++++++++++++
 hw/pci-host/versatile.c             |  4 ++++
 hw/ppc/ppc4xx_pci.c                 |  4 ++++
 hw/scsi/esp-pci.c                   |  4 ++++
 hw/scsi/lsi53c895a.c                |  4 ++++
 hw/scsi/megasas.c                   |  4 ++++
 hw/scsi/mptsas.c                    |  4 ++++
 hw/sd/sdhci.c                       |  4 ++++
 hw/sh4/sh_pci.c                     |  4 ++++
 hw/sparc64/sun4u.c                  |  4 ++++
 hw/usb/hcd-ehci-pci.c               |  4 ++++
 hw/usb/hcd-ohci.c                   |  4 ++++
 hw/usb/hcd-uhci.c                   |  4 ++++
 hw/vfio/pci-quirks.c                |  4 ++++
 hw/watchdog/wdt_i6300esb.c          |  4 ++++
 hw/xen/xen_pt.c                     |  4 ++++
 64 files changed, 296 insertions(+)

diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index f4fd5907b8..a0fb1ce037 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -718,6 +718,7 @@ static const TypeInfo piix4_pm_info = {
     .interfaces = (InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { TYPE_ACPI_DEVICE_IF },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
 };
diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
index 959c786261..337402e9c6 100644
--- a/hw/audio/ac97.c
+++ b/hw/audio/ac97.c
@@ -1431,6 +1431,10 @@ static const TypeInfo ac97_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof (AC97LinkState),
     .class_init    = ac97_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ac97_register_types (void)
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index dd7c23d185..59cf252754 100644
--- a/hw/audio/es1370.c
+++ b/hw/audio/es1370.c
@@ -1082,6 +1082,10 @@ static const TypeInfo es1370_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof (ES1370State),
     .class_init    = es1370_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void es1370_register_types (void)
diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
index 18a50a8f83..a3e670c188 100644
--- a/hw/audio/intel-hda.c
+++ b/hw/audio/intel-hda.c
@@ -1263,6 +1263,10 @@ static const TypeInfo intel_hda_info = {
     .instance_size = sizeof(IntelHDAState),
     .class_init    = intel_hda_class_init,
     .abstract      = true,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const TypeInfo intel_hda_info_ich6 = {
diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
index 303104dd19..cb0d04c1d9 100644
--- a/hw/char/serial-pci.c
+++ b/hw/char/serial-pci.c
@@ -250,6 +250,10 @@ static const TypeInfo serial_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCISerialState),
     .class_init    = serial_pci_class_initfn,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const TypeInfo multi_2x_serial_pci_info = {
@@ -257,6 +261,10 @@ static const TypeInfo multi_2x_serial_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIMultiSerialState),
     .class_init    = multi_2x_serial_pci_class_initfn,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const TypeInfo multi_4x_serial_pci_info = {
@@ -264,6 +272,10 @@ static const TypeInfo multi_4x_serial_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIMultiSerialState),
     .class_init    = multi_4x_serial_pci_class_initfn,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void serial_pci_register_types(void)
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index afc290ab91..b4d579857a 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -3162,6 +3162,10 @@ static const TypeInfo cirrus_vga_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCICirrusVGAState),
     .class_init    = cirrus_vga_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void cirrus_vga_register_types(void)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index ae3677fd1e..b20e259122 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -2430,6 +2430,10 @@ static const TypeInfo qxl_pci_type_info = {
     .instance_size = sizeof(PCIQXLDevice),
     .abstract = true,
     .class_init = qxl_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void qxl_primary_class_init(ObjectClass *klass, void *data)
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 9aa515b3da..6eddac911e 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -1843,6 +1843,10 @@ static const TypeInfo sm501_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(SM501PCIState),
     .class_init    = sm501_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void sm501_register_types(void)
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index ac9a76499e..7adb89fcb4 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -338,6 +338,10 @@ static const TypeInfo vga_pci_type_info = {
     .instance_size = sizeof(PCIVGAState),
     .abstract = true,
     .class_init = vga_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void vga_class_init(ObjectClass *klass, void *data)
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 4a64b41259..cdc3fed6ca 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -1350,6 +1350,10 @@ static const TypeInfo vmsvga_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(struct pci_vmsvga_state_s),
     .class_init    = vmsvga_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void vmsvga_register_types(void)
diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
index ea51e09186..e47556c9d8 100644
--- a/hw/i2c/smbus_ich9.c
+++ b/hw/i2c/smbus_ich9.c
@@ -119,6 +119,10 @@ static const TypeInfo ich9_smb_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(ICH9SMBState),
     .class_init = ich9_smb_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ich9_smb_register(void)
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 334938a280..ad8155ca4c 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1227,6 +1227,10 @@ static const TypeInfo amdviPCI = {
     .name = "AMDVI-PCI",
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(AMDVIPCIState),
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void amdvi_iommu_memory_region_class_init(ObjectClass *klass, void *data)
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
index 33e20cb3e8..d8559d8342 100644
--- a/hw/i386/kvm/pci-assign.c
+++ b/hw/i386/kvm/pci-assign.c
@@ -1864,6 +1864,10 @@ static const TypeInfo assign_info = {
     .instance_size      = sizeof(AssignedDevice),
     .class_init         = assign_class_init,
     .instance_init      = assigned_dev_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void assign_register_types(void)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 9ff79b1fd9..1a56465490 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -1055,6 +1055,10 @@ static TypeInfo isa_bridge_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = isa_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pt_graphics_register_types(void)
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index 9ba7474566..056b87de0b 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -517,6 +517,10 @@ static const TypeInfo xen_platform_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIXenPlatformState),
     .class_init    = xen_platform_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void xen_platform_register_types(void)
diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c
index c093b34458..f748823658 100644
--- a/hw/i386/xen/xen_pvdevice.c
+++ b/hw/i386/xen/xen_pvdevice.c
@@ -127,6 +127,10 @@ static const TypeInfo xen_pv_type_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(XenPVDevice),
     .class_init    = xen_pv_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void xen_pv_register_types(void)
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index 9472a60cab..8dd0ced6b3 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -184,6 +184,10 @@ static const TypeInfo ich_ahci_info = {
     .instance_size = sizeof(AHCIPCIState),
     .instance_init = pci_ich9_ahci_init,
     .class_init    = ich_ahci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ich_ahci_register_types(void)
diff --git a/hw/ide/pci.c b/hw/ide/pci.c
index f2dcc0ed77..053c0375c1 100644
--- a/hw/ide/pci.c
+++ b/hw/ide/pci.c
@@ -451,6 +451,10 @@ static const TypeInfo pci_ide_type_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIIDEState),
     .abstract = true,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_ide_register_types(void)
diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c
index 4dfa6b33f3..da05c8589d 100644
--- a/hw/ipack/tpci200.c
+++ b/hw/ipack/tpci200.c
@@ -646,6 +646,10 @@ static const TypeInfo tpci200_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(TPCI200State),
     .class_init    = tpci200_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void tpci200_register_types(void)
diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index 4d29a9900c..d20ea4c2ee 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -138,6 +138,10 @@ static const TypeInfo i82378_type_info = {
     .instance_size = sizeof(I82378State),
     .instance_init = i82378_init,
     .class_init = i82378_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void i82378_register_types(void)
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index ac8416d42b..39f56ba44e 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -823,6 +823,7 @@ static const TypeInfo ich9_lpc_info = {
     .interfaces = (InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
         { TYPE_ACPI_DEVICE_IF },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
 };
diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
index f811eba59d..6b8bc3faf0 100644
--- a/hw/isa/piix4.c
+++ b/hw/isa/piix4.c
@@ -132,6 +132,10 @@ static const TypeInfo piix4_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PIIX4State),
     .class_init    = piix4_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void piix4_register_types(void)
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index 50dc83df77..c129985e2a 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -301,6 +301,10 @@ static const TypeInfo via_ac97_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(VT686AC97State),
     .class_init    = via_ac97_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void vt82c686b_mc97_realize(PCIDevice *dev, Error **errp)
@@ -341,6 +345,10 @@ static const TypeInfo via_mc97_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(VT686MC97State),
     .class_init    = via_mc97_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 /* vt82c686 pm init */
@@ -419,6 +427,10 @@ static const TypeInfo via_pm_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(VT686PMState),
     .class_init    = via_pm_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const VMStateDescription vmstate_via = {
@@ -502,6 +514,10 @@ static const TypeInfo via_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(VT82C686BState),
     .class_init    = via_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void vt82c686b_register_types(void)
diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c
index e8b2eef688..5a9dad9aae 100644
--- a/hw/mips/gt64xxx_pci.c
+++ b/hw/mips/gt64xxx_pci.c
@@ -1232,6 +1232,10 @@ static const TypeInfo gt64120_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = gt64120_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void gt64120_class_init(ObjectClass *klass, void *data)
diff --git a/hw/misc/edu.c b/hw/misc/edu.c
index 01acacf142..34eb05d213 100644
--- a/hw/misc/edu.c
+++ b/hw/misc/edu.c
@@ -408,12 +408,17 @@ static void edu_class_init(ObjectClass *class, void *data)
 
 static void pci_edu_register_types(void)
 {
+    static InterfaceInfo interfaces[] = {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    };
     static const TypeInfo edu_info = {
         .name          = "edu",
         .parent        = TYPE_PCI_DEVICE,
         .instance_size = sizeof(EduState),
         .instance_init = edu_instance_init,
         .class_init    = edu_class_init,
+        .interfaces = interfaces,
     };
 
     type_register_static(&edu_info);
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index b3ef3ec1e3..a5a46827fe 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -1010,6 +1010,10 @@ static const TypeInfo ivshmem_common_info = {
     .instance_size = sizeof(IVShmemState),
     .abstract      = true,
     .class_init    = ivshmem_common_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const VMStateDescription ivshmem_plain_vmsd = {
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index 5d57f45dc6..298e65071c 100644
--- a/hw/misc/macio/macio.c
+++ b/hw/misc/macio/macio.c
@@ -415,6 +415,10 @@ static const TypeInfo macio_type_info = {
     .instance_init = macio_instance_init,
     .abstract      = true,
     .class_init    = macio_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void macio_register_types(void)
diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
index 7d5990213e..32041f535f 100644
--- a/hw/misc/pci-testdev.c
+++ b/hw/misc/pci-testdev.c
@@ -326,6 +326,10 @@ static const TypeInfo pci_testdev_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCITestDevState),
     .class_init    = pci_testdev_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_testdev_register_types(void)
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index eebe3a9c13..acdb935af5 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -1685,6 +1685,10 @@ static const TypeInfo e1000_base_info = {
     .instance_init = e1000_instance_init,
     .class_size    = sizeof(E1000BaseClass),
     .abstract      = true,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static const E1000Info e1000_devices[] = {
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index a7b9f77519..80b8f47c4b 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -2116,6 +2116,10 @@ static void eepro100_register_types(void)
         type_info.class_init = eepro100_class_init;
         type_info.instance_size = sizeof(EEPRO100State);
         type_info.instance_init = eepro100_instance_init;
+        type_info.interfaces = (InterfaceInfo[]) {
+            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+            { },
+        };
 
         type_register(&type_info);
     }
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 798d681e25..3938e6ddd8 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -786,6 +786,10 @@ static const TypeInfo ne2000_info = {
     .instance_size = sizeof(PCINE2000State),
     .class_init    = ne2000_class_init,
     .instance_init = ne2000_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ne2000_register_types(void)
diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
index 0acf8a4879..0ae5ca4701 100644
--- a/hw/net/pcnet-pci.c
+++ b/hw/net/pcnet-pci.c
@@ -365,6 +365,10 @@ static const TypeInfo pcnet_info = {
     .instance_size = sizeof(PCIPCNetState),
     .class_init    = pcnet_class_init,
     .instance_init = pcnet_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_pcnet_register_types(void)
diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
index 9273473d59..823a29df03 100644
--- a/hw/net/rocker/rocker.c
+++ b/hw/net/rocker/rocker.c
@@ -1525,6 +1525,10 @@ static const TypeInfo rocker_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(Rocker),
     .class_init    = rocker_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void rocker_register_types(void)
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 3be24bbee7..bef0464b2e 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -3442,6 +3442,10 @@ static const TypeInfo rtl8139_info = {
     .instance_size = sizeof(RTL8139State),
     .class_init    = rtl8139_class_init,
     .instance_init = rtl8139_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void rtl8139_register_types(void)
diff --git a/hw/net/sungem.c b/hw/net/sungem.c
index dffa0c90f3..6aa8d1117b 100644
--- a/hw/net/sungem.c
+++ b/hw/net/sungem.c
@@ -1437,6 +1437,10 @@ static const TypeInfo sungem_info = {
     .instance_size = sizeof(SunGEMState),
     .class_init    = sungem_class_init,
     .instance_init = sungem_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { }
+    }
 };
 
 static void sungem_register_types(void)
diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c
index 60277adcf1..b1efa1b88d 100644
--- a/hw/net/sunhme.c
+++ b/hw/net/sunhme.c
@@ -968,6 +968,10 @@ static const TypeInfo sunhme_info = {
     .class_init    = sunhme_class_init,
     .instance_size = sizeof(SunHMEState),
     .instance_init = sunhme_instance_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { }
+    }
 };
 
 static void sunhme_register_types(void)
diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
index eb275e1a25..84492d5e5f 100644
--- a/hw/pci-bridge/dec.c
+++ b/hw/pci-bridge/dec.c
@@ -79,6 +79,10 @@ static const TypeInfo dec_21154_pci_bridge_info = {
     .parent        = TYPE_PCI_BRIDGE,
     .instance_size = sizeof(PCIBridge),
     .class_init    = dec_21154_pci_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
@@ -138,6 +142,10 @@ static const TypeInfo dec_21154_pci_host_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = dec_21154_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
index 2c1b747b4b..cb522bf30c 100644
--- a/hw/pci-bridge/i82801b11.c
+++ b/hw/pci-bridge/i82801b11.c
@@ -106,6 +106,10 @@ static const TypeInfo i82801b11_bridge_info = {
     .parent        = TYPE_PCI_BRIDGE,
     .instance_size = sizeof(I82801b11Bridge),
     .class_init    = i82801b11_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void d2pbr_register(void)
diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
index 4373f1d3e2..d56f6638c2 100644
--- a/hw/pci-bridge/pci_bridge_dev.c
+++ b/hw/pci-bridge/pci_bridge_dev.c
@@ -238,6 +238,7 @@ static const TypeInfo pci_bridge_dev_info = {
     .instance_finalize = pci_bridge_dev_instance_finalize,
     .interfaces = (InterfaceInfo[]) {
         { TYPE_HOTPLUG_HANDLER },
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
         { }
     }
 };
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index ff59abf208..8c8ac737ad 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -316,6 +316,10 @@ static const TypeInfo pxb_dev_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PXBDev),
     .class_init    = pxb_dev_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pxb_pcie_dev_realize(PCIDevice *dev, Error **errp)
@@ -350,6 +354,10 @@ static const TypeInfo pxb_pcie_dev_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PXBDev),
     .class_init    = pxb_pcie_dev_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pxb_register_types(void)
diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
index b709456b97..1edf57f600 100644
--- a/hw/pci-host/apb.c
+++ b/hw/pci-host/apb.c
@@ -836,6 +836,10 @@ static const TypeInfo pbm_pci_host_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = pbm_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pbm_host_class_init(ObjectClass *klass, void *data)
@@ -883,6 +887,10 @@ static const TypeInfo pbm_pci_bridge_info = {
     .parent        = TYPE_PCI_BRIDGE,
     .class_init    = pbm_pci_bridge_class_init,
     .instance_size = sizeof(PBMPCIBridge),
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pbm_iommu_memory_region_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 89133a9dd3..9f61e27edc 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -833,6 +833,10 @@ static const TypeInfo bonito_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIBonitoState),
     .class_init    = bonito_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void bonito_pcihost_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
index be25245219..4090793cf0 100644
--- a/hw/pci-host/gpex.c
+++ b/hw/pci-host/gpex.c
@@ -166,6 +166,10 @@ static const TypeInfo gpex_root_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(GPEXRootState),
     .class_init = gpex_root_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void gpex_register(void)
diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c
index 2e281f6155..38cd279b6b 100644
--- a/hw/pci-host/grackle.c
+++ b/hw/pci-host/grackle.c
@@ -142,6 +142,10 @@ static const TypeInfo grackle_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = grackle_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_grackle_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index 894e131c00..2b8d90a853 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -694,6 +694,10 @@ static const TypeInfo piix3_pci_type_info = {
     .instance_size = sizeof(PIIX3State),
     .abstract = true,
     .class_init = pci_piix3_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void piix3_class_init(ObjectClass *klass, void *data)
@@ -748,6 +752,10 @@ static const TypeInfo i440fx_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCII440FXState),
     .class_init    = i440fx_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 /* IGD Passthrough Host Bridge. */
diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
index becc0eeb76..39cd24464d 100644
--- a/hw/pci-host/ppce500.c
+++ b/hw/pci-host/ppce500.c
@@ -516,6 +516,10 @@ static const TypeInfo e500_host_bridge_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PPCE500PCIBridgeState),
     .class_init    = e500_host_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static Property pcihost_properties[] = {
diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
index 8b293ba0f1..92eed0f3e1 100644
--- a/hw/pci-host/prep.c
+++ b/hw/pci-host/prep.c
@@ -372,6 +372,10 @@ static const TypeInfo raven_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(RavenPCIState),
     .class_init = raven_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static Property raven_pcihost_properties[] = {
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 1ff648e80c..ddaa7d1b44 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -591,6 +591,10 @@ static const TypeInfo mch_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(MCHPCIState),
     .class_init = mch_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void q35_register(void)
diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
index 6cf5e59f86..ea5c265718 100644
--- a/hw/pci-host/uninorth.c
+++ b/hw/pci-host/uninorth.c
@@ -374,6 +374,10 @@ static const TypeInfo unin_main_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = unin_main_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void u3_agp_pci_host_class_init(ObjectClass *klass, void *data)
@@ -398,6 +402,10 @@ static const TypeInfo u3_agp_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = u3_agp_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void unin_agp_pci_host_class_init(ObjectClass *klass, void *data)
@@ -422,6 +430,10 @@ static const TypeInfo unin_agp_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = unin_agp_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void unin_internal_pci_host_class_init(ObjectClass *klass, void *data)
@@ -446,6 +458,10 @@ static const TypeInfo unin_internal_pci_host_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init = unin_internal_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void pci_unin_main_class_init(ObjectClass *klass, void *data)
diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
index aa1fdf75fd..6394a520fc 100644
--- a/hw/pci-host/versatile.c
+++ b/hw/pci-host/versatile.c
@@ -487,6 +487,10 @@ static const TypeInfo versatile_pci_host_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = versatile_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static Property pci_vpb_properties[] = {
diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
index 6953f8b9ac..4765dcecca 100644
--- a/hw/ppc/ppc4xx_pci.c
+++ b/hw/ppc/ppc4xx_pci.c
@@ -359,6 +359,10 @@ static const TypeInfo ppc4xx_host_bridge_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = ppc4xx_host_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ppc4xx_pcihost_class_init(ObjectClass *klass, void *data)
diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index e295d88939..419fc668ac 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -398,6 +398,10 @@ static const TypeInfo esp_pci_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIESPState),
     .class_init = esp_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 typedef struct {
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 3e56ab267c..423a2848ea 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -2244,6 +2244,10 @@ static const TypeInfo lsi_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(LSIState),
     .class_init    = lsi_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void lsi53c810_class_init(ObjectClass *klass, void *data)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 535ee267c3..d5eae6239a 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -2468,6 +2468,10 @@ static struct MegasasInfo megasas_devices[] = {
         .is_express = false,
         .vmsd = &vmstate_megasas_gen1,
         .props = megasas_properties_gen1,
+        .interfaces = (InterfaceInfo[]) {
+            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+            { },
+        },
     },{
         .name = TYPE_MEGASAS_GEN2,
         .desc = "LSI MegaRAID SAS 2108",
diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
index d05fa9f549..f6db1b0103 100644
--- a/hw/scsi/mptsas.c
+++ b/hw/scsi/mptsas.c
@@ -1439,6 +1439,10 @@ static const TypeInfo mptsas_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(MPTSASState),
     .class_init = mptsas1068_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void mptsas_register_types(void)
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 6d6a791ee9..b064a087c9 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1315,6 +1315,10 @@ static const TypeInfo sdhci_pci_info = {
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(SDHCIState),
     .class_init = sdhci_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static Property sdhci_sysbus_properties[] = {
diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c
index 38395c082b..cbb01af57f 100644
--- a/hw/sh4/sh_pci.c
+++ b/hw/sh4/sh_pci.c
@@ -179,6 +179,10 @@ static const TypeInfo sh_pci_host_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIDevice),
     .class_init    = sh_pci_host_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void sh_pci_device_class_init(ObjectClass *klass, void *data)
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index c3280aaf38..8282651aeb 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -275,6 +275,10 @@ static const TypeInfo ebus_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(EbusState),
     .class_init    = ebus_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 #define TYPE_OPENPROM "openprom"
diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index 6dedcb8989..8c0fc53a26 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -170,6 +170,10 @@ static const TypeInfo ehci_pci_type_info = {
     .instance_finalize = usb_ehci_pci_finalize,
     .abstract = true,
     .class_init = ehci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void ehci_data_class_init(ObjectClass *klass, void *data)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 267982e160..a31df67daa 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -2139,6 +2139,10 @@ static const TypeInfo ohci_pci_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(OHCIPCIState),
     .class_init    = ohci_pci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static Property ohci_sysbus_properties[] = {
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index e3562a4c60..836b11f177 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1323,6 +1323,10 @@ static const TypeInfo uhci_pci_type_info = {
     .class_size    = sizeof(UHCIPCIDeviceClass),
     .abstract = true,
     .class_init = uhci_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void uhci_data_class_init(ObjectClass *klass, void *data)
diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
index 349085ea12..2bd9d126d1 100644
--- a/hw/vfio/pci-quirks.c
+++ b/hw/vfio/pci-quirks.c
@@ -1197,6 +1197,10 @@ static TypeInfo vfio_pci_igd_lpc_bridge_info = {
     .name = "vfio-pci-igd-lpc-bridge",
     .parent = TYPE_PCI_DEVICE,
     .class_init = vfio_pci_igd_lpc_bridge_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void vfio_pci_igd_register_types(void)
diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
index 49b3cd188a..e596b0804d 100644
--- a/hw/watchdog/wdt_i6300esb.c
+++ b/hw/watchdog/wdt_i6300esb.c
@@ -463,6 +463,10 @@ static const TypeInfo i6300esb_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(I6300State),
     .class_init    = i6300esb_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void i6300esb_register_types(void)
diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 375efa68f6..01df3414d3 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
     .instance_size = sizeof(XenPCIPassthroughState),
     .instance_finalize = xen_pci_passthrough_finalize,
     .class_init = xen_pci_passthrough_class_init,
+    .interfaces = (InterfaceInfo[]) {
+        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { },
+    },
 };
 
 static void xen_pci_passthrough_register_types(void)
-- 
2.13.5


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [Qemu-devel] [PATCH v2 5/5] pci: Validate interfaces on base_class_init
  2017-09-27 19:56 [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names Eduardo Habkost
                   ` (3 preceding siblings ...)
  2017-09-27 19:56   ` Eduardo Habkost
@ 2017-09-27 19:56 ` Eduardo Habkost
  2017-09-28  4:13   ` David Gibson
  2017-09-28  9:36   ` Marcel Apfelbaum
  2017-09-28  9:39 ` [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names Marcel Apfelbaum
  5 siblings, 2 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-27 19:56 UTC (permalink / raw)
  To: qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin, Marcel Apfelbaum

Make sure we don't forget to add the Conventional PCI or PCI
Express interface names on PCI device classes in the future.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes v1 -> v2:
* s/legacy/conventional/
  * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
---
 hw/pci/pci.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 1b08e18205..5ed3c8dca4 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2547,6 +2547,17 @@ static void pci_device_class_init(ObjectClass *klass, void *data)
     pc->realize = pci_default_realize;
 }
 
+static void pci_device_class_base_init(ObjectClass *klass, void *data)
+{
+    if (!object_class_is_abstract(klass)) {
+        ObjectClass *conventional =
+            object_class_dynamic_cast(klass, INTERFACE_CONVENTIONAL_PCI_DEVICE);
+        ObjectClass *pcie =
+            object_class_dynamic_cast(klass, INTERFACE_PCIE_DEVICE);
+        assert(conventional || pcie);
+    }
+}
+
 AddressSpace *pci_device_iommu_address_space(PCIDevice *dev)
 {
     PCIBus *bus = PCI_BUS(dev->bus);
@@ -2671,6 +2682,7 @@ static const TypeInfo pci_device_type_info = {
     .abstract = true,
     .class_size = sizeof(PCIDeviceClass),
     .class_init = pci_device_class_init,
+    .class_base_init = pci_device_class_base_init,
 };
 
 static void pci_register_types(void)
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 1/5] pci: conventional-pci-device and pci-express-device interfaces
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 1/5] pci: conventional-pci-device and pci-express-device interfaces Eduardo Habkost
@ 2017-09-28  4:04   ` David Gibson
  2017-09-28  9:08   ` Marcel Apfelbaum
  1 sibling, 0 replies; 37+ messages in thread
From: David Gibson @ 2017-09-28  4:04 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: qemu-devel, David Gibson, Alistair Francis, Laine Stump,
	Alex Williamson, Michael S. Tsirkin, Marcel Apfelbaum

[-- Attachment #1: Type: text/plain, Size: 2543 bytes --]

On Wed, Sep 27, 2017 at 04:56:31PM -0300, Eduardo Habkost wrote:
> Those two interfaces will be used to indicate which device types
> support Conventional PCI or PCI Express buses.  Management
> software will be able to use the qom-list-types QMP command to
> query that information.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
> Changes v1 -> v2:
> * s/legacy/conventional/
>   * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>  include/hw/pci/pci.h |  6 ++++++
>  hw/pci/pci.c         | 12 ++++++++++++
>  2 files changed, 18 insertions(+)
> 
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index aa7ef9cf69..8d02a0a383 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -198,6 +198,12 @@ enum {
>  #define PCI_DEVICE_GET_CLASS(obj) \
>       OBJECT_GET_CLASS(PCIDeviceClass, (obj), TYPE_PCI_DEVICE)
>  
> +/* Implemented by devices that can be plugged on PCI Express buses */
> +#define INTERFACE_PCIE_DEVICE "pci-express-device"
> +
> +/* Implemented by devices that can be plugged on Conventional PCI buses */
> +#define INTERFACE_CONVENTIONAL_PCI_DEVICE "conventional-pci-device"
> +
>  typedef struct PCIINTxRoute {
>      enum {
>          PCI_INTX_ENABLED,
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 1e6fb88eba..1b08e18205 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -170,6 +170,16 @@ static const TypeInfo pci_bus_info = {
>      .class_init = pci_bus_class_init,
>  };
>  
> +static const TypeInfo pcie_interface_info = {
> +    .name          = INTERFACE_PCIE_DEVICE,
> +    .parent        = TYPE_INTERFACE,
> +};
> +
> +static const TypeInfo conventional_pci_interface_info = {
> +    .name          = INTERFACE_CONVENTIONAL_PCI_DEVICE,
> +    .parent        = TYPE_INTERFACE,
> +};
> +
>  static const TypeInfo pcie_bus_info = {
>      .name = TYPE_PCIE_BUS,
>      .parent = TYPE_PCI_BUS,
> @@ -2667,6 +2677,8 @@ static void pci_register_types(void)
>  {
>      type_register_static(&pci_bus_info);
>      type_register_static(&pcie_bus_info);
> +    type_register_static(&conventional_pci_interface_info);
> +    type_register_static(&pcie_interface_info);
>      type_register_static(&pci_device_type_info);
>  }
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/5] pci: Add interface names to hybrid PCI devices
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 2/5] pci: Add interface names to hybrid PCI devices Eduardo Habkost
@ 2017-09-28  4:08   ` David Gibson
  2017-09-28  9:27     ` Marcel Apfelbaum
  2017-09-28 13:06     ` Eduardo Habkost
  0 siblings, 2 replies; 37+ messages in thread
From: David Gibson @ 2017-09-28  4:08 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: qemu-devel, David Gibson, Alistair Francis, Laine Stump,
	Alex Williamson, Michael S. Tsirkin, Marcel Apfelbaum,
	Dmitry Fleytman, Jason Wang, Paolo Bonzini, Gerd Hoffmann

[-- Attachment #1: Type: text/plain, Size: 4649 bytes --]

On Wed, Sep 27, 2017 at 04:56:32PM -0300, Eduardo Habkost wrote:
> The following devices support both PCI Express and Conventional
> PCI, by including special code to handle the QEMU_PCI_CAP_EXPRESS
> flag and/or conditional pcie_endpoint_cap_init() calls:
> 
> * vfio-pci (is_express=1, but legacy PCI handled by
>   vfio_populate_device())

In the case of VFIO, won't this depend on the capabilities of the
device on the host?

> * vmxnet3 (is_express=0, but PCIe handled by vmxnet3_realize())
> * pvscsi (is_express=0, but PCIe handled by pvscsi_realize())
> * virtio-pci (is_express=0, but PCIe handled by
>   virtio_pci_dc_realize(), and additional legacy PCI code at
>   virtio_pci_realize())
> * base-xhci (is_express=1, but pcie_endpoint_cap_init() call
>   is conditional on pci_bus_is_express(dev->bus)
>   * Note that xhci does not clear QEMU_PCI_CAP_EXPRESS like the
>     other hybrid devices
> 
> Cc: Dmitry Fleytman <dmitry@daynix.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Except for the query above,

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
> Changes v1 -> v2:
> * s/legacy/conventional/
>   * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> * Mark base-xhci as hybrid too
> ---
>  hw/net/vmxnet3.c       | 5 +++++
>  hw/scsi/vmw_pvscsi.c   | 2 ++
>  hw/usb/hcd-xhci.c      | 5 +++++
>  hw/vfio/pci.c          | 5 +++++
>  hw/virtio/virtio-pci.c | 5 +++++
>  5 files changed, 22 insertions(+)
> 
> diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
> index a19a7a31dd..f99d9a69ec 100644
> --- a/hw/net/vmxnet3.c
> +++ b/hw/net/vmxnet3.c
> @@ -2651,6 +2651,11 @@ static const TypeInfo vmxnet3_info = {
>      .instance_size = sizeof(VMXNET3State),
>      .class_init    = vmxnet3_class_init,
>      .instance_init = vmxnet3_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    },
>  };
>  
>  static void vmxnet3_register_types(void)
> diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
> index 6d3f0bf11d..d6b315f8b2 100644
> --- a/hw/scsi/vmw_pvscsi.c
> +++ b/hw/scsi/vmw_pvscsi.c
> @@ -1300,6 +1300,8 @@ static const TypeInfo pvscsi_info = {
>      .class_init    = pvscsi_class_init,
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_HOTPLUG_HANDLER },
> +        { INTERFACE_PCIE_DEVICE },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>          { }
>      }
>  };
> diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
> index d75c085d94..af3a9d88de 100644
> --- a/hw/usb/hcd-xhci.c
> +++ b/hw/usb/hcd-xhci.c
> @@ -3670,6 +3670,11 @@ static const TypeInfo xhci_info = {
>      .instance_size = sizeof(XHCIState),
>      .class_init    = xhci_class_init,
>      .abstract      = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    },
>  };
>  
>  static void qemu_xhci_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 31e1edf447..913433d6ba 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -3023,6 +3023,11 @@ static const TypeInfo vfio_pci_dev_info = {
>      .class_init = vfio_pci_dev_class_init,
>      .instance_init = vfio_instance_init,
>      .instance_finalize = vfio_instance_finalize,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    },
>  };
>  
>  static void register_vfio_pci_dev_type(void)
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index 8b0d6b69cd..67c8ab63ad 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -1958,6 +1958,11 @@ static const TypeInfo virtio_pci_info = {
>      .class_init    = virtio_pci_class_init,
>      .class_size    = sizeof(VirtioPCIClass),
>      .abstract      = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    },
>  };
>  
>  /* virtio-blk-pci */

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/5] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 3/5] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices Eduardo Habkost
@ 2017-09-28  4:10   ` David Gibson
  2017-09-28  9:31   ` Marcel Apfelbaum
  1 sibling, 0 replies; 37+ messages in thread
From: David Gibson @ 2017-09-28  4:10 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: qemu-devel, David Gibson, Alistair Francis, Laine Stump,
	Alex Williamson, Michael S. Tsirkin, Marcel Apfelbaum,
	Keith Busch, Kevin Wolf, Max Reitz, Dmitry Fleytman, Jason Wang,
	Paul Burton, Paolo Bonzini, Hannes Reinecke, qemu-block

[-- Attachment #1: Type: text/plain, Size: 6363 bytes --]

On Wed, Sep 27, 2017 at 04:56:33PM -0300, Eduardo Habkost wrote:
> Change all devices that set is_express=1 to implement
> INTERFACE_PCIE_DEVICE.
> 
> Cc: Keith Busch <keith.busch@intel.com>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> Cc: Dmitry Fleytman <dmitry@daynix.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Marcel Apfelbaum <marcel@redhat.com>
> Cc: Paul Burton <paul.burton@imgtec.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Hannes Reinecke <hare@suse.com>
> Cc: qemu-block@nongnu.org
> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
> Changes v1 -> v2:
> * base-xhci is marked as hybrid, now (in another patch)
> * Included pcie-pci-bridge
> ---
>  hw/block/nvme.c                    | 4 ++++
>  hw/net/e1000e.c                    | 4 ++++
>  hw/pci-bridge/pcie_pci_bridge.c    | 1 +
>  hw/pci-bridge/pcie_root_port.c     | 4 ++++
>  hw/pci-bridge/xio3130_downstream.c | 4 ++++
>  hw/pci-bridge/xio3130_upstream.c   | 4 ++++
>  hw/pci-host/xilinx-pcie.c          | 4 ++++
>  hw/scsi/megasas.c                  | 6 ++++++
>  8 files changed, 31 insertions(+)
> 
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index 9aa32692a3..441e21ed1f 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -1110,6 +1110,10 @@ static const TypeInfo nvme_info = {
>      .instance_size = sizeof(NvmeCtrl),
>      .class_init    = nvme_class_init,
>      .instance_init = nvme_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>  };
>  
>  static void nvme_register_types(void)
> diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
> index 6c42b4478c..81f7934a59 100644
> --- a/hw/net/e1000e.c
> +++ b/hw/net/e1000e.c
> @@ -708,6 +708,10 @@ static const TypeInfo e1000e_info = {
>      .instance_size = sizeof(E1000EState),
>      .class_init = e1000e_class_init,
>      .instance_init = e1000e_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>  };
>  
>  static void e1000e_register_types(void)
> diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridge.c
> index 9aa5cc3e45..88db143633 100644
> --- a/hw/pci-bridge/pcie_pci_bridge.c
> +++ b/hw/pci-bridge/pcie_pci_bridge.c
> @@ -180,6 +180,7 @@ static const TypeInfo pcie_pci_bridge_info = {
>          .class_init = pcie_pci_bridge_class_init,
>          .interfaces = (InterfaceInfo[]) {
>              { TYPE_HOTPLUG_HANDLER },
> +            { INTERFACE_PCIE_DEVICE },
>              { },
>          }
>  };
> diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c
> index 4d588cb22e..9b6e4ce512 100644
> --- a/hw/pci-bridge/pcie_root_port.c
> +++ b/hw/pci-bridge/pcie_root_port.c
> @@ -161,6 +161,10 @@ static const TypeInfo rp_info = {
>      .class_init    = rp_class_init,
>      .abstract      = true,
>      .class_size = sizeof(PCIERootPortClass),
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>  };
>  
>  static void rp_register_types(void)
> diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
> index e706f36cb7..7d2f7629c1 100644
> --- a/hw/pci-bridge/xio3130_downstream.c
> +++ b/hw/pci-bridge/xio3130_downstream.c
> @@ -195,6 +195,10 @@ static const TypeInfo xio3130_downstream_info = {
>      .name          = "xio3130-downstream",
>      .parent        = TYPE_PCIE_SLOT,
>      .class_init    = xio3130_downstream_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>  };
>  
>  static void xio3130_downstream_register_types(void)
> diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
> index a052224bbf..227997ce46 100644
> --- a/hw/pci-bridge/xio3130_upstream.c
> +++ b/hw/pci-bridge/xio3130_upstream.c
> @@ -166,6 +166,10 @@ static const TypeInfo xio3130_upstream_info = {
>      .name          = "x3130-upstream",
>      .parent        = TYPE_PCIE_PORT,
>      .class_init    = xio3130_upstream_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>  };
>  
>  static void xio3130_upstream_register_types(void)
> diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c
> index 4613dda1d2..7659253090 100644
> --- a/hw/pci-host/xilinx-pcie.c
> +++ b/hw/pci-host/xilinx-pcie.c
> @@ -317,6 +317,10 @@ static const TypeInfo xilinx_pcie_root_info = {
>      .parent = TYPE_PCI_BRIDGE,
>      .instance_size = sizeof(XilinxPCIERoot),
>      .class_init = xilinx_pcie_root_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>  };
>  
>  static void xilinx_pcie_register(void)
> diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
> index 0db68aacee..535ee267c3 100644
> --- a/hw/scsi/megasas.c
> +++ b/hw/scsi/megasas.c
> @@ -2451,6 +2451,7 @@ typedef struct MegasasInfo {
>      int osts;
>      const VMStateDescription *vmsd;
>      Property *props;
> +    InterfaceInfo *interfaces;
>  } MegasasInfo;
>  
>  static struct MegasasInfo megasas_devices[] = {
> @@ -2480,6 +2481,10 @@ static struct MegasasInfo megasas_devices[] = {
>          .is_express = true,
>          .vmsd = &vmstate_megasas_gen2,
>          .props = megasas_properties_gen2,
> +        .interfaces = (InterfaceInfo[]) {
> +            { INTERFACE_PCIE_DEVICE },
> +            { }
> +        },
>      }
>  };
>  
> @@ -2531,6 +2536,7 @@ static void megasas_register_types(void)
>          type_info.parent = TYPE_MEGASAS_BASE;
>          type_info.class_data = (void *)info;
>          type_info.class_init = megasas_class_init;
> +        type_info.interfaces = info->interfaces;
>  
>          type_register(&type_info);
>      }

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
  2017-09-27 19:56   ` Eduardo Habkost
  (?)
  (?)
@ 2017-09-28  4:12   ` David Gibson
  -1 siblings, 0 replies; 37+ messages in thread
From: David Gibson @ 2017-09-28  4:12 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: qemu-devel, David Gibson, Alistair Francis, Laine Stump,
	Alex Williamson, Michael S. Tsirkin, Marcel Apfelbaum,
	Igor Mammedov, Gerd Hoffmann, Paolo Bonzini, Richard Henderson,
	Stefano Stabellini, Anthony Perard, John Snow, Alberto Garcia,
	Aurelien Jarno, Yongbok Kim, Jiri Slaby, Alexander Graf,
	Jason Wang, Jiri Pirko, Hervé Poussineau, Peter Maydell,
	Hannes Reinecke, Mark Cave-Ayland, Artyom Tarasenko, xen-devel,
	qemu-block, qemu-ppc, qemu-arm

[-- Attachment #1: Type: text/plain, Size: 45766 bytes --]

On Wed, Sep 27, 2017 at 04:56:34PM -0300, Eduardo Habkost wrote:
> Add INTERFACE_CONVENTIONAL_PCI_DEVICE to all direct subtypes of
> TYPE_PCI_DEVICE, except:
> 
> 1) The ones that already have INTERFACE_PCIE_DEVICE set:
> 
> * base-xhci
> * e1000e
> * nvme
> * pvscsi
> * vfio-pci
> * virtio-pci
> * vmxnet3
> 
> 2) base-pci-bridge
> 
> Not all PCI bridges are Conventional PCI devices, so
> INTERFACE_CONVENTIONAL_PCI_DEVICE is added only to the subtypes
> that are actually Conventional PCI:
> 
> * dec-21154-p2p-bridge
> * i82801b11-bridge
> * pbm-bridge
> * pci-bridge
> 
> The direct subtypes of base-pci-bridge not touched by this patch
> are:
> 
> * xilinx-pcie-root: Already marked as PCIe-only.
> * pcie-pci-bridge: Already marked as PCIe-only.
> * pcie-port: all non-abstract subtypes of pcie-port are already
>   marked as PCIe-only devices.
> 
> 3) megasas-base
> 
> Not all megasas devices are Conventional PCI devices, so the
> interface names are added to the subclasses registered by
> megasas_register_types(), according to information in the
> megasas_devices[] array.
> 
> "megasas-gen2" already implements INTERFACE_PCIE_DEVICE, so add
> INTERFACE_CONVENTIONAL_PCI_DEVICE only to "megasas".
> 
> Acked-by: Alberto Garcia <berto@igalia.com>
> Acked-by: John Snow <jsnow@redhat.com>
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

and for the ppc devices

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
> Changes v1 -> v2:
> * s/legacy/conventional/
>   * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> * Note about pcie-pci-bridge on commit message.
> * New devices: sungem, sunhme
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: John Snow <jsnow@redhat.com>
> Cc: Alberto Garcia <berto@igalia.com>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Yongbok Kim <yongbok.kim@imgtec.com>
> Cc: Jiri Slaby <jslaby@suse.cz>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: Marcel Apfelbaum <marcel@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: Jiri Pirko <jiri@resnulli.us>
> Cc: "Hervé Poussineau" <hpoussin@reactos.org>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Hannes Reinecke <hare@suse.com>
> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Cc: Artyom Tarasenko <atar4qemu@gmail.com>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: qemu-devel@nongnu.org
> Cc: xen-devel@lists.xenproject.org
> Cc: qemu-block@nongnu.org
> Cc: qemu-ppc@nongnu.org
> Cc: qemu-arm@nongnu.org
> ---
>  hw/acpi/piix4.c                     |  1 +
>  hw/audio/ac97.c                     |  4 ++++
>  hw/audio/es1370.c                   |  4 ++++
>  hw/audio/intel-hda.c                |  4 ++++
>  hw/char/serial-pci.c                | 12 ++++++++++++
>  hw/display/cirrus_vga.c             |  4 ++++
>  hw/display/qxl.c                    |  4 ++++
>  hw/display/sm501.c                  |  4 ++++
>  hw/display/vga-pci.c                |  4 ++++
>  hw/display/vmware_vga.c             |  4 ++++
>  hw/i2c/smbus_ich9.c                 |  4 ++++
>  hw/i386/amd_iommu.c                 |  4 ++++
>  hw/i386/kvm/pci-assign.c            |  4 ++++
>  hw/i386/pc_piix.c                   |  4 ++++
>  hw/i386/xen/xen_platform.c          |  4 ++++
>  hw/i386/xen/xen_pvdevice.c          |  4 ++++
>  hw/ide/ich.c                        |  4 ++++
>  hw/ide/pci.c                        |  4 ++++
>  hw/ipack/tpci200.c                  |  4 ++++
>  hw/isa/i82378.c                     |  4 ++++
>  hw/isa/lpc_ich9.c                   |  1 +
>  hw/isa/piix4.c                      |  4 ++++
>  hw/isa/vt82c686.c                   | 16 ++++++++++++++++
>  hw/mips/gt64xxx_pci.c               |  4 ++++
>  hw/misc/edu.c                       |  5 +++++
>  hw/misc/ivshmem.c                   |  4 ++++
>  hw/misc/macio/macio.c               |  4 ++++
>  hw/misc/pci-testdev.c               |  4 ++++
>  hw/net/e1000.c                      |  4 ++++
>  hw/net/eepro100.c                   |  4 ++++
>  hw/net/ne2000.c                     |  4 ++++
>  hw/net/pcnet-pci.c                  |  4 ++++
>  hw/net/rocker/rocker.c              |  4 ++++
>  hw/net/rtl8139.c                    |  4 ++++
>  hw/net/sungem.c                     |  4 ++++
>  hw/net/sunhme.c                     |  4 ++++
>  hw/pci-bridge/dec.c                 |  8 ++++++++
>  hw/pci-bridge/i82801b11.c           |  4 ++++
>  hw/pci-bridge/pci_bridge_dev.c      |  1 +
>  hw/pci-bridge/pci_expander_bridge.c |  8 ++++++++
>  hw/pci-host/apb.c                   |  8 ++++++++
>  hw/pci-host/bonito.c                |  4 ++++
>  hw/pci-host/gpex.c                  |  4 ++++
>  hw/pci-host/grackle.c               |  4 ++++
>  hw/pci-host/piix.c                  |  8 ++++++++
>  hw/pci-host/ppce500.c               |  4 ++++
>  hw/pci-host/prep.c                  |  4 ++++
>  hw/pci-host/q35.c                   |  4 ++++
>  hw/pci-host/uninorth.c              | 16 ++++++++++++++++
>  hw/pci-host/versatile.c             |  4 ++++
>  hw/ppc/ppc4xx_pci.c                 |  4 ++++
>  hw/scsi/esp-pci.c                   |  4 ++++
>  hw/scsi/lsi53c895a.c                |  4 ++++
>  hw/scsi/megasas.c                   |  4 ++++
>  hw/scsi/mptsas.c                    |  4 ++++
>  hw/sd/sdhci.c                       |  4 ++++
>  hw/sh4/sh_pci.c                     |  4 ++++
>  hw/sparc64/sun4u.c                  |  4 ++++
>  hw/usb/hcd-ehci-pci.c               |  4 ++++
>  hw/usb/hcd-ohci.c                   |  4 ++++
>  hw/usb/hcd-uhci.c                   |  4 ++++
>  hw/vfio/pci-quirks.c                |  4 ++++
>  hw/watchdog/wdt_i6300esb.c          |  4 ++++
>  hw/xen/xen_pt.c                     |  4 ++++
>  64 files changed, 296 insertions(+)
> 
> diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
> index f4fd5907b8..a0fb1ce037 100644
> --- a/hw/acpi/piix4.c
> +++ b/hw/acpi/piix4.c
> @@ -718,6 +718,7 @@ static const TypeInfo piix4_pm_info = {
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_HOTPLUG_HANDLER },
>          { TYPE_ACPI_DEVICE_IF },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>          { }
>      }
>  };
> diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
> index 959c786261..337402e9c6 100644
> --- a/hw/audio/ac97.c
> +++ b/hw/audio/ac97.c
> @@ -1431,6 +1431,10 @@ static const TypeInfo ac97_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof (AC97LinkState),
>      .class_init    = ac97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ac97_register_types (void)
> diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
> index dd7c23d185..59cf252754 100644
> --- a/hw/audio/es1370.c
> +++ b/hw/audio/es1370.c
> @@ -1082,6 +1082,10 @@ static const TypeInfo es1370_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof (ES1370State),
>      .class_init    = es1370_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void es1370_register_types (void)
> diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
> index 18a50a8f83..a3e670c188 100644
> --- a/hw/audio/intel-hda.c
> +++ b/hw/audio/intel-hda.c
> @@ -1263,6 +1263,10 @@ static const TypeInfo intel_hda_info = {
>      .instance_size = sizeof(IntelHDAState),
>      .class_init    = intel_hda_class_init,
>      .abstract      = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const TypeInfo intel_hda_info_ich6 = {
> diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
> index 303104dd19..cb0d04c1d9 100644
> --- a/hw/char/serial-pci.c
> +++ b/hw/char/serial-pci.c
> @@ -250,6 +250,10 @@ static const TypeInfo serial_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCISerialState),
>      .class_init    = serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const TypeInfo multi_2x_serial_pci_info = {
> @@ -257,6 +261,10 @@ static const TypeInfo multi_2x_serial_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIMultiSerialState),
>      .class_init    = multi_2x_serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const TypeInfo multi_4x_serial_pci_info = {
> @@ -264,6 +272,10 @@ static const TypeInfo multi_4x_serial_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIMultiSerialState),
>      .class_init    = multi_4x_serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void serial_pci_register_types(void)
> diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
> index afc290ab91..b4d579857a 100644
> --- a/hw/display/cirrus_vga.c
> +++ b/hw/display/cirrus_vga.c
> @@ -3162,6 +3162,10 @@ static const TypeInfo cirrus_vga_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCICirrusVGAState),
>      .class_init    = cirrus_vga_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void cirrus_vga_register_types(void)
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index ae3677fd1e..b20e259122 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -2430,6 +2430,10 @@ static const TypeInfo qxl_pci_type_info = {
>      .instance_size = sizeof(PCIQXLDevice),
>      .abstract = true,
>      .class_init = qxl_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void qxl_primary_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index 9aa515b3da..6eddac911e 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -1843,6 +1843,10 @@ static const TypeInfo sm501_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(SM501PCIState),
>      .class_init    = sm501_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void sm501_register_types(void)
> diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
> index ac9a76499e..7adb89fcb4 100644
> --- a/hw/display/vga-pci.c
> +++ b/hw/display/vga-pci.c
> @@ -338,6 +338,10 @@ static const TypeInfo vga_pci_type_info = {
>      .instance_size = sizeof(PCIVGAState),
>      .abstract = true,
>      .class_init = vga_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void vga_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
> index 4a64b41259..cdc3fed6ca 100644
> --- a/hw/display/vmware_vga.c
> +++ b/hw/display/vmware_vga.c
> @@ -1350,6 +1350,10 @@ static const TypeInfo vmsvga_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(struct pci_vmsvga_state_s),
>      .class_init    = vmsvga_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void vmsvga_register_types(void)
> diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
> index ea51e09186..e47556c9d8 100644
> --- a/hw/i2c/smbus_ich9.c
> +++ b/hw/i2c/smbus_ich9.c
> @@ -119,6 +119,10 @@ static const TypeInfo ich9_smb_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(ICH9SMBState),
>      .class_init = ich9_smb_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ich9_smb_register(void)
> diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
> index 334938a280..ad8155ca4c 100644
> --- a/hw/i386/amd_iommu.c
> +++ b/hw/i386/amd_iommu.c
> @@ -1227,6 +1227,10 @@ static const TypeInfo amdviPCI = {
>      .name = "AMDVI-PCI",
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(AMDVIPCIState),
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void amdvi_iommu_memory_region_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
> index 33e20cb3e8..d8559d8342 100644
> --- a/hw/i386/kvm/pci-assign.c
> +++ b/hw/i386/kvm/pci-assign.c
> @@ -1864,6 +1864,10 @@ static const TypeInfo assign_info = {
>      .instance_size      = sizeof(AssignedDevice),
>      .class_init         = assign_class_init,
>      .instance_init      = assigned_dev_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void assign_register_types(void)
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 9ff79b1fd9..1a56465490 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -1055,6 +1055,10 @@ static TypeInfo isa_bridge_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = isa_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pt_graphics_register_types(void)
> diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
> index 9ba7474566..056b87de0b 100644
> --- a/hw/i386/xen/xen_platform.c
> +++ b/hw/i386/xen/xen_platform.c
> @@ -517,6 +517,10 @@ static const TypeInfo xen_platform_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIXenPlatformState),
>      .class_init    = xen_platform_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void xen_platform_register_types(void)
> diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c
> index c093b34458..f748823658 100644
> --- a/hw/i386/xen/xen_pvdevice.c
> +++ b/hw/i386/xen/xen_pvdevice.c
> @@ -127,6 +127,10 @@ static const TypeInfo xen_pv_type_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(XenPVDevice),
>      .class_init    = xen_pv_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void xen_pv_register_types(void)
> diff --git a/hw/ide/ich.c b/hw/ide/ich.c
> index 9472a60cab..8dd0ced6b3 100644
> --- a/hw/ide/ich.c
> +++ b/hw/ide/ich.c
> @@ -184,6 +184,10 @@ static const TypeInfo ich_ahci_info = {
>      .instance_size = sizeof(AHCIPCIState),
>      .instance_init = pci_ich9_ahci_init,
>      .class_init    = ich_ahci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ich_ahci_register_types(void)
> diff --git a/hw/ide/pci.c b/hw/ide/pci.c
> index f2dcc0ed77..053c0375c1 100644
> --- a/hw/ide/pci.c
> +++ b/hw/ide/pci.c
> @@ -451,6 +451,10 @@ static const TypeInfo pci_ide_type_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIIDEState),
>      .abstract = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_ide_register_types(void)
> diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c
> index 4dfa6b33f3..da05c8589d 100644
> --- a/hw/ipack/tpci200.c
> +++ b/hw/ipack/tpci200.c
> @@ -646,6 +646,10 @@ static const TypeInfo tpci200_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(TPCI200State),
>      .class_init    = tpci200_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void tpci200_register_types(void)
> diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
> index 4d29a9900c..d20ea4c2ee 100644
> --- a/hw/isa/i82378.c
> +++ b/hw/isa/i82378.c
> @@ -138,6 +138,10 @@ static const TypeInfo i82378_type_info = {
>      .instance_size = sizeof(I82378State),
>      .instance_init = i82378_init,
>      .class_init = i82378_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void i82378_register_types(void)
> diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
> index ac8416d42b..39f56ba44e 100644
> --- a/hw/isa/lpc_ich9.c
> +++ b/hw/isa/lpc_ich9.c
> @@ -823,6 +823,7 @@ static const TypeInfo ich9_lpc_info = {
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_HOTPLUG_HANDLER },
>          { TYPE_ACPI_DEVICE_IF },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>          { }
>      }
>  };
> diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
> index f811eba59d..6b8bc3faf0 100644
> --- a/hw/isa/piix4.c
> +++ b/hw/isa/piix4.c
> @@ -132,6 +132,10 @@ static const TypeInfo piix4_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PIIX4State),
>      .class_init    = piix4_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void piix4_register_types(void)
> diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
> index 50dc83df77..c129985e2a 100644
> --- a/hw/isa/vt82c686.c
> +++ b/hw/isa/vt82c686.c
> @@ -301,6 +301,10 @@ static const TypeInfo via_ac97_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(VT686AC97State),
>      .class_init    = via_ac97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void vt82c686b_mc97_realize(PCIDevice *dev, Error **errp)
> @@ -341,6 +345,10 @@ static const TypeInfo via_mc97_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(VT686MC97State),
>      .class_init    = via_mc97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  /* vt82c686 pm init */
> @@ -419,6 +427,10 @@ static const TypeInfo via_pm_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(VT686PMState),
>      .class_init    = via_pm_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const VMStateDescription vmstate_via = {
> @@ -502,6 +514,10 @@ static const TypeInfo via_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(VT82C686BState),
>      .class_init    = via_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void vt82c686b_register_types(void)
> diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c
> index e8b2eef688..5a9dad9aae 100644
> --- a/hw/mips/gt64xxx_pci.c
> +++ b/hw/mips/gt64xxx_pci.c
> @@ -1232,6 +1232,10 @@ static const TypeInfo gt64120_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = gt64120_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void gt64120_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/misc/edu.c b/hw/misc/edu.c
> index 01acacf142..34eb05d213 100644
> --- a/hw/misc/edu.c
> +++ b/hw/misc/edu.c
> @@ -408,12 +408,17 @@ static void edu_class_init(ObjectClass *class, void *data)
>  
>  static void pci_edu_register_types(void)
>  {
> +    static InterfaceInfo interfaces[] = {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    };
>      static const TypeInfo edu_info = {
>          .name          = "edu",
>          .parent        = TYPE_PCI_DEVICE,
>          .instance_size = sizeof(EduState),
>          .instance_init = edu_instance_init,
>          .class_init    = edu_class_init,
> +        .interfaces = interfaces,
>      };
>  
>      type_register_static(&edu_info);
> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
> index b3ef3ec1e3..a5a46827fe 100644
> --- a/hw/misc/ivshmem.c
> +++ b/hw/misc/ivshmem.c
> @@ -1010,6 +1010,10 @@ static const TypeInfo ivshmem_common_info = {
>      .instance_size = sizeof(IVShmemState),
>      .abstract      = true,
>      .class_init    = ivshmem_common_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const VMStateDescription ivshmem_plain_vmsd = {
> diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
> index 5d57f45dc6..298e65071c 100644
> --- a/hw/misc/macio/macio.c
> +++ b/hw/misc/macio/macio.c
> @@ -415,6 +415,10 @@ static const TypeInfo macio_type_info = {
>      .instance_init = macio_instance_init,
>      .abstract      = true,
>      .class_init    = macio_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void macio_register_types(void)
> diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
> index 7d5990213e..32041f535f 100644
> --- a/hw/misc/pci-testdev.c
> +++ b/hw/misc/pci-testdev.c
> @@ -326,6 +326,10 @@ static const TypeInfo pci_testdev_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCITestDevState),
>      .class_init    = pci_testdev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_testdev_register_types(void)
> diff --git a/hw/net/e1000.c b/hw/net/e1000.c
> index eebe3a9c13..acdb935af5 100644
> --- a/hw/net/e1000.c
> +++ b/hw/net/e1000.c
> @@ -1685,6 +1685,10 @@ static const TypeInfo e1000_base_info = {
>      .instance_init = e1000_instance_init,
>      .class_size    = sizeof(E1000BaseClass),
>      .abstract      = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const E1000Info e1000_devices[] = {
> diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
> index a7b9f77519..80b8f47c4b 100644
> --- a/hw/net/eepro100.c
> +++ b/hw/net/eepro100.c
> @@ -2116,6 +2116,10 @@ static void eepro100_register_types(void)
>          type_info.class_init = eepro100_class_init;
>          type_info.instance_size = sizeof(EEPRO100State);
>          type_info.instance_init = eepro100_instance_init;
> +        type_info.interfaces = (InterfaceInfo[]) {
> +            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +            { },
> +        };
>  
>          type_register(&type_info);
>      }
> diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
> index 798d681e25..3938e6ddd8 100644
> --- a/hw/net/ne2000.c
> +++ b/hw/net/ne2000.c
> @@ -786,6 +786,10 @@ static const TypeInfo ne2000_info = {
>      .instance_size = sizeof(PCINE2000State),
>      .class_init    = ne2000_class_init,
>      .instance_init = ne2000_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ne2000_register_types(void)
> diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
> index 0acf8a4879..0ae5ca4701 100644
> --- a/hw/net/pcnet-pci.c
> +++ b/hw/net/pcnet-pci.c
> @@ -365,6 +365,10 @@ static const TypeInfo pcnet_info = {
>      .instance_size = sizeof(PCIPCNetState),
>      .class_init    = pcnet_class_init,
>      .instance_init = pcnet_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_pcnet_register_types(void)
> diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
> index 9273473d59..823a29df03 100644
> --- a/hw/net/rocker/rocker.c
> +++ b/hw/net/rocker/rocker.c
> @@ -1525,6 +1525,10 @@ static const TypeInfo rocker_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(Rocker),
>      .class_init    = rocker_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void rocker_register_types(void)
> diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
> index 3be24bbee7..bef0464b2e 100644
> --- a/hw/net/rtl8139.c
> +++ b/hw/net/rtl8139.c
> @@ -3442,6 +3442,10 @@ static const TypeInfo rtl8139_info = {
>      .instance_size = sizeof(RTL8139State),
>      .class_init    = rtl8139_class_init,
>      .instance_init = rtl8139_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void rtl8139_register_types(void)
> diff --git a/hw/net/sungem.c b/hw/net/sungem.c
> index dffa0c90f3..6aa8d1117b 100644
> --- a/hw/net/sungem.c
> +++ b/hw/net/sungem.c
> @@ -1437,6 +1437,10 @@ static const TypeInfo sungem_info = {
>      .instance_size = sizeof(SunGEMState),
>      .class_init    = sungem_class_init,
>      .instance_init = sungem_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    }
>  };
>  
>  static void sungem_register_types(void)
> diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c
> index 60277adcf1..b1efa1b88d 100644
> --- a/hw/net/sunhme.c
> +++ b/hw/net/sunhme.c
> @@ -968,6 +968,10 @@ static const TypeInfo sunhme_info = {
>      .class_init    = sunhme_class_init,
>      .instance_size = sizeof(SunHMEState),
>      .instance_init = sunhme_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    }
>  };
>  
>  static void sunhme_register_types(void)
> diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
> index eb275e1a25..84492d5e5f 100644
> --- a/hw/pci-bridge/dec.c
> +++ b/hw/pci-bridge/dec.c
> @@ -79,6 +79,10 @@ static const TypeInfo dec_21154_pci_bridge_info = {
>      .parent        = TYPE_PCI_BRIDGE,
>      .instance_size = sizeof(PCIBridge),
>      .class_init    = dec_21154_pci_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
> @@ -138,6 +142,10 @@ static const TypeInfo dec_21154_pci_host_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = dec_21154_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
> index 2c1b747b4b..cb522bf30c 100644
> --- a/hw/pci-bridge/i82801b11.c
> +++ b/hw/pci-bridge/i82801b11.c
> @@ -106,6 +106,10 @@ static const TypeInfo i82801b11_bridge_info = {
>      .parent        = TYPE_PCI_BRIDGE,
>      .instance_size = sizeof(I82801b11Bridge),
>      .class_init    = i82801b11_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void d2pbr_register(void)
> diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
> index 4373f1d3e2..d56f6638c2 100644
> --- a/hw/pci-bridge/pci_bridge_dev.c
> +++ b/hw/pci-bridge/pci_bridge_dev.c
> @@ -238,6 +238,7 @@ static const TypeInfo pci_bridge_dev_info = {
>      .instance_finalize = pci_bridge_dev_instance_finalize,
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_HOTPLUG_HANDLER },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>          { }
>      }
>  };
> diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
> index ff59abf208..8c8ac737ad 100644
> --- a/hw/pci-bridge/pci_expander_bridge.c
> +++ b/hw/pci-bridge/pci_expander_bridge.c
> @@ -316,6 +316,10 @@ static const TypeInfo pxb_dev_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PXBDev),
>      .class_init    = pxb_dev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pxb_pcie_dev_realize(PCIDevice *dev, Error **errp)
> @@ -350,6 +354,10 @@ static const TypeInfo pxb_pcie_dev_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PXBDev),
>      .class_init    = pxb_pcie_dev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pxb_register_types(void)
> diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
> index b709456b97..1edf57f600 100644
> --- a/hw/pci-host/apb.c
> +++ b/hw/pci-host/apb.c
> @@ -836,6 +836,10 @@ static const TypeInfo pbm_pci_host_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = pbm_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pbm_host_class_init(ObjectClass *klass, void *data)
> @@ -883,6 +887,10 @@ static const TypeInfo pbm_pci_bridge_info = {
>      .parent        = TYPE_PCI_BRIDGE,
>      .class_init    = pbm_pci_bridge_class_init,
>      .instance_size = sizeof(PBMPCIBridge),
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pbm_iommu_memory_region_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
> index 89133a9dd3..9f61e27edc 100644
> --- a/hw/pci-host/bonito.c
> +++ b/hw/pci-host/bonito.c
> @@ -833,6 +833,10 @@ static const TypeInfo bonito_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIBonitoState),
>      .class_init    = bonito_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void bonito_pcihost_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
> index be25245219..4090793cf0 100644
> --- a/hw/pci-host/gpex.c
> +++ b/hw/pci-host/gpex.c
> @@ -166,6 +166,10 @@ static const TypeInfo gpex_root_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(GPEXRootState),
>      .class_init = gpex_root_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void gpex_register(void)
> diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c
> index 2e281f6155..38cd279b6b 100644
> --- a/hw/pci-host/grackle.c
> +++ b/hw/pci-host/grackle.c
> @@ -142,6 +142,10 @@ static const TypeInfo grackle_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = grackle_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_grackle_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
> index 894e131c00..2b8d90a853 100644
> --- a/hw/pci-host/piix.c
> +++ b/hw/pci-host/piix.c
> @@ -694,6 +694,10 @@ static const TypeInfo piix3_pci_type_info = {
>      .instance_size = sizeof(PIIX3State),
>      .abstract = true,
>      .class_init = pci_piix3_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void piix3_class_init(ObjectClass *klass, void *data)
> @@ -748,6 +752,10 @@ static const TypeInfo i440fx_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCII440FXState),
>      .class_init    = i440fx_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  /* IGD Passthrough Host Bridge. */
> diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
> index becc0eeb76..39cd24464d 100644
> --- a/hw/pci-host/ppce500.c
> +++ b/hw/pci-host/ppce500.c
> @@ -516,6 +516,10 @@ static const TypeInfo e500_host_bridge_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PPCE500PCIBridgeState),
>      .class_init    = e500_host_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static Property pcihost_properties[] = {
> diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
> index 8b293ba0f1..92eed0f3e1 100644
> --- a/hw/pci-host/prep.c
> +++ b/hw/pci-host/prep.c
> @@ -372,6 +372,10 @@ static const TypeInfo raven_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(RavenPCIState),
>      .class_init = raven_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static Property raven_pcihost_properties[] = {
> diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
> index 1ff648e80c..ddaa7d1b44 100644
> --- a/hw/pci-host/q35.c
> +++ b/hw/pci-host/q35.c
> @@ -591,6 +591,10 @@ static const TypeInfo mch_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(MCHPCIState),
>      .class_init = mch_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void q35_register(void)
> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
> index 6cf5e59f86..ea5c265718 100644
> --- a/hw/pci-host/uninorth.c
> +++ b/hw/pci-host/uninorth.c
> @@ -374,6 +374,10 @@ static const TypeInfo unin_main_pci_host_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = unin_main_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void u3_agp_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -398,6 +402,10 @@ static const TypeInfo u3_agp_pci_host_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = u3_agp_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void unin_agp_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -422,6 +430,10 @@ static const TypeInfo unin_agp_pci_host_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = unin_agp_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void unin_internal_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -446,6 +458,10 @@ static const TypeInfo unin_internal_pci_host_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = unin_internal_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_unin_main_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
> index aa1fdf75fd..6394a520fc 100644
> --- a/hw/pci-host/versatile.c
> +++ b/hw/pci-host/versatile.c
> @@ -487,6 +487,10 @@ static const TypeInfo versatile_pci_host_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = versatile_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static Property pci_vpb_properties[] = {
> diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
> index 6953f8b9ac..4765dcecca 100644
> --- a/hw/ppc/ppc4xx_pci.c
> +++ b/hw/ppc/ppc4xx_pci.c
> @@ -359,6 +359,10 @@ static const TypeInfo ppc4xx_host_bridge_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = ppc4xx_host_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ppc4xx_pcihost_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
> index e295d88939..419fc668ac 100644
> --- a/hw/scsi/esp-pci.c
> +++ b/hw/scsi/esp-pci.c
> @@ -398,6 +398,10 @@ static const TypeInfo esp_pci_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIESPState),
>      .class_init = esp_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  typedef struct {
> diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
> index 3e56ab267c..423a2848ea 100644
> --- a/hw/scsi/lsi53c895a.c
> +++ b/hw/scsi/lsi53c895a.c
> @@ -2244,6 +2244,10 @@ static const TypeInfo lsi_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(LSIState),
>      .class_init    = lsi_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void lsi53c810_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
> index 535ee267c3..d5eae6239a 100644
> --- a/hw/scsi/megasas.c
> +++ b/hw/scsi/megasas.c
> @@ -2468,6 +2468,10 @@ static struct MegasasInfo megasas_devices[] = {
>          .is_express = false,
>          .vmsd = &vmstate_megasas_gen1,
>          .props = megasas_properties_gen1,
> +        .interfaces = (InterfaceInfo[]) {
> +            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +            { },
> +        },
>      },{
>          .name = TYPE_MEGASAS_GEN2,
>          .desc = "LSI MegaRAID SAS 2108",
> diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
> index d05fa9f549..f6db1b0103 100644
> --- a/hw/scsi/mptsas.c
> +++ b/hw/scsi/mptsas.c
> @@ -1439,6 +1439,10 @@ static const TypeInfo mptsas_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(MPTSASState),
>      .class_init = mptsas1068_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void mptsas_register_types(void)
> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
> index 6d6a791ee9..b064a087c9 100644
> --- a/hw/sd/sdhci.c
> +++ b/hw/sd/sdhci.c
> @@ -1315,6 +1315,10 @@ static const TypeInfo sdhci_pci_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(SDHCIState),
>      .class_init = sdhci_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static Property sdhci_sysbus_properties[] = {
> diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c
> index 38395c082b..cbb01af57f 100644
> --- a/hw/sh4/sh_pci.c
> +++ b/hw/sh4/sh_pci.c
> @@ -179,6 +179,10 @@ static const TypeInfo sh_pci_host_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = sh_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void sh_pci_device_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index c3280aaf38..8282651aeb 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -275,6 +275,10 @@ static const TypeInfo ebus_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(EbusState),
>      .class_init    = ebus_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  #define TYPE_OPENPROM "openprom"
> diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
> index 6dedcb8989..8c0fc53a26 100644
> --- a/hw/usb/hcd-ehci-pci.c
> +++ b/hw/usb/hcd-ehci-pci.c
> @@ -170,6 +170,10 @@ static const TypeInfo ehci_pci_type_info = {
>      .instance_finalize = usb_ehci_pci_finalize,
>      .abstract = true,
>      .class_init = ehci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ehci_data_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
> index 267982e160..a31df67daa 100644
> --- a/hw/usb/hcd-ohci.c
> +++ b/hw/usb/hcd-ohci.c
> @@ -2139,6 +2139,10 @@ static const TypeInfo ohci_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(OHCIPCIState),
>      .class_init    = ohci_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static Property ohci_sysbus_properties[] = {
> diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
> index e3562a4c60..836b11f177 100644
> --- a/hw/usb/hcd-uhci.c
> +++ b/hw/usb/hcd-uhci.c
> @@ -1323,6 +1323,10 @@ static const TypeInfo uhci_pci_type_info = {
>      .class_size    = sizeof(UHCIPCIDeviceClass),
>      .abstract = true,
>      .class_init = uhci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void uhci_data_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
> index 349085ea12..2bd9d126d1 100644
> --- a/hw/vfio/pci-quirks.c
> +++ b/hw/vfio/pci-quirks.c
> @@ -1197,6 +1197,10 @@ static TypeInfo vfio_pci_igd_lpc_bridge_info = {
>      .name = "vfio-pci-igd-lpc-bridge",
>      .parent = TYPE_PCI_DEVICE,
>      .class_init = vfio_pci_igd_lpc_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void vfio_pci_igd_register_types(void)
> diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
> index 49b3cd188a..e596b0804d 100644
> --- a/hw/watchdog/wdt_i6300esb.c
> +++ b/hw/watchdog/wdt_i6300esb.c
> @@ -463,6 +463,10 @@ static const TypeInfo i6300esb_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(I6300State),
>      .class_init    = i6300esb_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void i6300esb_register_types(void)
> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
> index 375efa68f6..01df3414d3 100644
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
>      .instance_size = sizeof(XenPCIPassthroughState),
>      .instance_finalize = xen_pci_passthrough_finalize,
>      .class_init = xen_pci_passthrough_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void xen_pci_passthrough_register_types(void)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
  2017-09-27 19:56   ` Eduardo Habkost
  (?)
@ 2017-09-28  4:12   ` David Gibson
  -1 siblings, 0 replies; 37+ messages in thread
From: David Gibson @ 2017-09-28  4:12 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	qemu-devel, Gerd Hoffmann, David Gibson, Jiri Slaby,
	Hannes Reinecke, Stefano Stabellini, Alberto Garcia, qemu-block,
	Alexander Graf, Hervé Poussineau, Anthony Perard, xen-devel,
	Artyom Tarasenko, Jiri Pirko, Marcel Apfelbaum, Alex Williamson,
	qemu-arm, Laine Stump, Igor Mammedov, Yongbok Kim


[-- Attachment #1.1: Type: text/plain, Size: 45766 bytes --]

On Wed, Sep 27, 2017 at 04:56:34PM -0300, Eduardo Habkost wrote:
> Add INTERFACE_CONVENTIONAL_PCI_DEVICE to all direct subtypes of
> TYPE_PCI_DEVICE, except:
> 
> 1) The ones that already have INTERFACE_PCIE_DEVICE set:
> 
> * base-xhci
> * e1000e
> * nvme
> * pvscsi
> * vfio-pci
> * virtio-pci
> * vmxnet3
> 
> 2) base-pci-bridge
> 
> Not all PCI bridges are Conventional PCI devices, so
> INTERFACE_CONVENTIONAL_PCI_DEVICE is added only to the subtypes
> that are actually Conventional PCI:
> 
> * dec-21154-p2p-bridge
> * i82801b11-bridge
> * pbm-bridge
> * pci-bridge
> 
> The direct subtypes of base-pci-bridge not touched by this patch
> are:
> 
> * xilinx-pcie-root: Already marked as PCIe-only.
> * pcie-pci-bridge: Already marked as PCIe-only.
> * pcie-port: all non-abstract subtypes of pcie-port are already
>   marked as PCIe-only devices.
> 
> 3) megasas-base
> 
> Not all megasas devices are Conventional PCI devices, so the
> interface names are added to the subclasses registered by
> megasas_register_types(), according to information in the
> megasas_devices[] array.
> 
> "megasas-gen2" already implements INTERFACE_PCIE_DEVICE, so add
> INTERFACE_CONVENTIONAL_PCI_DEVICE only to "megasas".
> 
> Acked-by: Alberto Garcia <berto@igalia.com>
> Acked-by: John Snow <jsnow@redhat.com>
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

and for the ppc devices

Acked-by: David Gibson <david@gibson.dropbear.id.au>

> ---
> Changes v1 -> v2:
> * s/legacy/conventional/
>   * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> * Note about pcie-pci-bridge on commit message.
> * New devices: sungem, sunhme
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: John Snow <jsnow@redhat.com>
> Cc: Alberto Garcia <berto@igalia.com>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Yongbok Kim <yongbok.kim@imgtec.com>
> Cc: Jiri Slaby <jslaby@suse.cz>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: Marcel Apfelbaum <marcel@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: Jiri Pirko <jiri@resnulli.us>
> Cc: "Hervé Poussineau" <hpoussin@reactos.org>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Hannes Reinecke <hare@suse.com>
> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Cc: Artyom Tarasenko <atar4qemu@gmail.com>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: qemu-devel@nongnu.org
> Cc: xen-devel@lists.xenproject.org
> Cc: qemu-block@nongnu.org
> Cc: qemu-ppc@nongnu.org
> Cc: qemu-arm@nongnu.org
> ---
>  hw/acpi/piix4.c                     |  1 +
>  hw/audio/ac97.c                     |  4 ++++
>  hw/audio/es1370.c                   |  4 ++++
>  hw/audio/intel-hda.c                |  4 ++++
>  hw/char/serial-pci.c                | 12 ++++++++++++
>  hw/display/cirrus_vga.c             |  4 ++++
>  hw/display/qxl.c                    |  4 ++++
>  hw/display/sm501.c                  |  4 ++++
>  hw/display/vga-pci.c                |  4 ++++
>  hw/display/vmware_vga.c             |  4 ++++
>  hw/i2c/smbus_ich9.c                 |  4 ++++
>  hw/i386/amd_iommu.c                 |  4 ++++
>  hw/i386/kvm/pci-assign.c            |  4 ++++
>  hw/i386/pc_piix.c                   |  4 ++++
>  hw/i386/xen/xen_platform.c          |  4 ++++
>  hw/i386/xen/xen_pvdevice.c          |  4 ++++
>  hw/ide/ich.c                        |  4 ++++
>  hw/ide/pci.c                        |  4 ++++
>  hw/ipack/tpci200.c                  |  4 ++++
>  hw/isa/i82378.c                     |  4 ++++
>  hw/isa/lpc_ich9.c                   |  1 +
>  hw/isa/piix4.c                      |  4 ++++
>  hw/isa/vt82c686.c                   | 16 ++++++++++++++++
>  hw/mips/gt64xxx_pci.c               |  4 ++++
>  hw/misc/edu.c                       |  5 +++++
>  hw/misc/ivshmem.c                   |  4 ++++
>  hw/misc/macio/macio.c               |  4 ++++
>  hw/misc/pci-testdev.c               |  4 ++++
>  hw/net/e1000.c                      |  4 ++++
>  hw/net/eepro100.c                   |  4 ++++
>  hw/net/ne2000.c                     |  4 ++++
>  hw/net/pcnet-pci.c                  |  4 ++++
>  hw/net/rocker/rocker.c              |  4 ++++
>  hw/net/rtl8139.c                    |  4 ++++
>  hw/net/sungem.c                     |  4 ++++
>  hw/net/sunhme.c                     |  4 ++++
>  hw/pci-bridge/dec.c                 |  8 ++++++++
>  hw/pci-bridge/i82801b11.c           |  4 ++++
>  hw/pci-bridge/pci_bridge_dev.c      |  1 +
>  hw/pci-bridge/pci_expander_bridge.c |  8 ++++++++
>  hw/pci-host/apb.c                   |  8 ++++++++
>  hw/pci-host/bonito.c                |  4 ++++
>  hw/pci-host/gpex.c                  |  4 ++++
>  hw/pci-host/grackle.c               |  4 ++++
>  hw/pci-host/piix.c                  |  8 ++++++++
>  hw/pci-host/ppce500.c               |  4 ++++
>  hw/pci-host/prep.c                  |  4 ++++
>  hw/pci-host/q35.c                   |  4 ++++
>  hw/pci-host/uninorth.c              | 16 ++++++++++++++++
>  hw/pci-host/versatile.c             |  4 ++++
>  hw/ppc/ppc4xx_pci.c                 |  4 ++++
>  hw/scsi/esp-pci.c                   |  4 ++++
>  hw/scsi/lsi53c895a.c                |  4 ++++
>  hw/scsi/megasas.c                   |  4 ++++
>  hw/scsi/mptsas.c                    |  4 ++++
>  hw/sd/sdhci.c                       |  4 ++++
>  hw/sh4/sh_pci.c                     |  4 ++++
>  hw/sparc64/sun4u.c                  |  4 ++++
>  hw/usb/hcd-ehci-pci.c               |  4 ++++
>  hw/usb/hcd-ohci.c                   |  4 ++++
>  hw/usb/hcd-uhci.c                   |  4 ++++
>  hw/vfio/pci-quirks.c                |  4 ++++
>  hw/watchdog/wdt_i6300esb.c          |  4 ++++
>  hw/xen/xen_pt.c                     |  4 ++++
>  64 files changed, 296 insertions(+)
> 
> diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
> index f4fd5907b8..a0fb1ce037 100644
> --- a/hw/acpi/piix4.c
> +++ b/hw/acpi/piix4.c
> @@ -718,6 +718,7 @@ static const TypeInfo piix4_pm_info = {
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_HOTPLUG_HANDLER },
>          { TYPE_ACPI_DEVICE_IF },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>          { }
>      }
>  };
> diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
> index 959c786261..337402e9c6 100644
> --- a/hw/audio/ac97.c
> +++ b/hw/audio/ac97.c
> @@ -1431,6 +1431,10 @@ static const TypeInfo ac97_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof (AC97LinkState),
>      .class_init    = ac97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ac97_register_types (void)
> diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
> index dd7c23d185..59cf252754 100644
> --- a/hw/audio/es1370.c
> +++ b/hw/audio/es1370.c
> @@ -1082,6 +1082,10 @@ static const TypeInfo es1370_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof (ES1370State),
>      .class_init    = es1370_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void es1370_register_types (void)
> diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
> index 18a50a8f83..a3e670c188 100644
> --- a/hw/audio/intel-hda.c
> +++ b/hw/audio/intel-hda.c
> @@ -1263,6 +1263,10 @@ static const TypeInfo intel_hda_info = {
>      .instance_size = sizeof(IntelHDAState),
>      .class_init    = intel_hda_class_init,
>      .abstract      = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const TypeInfo intel_hda_info_ich6 = {
> diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
> index 303104dd19..cb0d04c1d9 100644
> --- a/hw/char/serial-pci.c
> +++ b/hw/char/serial-pci.c
> @@ -250,6 +250,10 @@ static const TypeInfo serial_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCISerialState),
>      .class_init    = serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const TypeInfo multi_2x_serial_pci_info = {
> @@ -257,6 +261,10 @@ static const TypeInfo multi_2x_serial_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIMultiSerialState),
>      .class_init    = multi_2x_serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const TypeInfo multi_4x_serial_pci_info = {
> @@ -264,6 +272,10 @@ static const TypeInfo multi_4x_serial_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIMultiSerialState),
>      .class_init    = multi_4x_serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void serial_pci_register_types(void)
> diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
> index afc290ab91..b4d579857a 100644
> --- a/hw/display/cirrus_vga.c
> +++ b/hw/display/cirrus_vga.c
> @@ -3162,6 +3162,10 @@ static const TypeInfo cirrus_vga_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCICirrusVGAState),
>      .class_init    = cirrus_vga_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void cirrus_vga_register_types(void)
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index ae3677fd1e..b20e259122 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -2430,6 +2430,10 @@ static const TypeInfo qxl_pci_type_info = {
>      .instance_size = sizeof(PCIQXLDevice),
>      .abstract = true,
>      .class_init = qxl_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void qxl_primary_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index 9aa515b3da..6eddac911e 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -1843,6 +1843,10 @@ static const TypeInfo sm501_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(SM501PCIState),
>      .class_init    = sm501_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void sm501_register_types(void)
> diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
> index ac9a76499e..7adb89fcb4 100644
> --- a/hw/display/vga-pci.c
> +++ b/hw/display/vga-pci.c
> @@ -338,6 +338,10 @@ static const TypeInfo vga_pci_type_info = {
>      .instance_size = sizeof(PCIVGAState),
>      .abstract = true,
>      .class_init = vga_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void vga_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
> index 4a64b41259..cdc3fed6ca 100644
> --- a/hw/display/vmware_vga.c
> +++ b/hw/display/vmware_vga.c
> @@ -1350,6 +1350,10 @@ static const TypeInfo vmsvga_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(struct pci_vmsvga_state_s),
>      .class_init    = vmsvga_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void vmsvga_register_types(void)
> diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
> index ea51e09186..e47556c9d8 100644
> --- a/hw/i2c/smbus_ich9.c
> +++ b/hw/i2c/smbus_ich9.c
> @@ -119,6 +119,10 @@ static const TypeInfo ich9_smb_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(ICH9SMBState),
>      .class_init = ich9_smb_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ich9_smb_register(void)
> diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
> index 334938a280..ad8155ca4c 100644
> --- a/hw/i386/amd_iommu.c
> +++ b/hw/i386/amd_iommu.c
> @@ -1227,6 +1227,10 @@ static const TypeInfo amdviPCI = {
>      .name = "AMDVI-PCI",
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(AMDVIPCIState),
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void amdvi_iommu_memory_region_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
> index 33e20cb3e8..d8559d8342 100644
> --- a/hw/i386/kvm/pci-assign.c
> +++ b/hw/i386/kvm/pci-assign.c
> @@ -1864,6 +1864,10 @@ static const TypeInfo assign_info = {
>      .instance_size      = sizeof(AssignedDevice),
>      .class_init         = assign_class_init,
>      .instance_init      = assigned_dev_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void assign_register_types(void)
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 9ff79b1fd9..1a56465490 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -1055,6 +1055,10 @@ static TypeInfo isa_bridge_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = isa_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pt_graphics_register_types(void)
> diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
> index 9ba7474566..056b87de0b 100644
> --- a/hw/i386/xen/xen_platform.c
> +++ b/hw/i386/xen/xen_platform.c
> @@ -517,6 +517,10 @@ static const TypeInfo xen_platform_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIXenPlatformState),
>      .class_init    = xen_platform_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void xen_platform_register_types(void)
> diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c
> index c093b34458..f748823658 100644
> --- a/hw/i386/xen/xen_pvdevice.c
> +++ b/hw/i386/xen/xen_pvdevice.c
> @@ -127,6 +127,10 @@ static const TypeInfo xen_pv_type_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(XenPVDevice),
>      .class_init    = xen_pv_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void xen_pv_register_types(void)
> diff --git a/hw/ide/ich.c b/hw/ide/ich.c
> index 9472a60cab..8dd0ced6b3 100644
> --- a/hw/ide/ich.c
> +++ b/hw/ide/ich.c
> @@ -184,6 +184,10 @@ static const TypeInfo ich_ahci_info = {
>      .instance_size = sizeof(AHCIPCIState),
>      .instance_init = pci_ich9_ahci_init,
>      .class_init    = ich_ahci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ich_ahci_register_types(void)
> diff --git a/hw/ide/pci.c b/hw/ide/pci.c
> index f2dcc0ed77..053c0375c1 100644
> --- a/hw/ide/pci.c
> +++ b/hw/ide/pci.c
> @@ -451,6 +451,10 @@ static const TypeInfo pci_ide_type_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIIDEState),
>      .abstract = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_ide_register_types(void)
> diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c
> index 4dfa6b33f3..da05c8589d 100644
> --- a/hw/ipack/tpci200.c
> +++ b/hw/ipack/tpci200.c
> @@ -646,6 +646,10 @@ static const TypeInfo tpci200_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(TPCI200State),
>      .class_init    = tpci200_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void tpci200_register_types(void)
> diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
> index 4d29a9900c..d20ea4c2ee 100644
> --- a/hw/isa/i82378.c
> +++ b/hw/isa/i82378.c
> @@ -138,6 +138,10 @@ static const TypeInfo i82378_type_info = {
>      .instance_size = sizeof(I82378State),
>      .instance_init = i82378_init,
>      .class_init = i82378_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void i82378_register_types(void)
> diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
> index ac8416d42b..39f56ba44e 100644
> --- a/hw/isa/lpc_ich9.c
> +++ b/hw/isa/lpc_ich9.c
> @@ -823,6 +823,7 @@ static const TypeInfo ich9_lpc_info = {
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_HOTPLUG_HANDLER },
>          { TYPE_ACPI_DEVICE_IF },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>          { }
>      }
>  };
> diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
> index f811eba59d..6b8bc3faf0 100644
> --- a/hw/isa/piix4.c
> +++ b/hw/isa/piix4.c
> @@ -132,6 +132,10 @@ static const TypeInfo piix4_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PIIX4State),
>      .class_init    = piix4_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void piix4_register_types(void)
> diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
> index 50dc83df77..c129985e2a 100644
> --- a/hw/isa/vt82c686.c
> +++ b/hw/isa/vt82c686.c
> @@ -301,6 +301,10 @@ static const TypeInfo via_ac97_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(VT686AC97State),
>      .class_init    = via_ac97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void vt82c686b_mc97_realize(PCIDevice *dev, Error **errp)
> @@ -341,6 +345,10 @@ static const TypeInfo via_mc97_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(VT686MC97State),
>      .class_init    = via_mc97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  /* vt82c686 pm init */
> @@ -419,6 +427,10 @@ static const TypeInfo via_pm_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(VT686PMState),
>      .class_init    = via_pm_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const VMStateDescription vmstate_via = {
> @@ -502,6 +514,10 @@ static const TypeInfo via_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(VT82C686BState),
>      .class_init    = via_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void vt82c686b_register_types(void)
> diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c
> index e8b2eef688..5a9dad9aae 100644
> --- a/hw/mips/gt64xxx_pci.c
> +++ b/hw/mips/gt64xxx_pci.c
> @@ -1232,6 +1232,10 @@ static const TypeInfo gt64120_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = gt64120_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void gt64120_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/misc/edu.c b/hw/misc/edu.c
> index 01acacf142..34eb05d213 100644
> --- a/hw/misc/edu.c
> +++ b/hw/misc/edu.c
> @@ -408,12 +408,17 @@ static void edu_class_init(ObjectClass *class, void *data)
>  
>  static void pci_edu_register_types(void)
>  {
> +    static InterfaceInfo interfaces[] = {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    };
>      static const TypeInfo edu_info = {
>          .name          = "edu",
>          .parent        = TYPE_PCI_DEVICE,
>          .instance_size = sizeof(EduState),
>          .instance_init = edu_instance_init,
>          .class_init    = edu_class_init,
> +        .interfaces = interfaces,
>      };
>  
>      type_register_static(&edu_info);
> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
> index b3ef3ec1e3..a5a46827fe 100644
> --- a/hw/misc/ivshmem.c
> +++ b/hw/misc/ivshmem.c
> @@ -1010,6 +1010,10 @@ static const TypeInfo ivshmem_common_info = {
>      .instance_size = sizeof(IVShmemState),
>      .abstract      = true,
>      .class_init    = ivshmem_common_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const VMStateDescription ivshmem_plain_vmsd = {
> diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
> index 5d57f45dc6..298e65071c 100644
> --- a/hw/misc/macio/macio.c
> +++ b/hw/misc/macio/macio.c
> @@ -415,6 +415,10 @@ static const TypeInfo macio_type_info = {
>      .instance_init = macio_instance_init,
>      .abstract      = true,
>      .class_init    = macio_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void macio_register_types(void)
> diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
> index 7d5990213e..32041f535f 100644
> --- a/hw/misc/pci-testdev.c
> +++ b/hw/misc/pci-testdev.c
> @@ -326,6 +326,10 @@ static const TypeInfo pci_testdev_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCITestDevState),
>      .class_init    = pci_testdev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_testdev_register_types(void)
> diff --git a/hw/net/e1000.c b/hw/net/e1000.c
> index eebe3a9c13..acdb935af5 100644
> --- a/hw/net/e1000.c
> +++ b/hw/net/e1000.c
> @@ -1685,6 +1685,10 @@ static const TypeInfo e1000_base_info = {
>      .instance_init = e1000_instance_init,
>      .class_size    = sizeof(E1000BaseClass),
>      .abstract      = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static const E1000Info e1000_devices[] = {
> diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
> index a7b9f77519..80b8f47c4b 100644
> --- a/hw/net/eepro100.c
> +++ b/hw/net/eepro100.c
> @@ -2116,6 +2116,10 @@ static void eepro100_register_types(void)
>          type_info.class_init = eepro100_class_init;
>          type_info.instance_size = sizeof(EEPRO100State);
>          type_info.instance_init = eepro100_instance_init;
> +        type_info.interfaces = (InterfaceInfo[]) {
> +            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +            { },
> +        };
>  
>          type_register(&type_info);
>      }
> diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
> index 798d681e25..3938e6ddd8 100644
> --- a/hw/net/ne2000.c
> +++ b/hw/net/ne2000.c
> @@ -786,6 +786,10 @@ static const TypeInfo ne2000_info = {
>      .instance_size = sizeof(PCINE2000State),
>      .class_init    = ne2000_class_init,
>      .instance_init = ne2000_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ne2000_register_types(void)
> diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
> index 0acf8a4879..0ae5ca4701 100644
> --- a/hw/net/pcnet-pci.c
> +++ b/hw/net/pcnet-pci.c
> @@ -365,6 +365,10 @@ static const TypeInfo pcnet_info = {
>      .instance_size = sizeof(PCIPCNetState),
>      .class_init    = pcnet_class_init,
>      .instance_init = pcnet_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_pcnet_register_types(void)
> diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
> index 9273473d59..823a29df03 100644
> --- a/hw/net/rocker/rocker.c
> +++ b/hw/net/rocker/rocker.c
> @@ -1525,6 +1525,10 @@ static const TypeInfo rocker_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(Rocker),
>      .class_init    = rocker_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void rocker_register_types(void)
> diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
> index 3be24bbee7..bef0464b2e 100644
> --- a/hw/net/rtl8139.c
> +++ b/hw/net/rtl8139.c
> @@ -3442,6 +3442,10 @@ static const TypeInfo rtl8139_info = {
>      .instance_size = sizeof(RTL8139State),
>      .class_init    = rtl8139_class_init,
>      .instance_init = rtl8139_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void rtl8139_register_types(void)
> diff --git a/hw/net/sungem.c b/hw/net/sungem.c
> index dffa0c90f3..6aa8d1117b 100644
> --- a/hw/net/sungem.c
> +++ b/hw/net/sungem.c
> @@ -1437,6 +1437,10 @@ static const TypeInfo sungem_info = {
>      .instance_size = sizeof(SunGEMState),
>      .class_init    = sungem_class_init,
>      .instance_init = sungem_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    }
>  };
>  
>  static void sungem_register_types(void)
> diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c
> index 60277adcf1..b1efa1b88d 100644
> --- a/hw/net/sunhme.c
> +++ b/hw/net/sunhme.c
> @@ -968,6 +968,10 @@ static const TypeInfo sunhme_info = {
>      .class_init    = sunhme_class_init,
>      .instance_size = sizeof(SunHMEState),
>      .instance_init = sunhme_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    }
>  };
>  
>  static void sunhme_register_types(void)
> diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
> index eb275e1a25..84492d5e5f 100644
> --- a/hw/pci-bridge/dec.c
> +++ b/hw/pci-bridge/dec.c
> @@ -79,6 +79,10 @@ static const TypeInfo dec_21154_pci_bridge_info = {
>      .parent        = TYPE_PCI_BRIDGE,
>      .instance_size = sizeof(PCIBridge),
>      .class_init    = dec_21154_pci_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
> @@ -138,6 +142,10 @@ static const TypeInfo dec_21154_pci_host_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = dec_21154_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
> index 2c1b747b4b..cb522bf30c 100644
> --- a/hw/pci-bridge/i82801b11.c
> +++ b/hw/pci-bridge/i82801b11.c
> @@ -106,6 +106,10 @@ static const TypeInfo i82801b11_bridge_info = {
>      .parent        = TYPE_PCI_BRIDGE,
>      .instance_size = sizeof(I82801b11Bridge),
>      .class_init    = i82801b11_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void d2pbr_register(void)
> diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
> index 4373f1d3e2..d56f6638c2 100644
> --- a/hw/pci-bridge/pci_bridge_dev.c
> +++ b/hw/pci-bridge/pci_bridge_dev.c
> @@ -238,6 +238,7 @@ static const TypeInfo pci_bridge_dev_info = {
>      .instance_finalize = pci_bridge_dev_instance_finalize,
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_HOTPLUG_HANDLER },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>          { }
>      }
>  };
> diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
> index ff59abf208..8c8ac737ad 100644
> --- a/hw/pci-bridge/pci_expander_bridge.c
> +++ b/hw/pci-bridge/pci_expander_bridge.c
> @@ -316,6 +316,10 @@ static const TypeInfo pxb_dev_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PXBDev),
>      .class_init    = pxb_dev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pxb_pcie_dev_realize(PCIDevice *dev, Error **errp)
> @@ -350,6 +354,10 @@ static const TypeInfo pxb_pcie_dev_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PXBDev),
>      .class_init    = pxb_pcie_dev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pxb_register_types(void)
> diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
> index b709456b97..1edf57f600 100644
> --- a/hw/pci-host/apb.c
> +++ b/hw/pci-host/apb.c
> @@ -836,6 +836,10 @@ static const TypeInfo pbm_pci_host_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = pbm_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pbm_host_class_init(ObjectClass *klass, void *data)
> @@ -883,6 +887,10 @@ static const TypeInfo pbm_pci_bridge_info = {
>      .parent        = TYPE_PCI_BRIDGE,
>      .class_init    = pbm_pci_bridge_class_init,
>      .instance_size = sizeof(PBMPCIBridge),
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pbm_iommu_memory_region_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
> index 89133a9dd3..9f61e27edc 100644
> --- a/hw/pci-host/bonito.c
> +++ b/hw/pci-host/bonito.c
> @@ -833,6 +833,10 @@ static const TypeInfo bonito_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIBonitoState),
>      .class_init    = bonito_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void bonito_pcihost_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
> index be25245219..4090793cf0 100644
> --- a/hw/pci-host/gpex.c
> +++ b/hw/pci-host/gpex.c
> @@ -166,6 +166,10 @@ static const TypeInfo gpex_root_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(GPEXRootState),
>      .class_init = gpex_root_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void gpex_register(void)
> diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c
> index 2e281f6155..38cd279b6b 100644
> --- a/hw/pci-host/grackle.c
> +++ b/hw/pci-host/grackle.c
> @@ -142,6 +142,10 @@ static const TypeInfo grackle_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = grackle_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_grackle_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
> index 894e131c00..2b8d90a853 100644
> --- a/hw/pci-host/piix.c
> +++ b/hw/pci-host/piix.c
> @@ -694,6 +694,10 @@ static const TypeInfo piix3_pci_type_info = {
>      .instance_size = sizeof(PIIX3State),
>      .abstract = true,
>      .class_init = pci_piix3_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void piix3_class_init(ObjectClass *klass, void *data)
> @@ -748,6 +752,10 @@ static const TypeInfo i440fx_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCII440FXState),
>      .class_init    = i440fx_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  /* IGD Passthrough Host Bridge. */
> diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
> index becc0eeb76..39cd24464d 100644
> --- a/hw/pci-host/ppce500.c
> +++ b/hw/pci-host/ppce500.c
> @@ -516,6 +516,10 @@ static const TypeInfo e500_host_bridge_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PPCE500PCIBridgeState),
>      .class_init    = e500_host_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static Property pcihost_properties[] = {
> diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
> index 8b293ba0f1..92eed0f3e1 100644
> --- a/hw/pci-host/prep.c
> +++ b/hw/pci-host/prep.c
> @@ -372,6 +372,10 @@ static const TypeInfo raven_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(RavenPCIState),
>      .class_init = raven_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static Property raven_pcihost_properties[] = {
> diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
> index 1ff648e80c..ddaa7d1b44 100644
> --- a/hw/pci-host/q35.c
> +++ b/hw/pci-host/q35.c
> @@ -591,6 +591,10 @@ static const TypeInfo mch_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(MCHPCIState),
>      .class_init = mch_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void q35_register(void)
> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
> index 6cf5e59f86..ea5c265718 100644
> --- a/hw/pci-host/uninorth.c
> +++ b/hw/pci-host/uninorth.c
> @@ -374,6 +374,10 @@ static const TypeInfo unin_main_pci_host_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = unin_main_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void u3_agp_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -398,6 +402,10 @@ static const TypeInfo u3_agp_pci_host_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = u3_agp_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void unin_agp_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -422,6 +430,10 @@ static const TypeInfo unin_agp_pci_host_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = unin_agp_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void unin_internal_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -446,6 +458,10 @@ static const TypeInfo unin_internal_pci_host_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init = unin_internal_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void pci_unin_main_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
> index aa1fdf75fd..6394a520fc 100644
> --- a/hw/pci-host/versatile.c
> +++ b/hw/pci-host/versatile.c
> @@ -487,6 +487,10 @@ static const TypeInfo versatile_pci_host_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = versatile_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static Property pci_vpb_properties[] = {
> diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
> index 6953f8b9ac..4765dcecca 100644
> --- a/hw/ppc/ppc4xx_pci.c
> +++ b/hw/ppc/ppc4xx_pci.c
> @@ -359,6 +359,10 @@ static const TypeInfo ppc4xx_host_bridge_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = ppc4xx_host_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ppc4xx_pcihost_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
> index e295d88939..419fc668ac 100644
> --- a/hw/scsi/esp-pci.c
> +++ b/hw/scsi/esp-pci.c
> @@ -398,6 +398,10 @@ static const TypeInfo esp_pci_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIESPState),
>      .class_init = esp_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  typedef struct {
> diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
> index 3e56ab267c..423a2848ea 100644
> --- a/hw/scsi/lsi53c895a.c
> +++ b/hw/scsi/lsi53c895a.c
> @@ -2244,6 +2244,10 @@ static const TypeInfo lsi_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(LSIState),
>      .class_init    = lsi_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void lsi53c810_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
> index 535ee267c3..d5eae6239a 100644
> --- a/hw/scsi/megasas.c
> +++ b/hw/scsi/megasas.c
> @@ -2468,6 +2468,10 @@ static struct MegasasInfo megasas_devices[] = {
>          .is_express = false,
>          .vmsd = &vmstate_megasas_gen1,
>          .props = megasas_properties_gen1,
> +        .interfaces = (InterfaceInfo[]) {
> +            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +            { },
> +        },
>      },{
>          .name = TYPE_MEGASAS_GEN2,
>          .desc = "LSI MegaRAID SAS 2108",
> diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
> index d05fa9f549..f6db1b0103 100644
> --- a/hw/scsi/mptsas.c
> +++ b/hw/scsi/mptsas.c
> @@ -1439,6 +1439,10 @@ static const TypeInfo mptsas_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(MPTSASState),
>      .class_init = mptsas1068_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void mptsas_register_types(void)
> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
> index 6d6a791ee9..b064a087c9 100644
> --- a/hw/sd/sdhci.c
> +++ b/hw/sd/sdhci.c
> @@ -1315,6 +1315,10 @@ static const TypeInfo sdhci_pci_info = {
>      .parent = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(SDHCIState),
>      .class_init = sdhci_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static Property sdhci_sysbus_properties[] = {
> diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c
> index 38395c082b..cbb01af57f 100644
> --- a/hw/sh4/sh_pci.c
> +++ b/hw/sh4/sh_pci.c
> @@ -179,6 +179,10 @@ static const TypeInfo sh_pci_host_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(PCIDevice),
>      .class_init    = sh_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void sh_pci_device_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index c3280aaf38..8282651aeb 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -275,6 +275,10 @@ static const TypeInfo ebus_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(EbusState),
>      .class_init    = ebus_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  #define TYPE_OPENPROM "openprom"
> diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
> index 6dedcb8989..8c0fc53a26 100644
> --- a/hw/usb/hcd-ehci-pci.c
> +++ b/hw/usb/hcd-ehci-pci.c
> @@ -170,6 +170,10 @@ static const TypeInfo ehci_pci_type_info = {
>      .instance_finalize = usb_ehci_pci_finalize,
>      .abstract = true,
>      .class_init = ehci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void ehci_data_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
> index 267982e160..a31df67daa 100644
> --- a/hw/usb/hcd-ohci.c
> +++ b/hw/usb/hcd-ohci.c
> @@ -2139,6 +2139,10 @@ static const TypeInfo ohci_pci_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(OHCIPCIState),
>      .class_init    = ohci_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static Property ohci_sysbus_properties[] = {
> diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
> index e3562a4c60..836b11f177 100644
> --- a/hw/usb/hcd-uhci.c
> +++ b/hw/usb/hcd-uhci.c
> @@ -1323,6 +1323,10 @@ static const TypeInfo uhci_pci_type_info = {
>      .class_size    = sizeof(UHCIPCIDeviceClass),
>      .abstract = true,
>      .class_init = uhci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void uhci_data_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
> index 349085ea12..2bd9d126d1 100644
> --- a/hw/vfio/pci-quirks.c
> +++ b/hw/vfio/pci-quirks.c
> @@ -1197,6 +1197,10 @@ static TypeInfo vfio_pci_igd_lpc_bridge_info = {
>      .name = "vfio-pci-igd-lpc-bridge",
>      .parent = TYPE_PCI_DEVICE,
>      .class_init = vfio_pci_igd_lpc_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void vfio_pci_igd_register_types(void)
> diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
> index 49b3cd188a..e596b0804d 100644
> --- a/hw/watchdog/wdt_i6300esb.c
> +++ b/hw/watchdog/wdt_i6300esb.c
> @@ -463,6 +463,10 @@ static const TypeInfo i6300esb_info = {
>      .parent        = TYPE_PCI_DEVICE,
>      .instance_size = sizeof(I6300State),
>      .class_init    = i6300esb_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void i6300esb_register_types(void)
> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
> index 375efa68f6..01df3414d3 100644
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
>      .instance_size = sizeof(XenPCIPassthroughState),
>      .instance_finalize = xen_pci_passthrough_finalize,
>      .class_init = xen_pci_passthrough_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };
>  
>  static void xen_pci_passthrough_register_types(void)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 5/5] pci: Validate interfaces on base_class_init
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 5/5] pci: Validate interfaces on base_class_init Eduardo Habkost
@ 2017-09-28  4:13   ` David Gibson
  2017-09-28  9:36   ` Marcel Apfelbaum
  1 sibling, 0 replies; 37+ messages in thread
From: David Gibson @ 2017-09-28  4:13 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: qemu-devel, David Gibson, Alistair Francis, Laine Stump,
	Alex Williamson, Michael S. Tsirkin, Marcel Apfelbaum

[-- Attachment #1: Type: text/plain, Size: 1819 bytes --]

On Wed, Sep 27, 2017 at 04:56:35PM -0300, Eduardo Habkost wrote:
> Make sure we don't forget to add the Conventional PCI or PCI
> Express interface names on PCI device classes in the future.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Revieed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
> Changes v1 -> v2:
> * s/legacy/conventional/
>   * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>  hw/pci/pci.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 1b08e18205..5ed3c8dca4 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -2547,6 +2547,17 @@ static void pci_device_class_init(ObjectClass *klass, void *data)
>      pc->realize = pci_default_realize;
>  }
>  
> +static void pci_device_class_base_init(ObjectClass *klass, void *data)
> +{
> +    if (!object_class_is_abstract(klass)) {
> +        ObjectClass *conventional =
> +            object_class_dynamic_cast(klass, INTERFACE_CONVENTIONAL_PCI_DEVICE);
> +        ObjectClass *pcie =
> +            object_class_dynamic_cast(klass, INTERFACE_PCIE_DEVICE);
> +        assert(conventional || pcie);
> +    }
> +}
> +
>  AddressSpace *pci_device_iommu_address_space(PCIDevice *dev)
>  {
>      PCIBus *bus = PCI_BUS(dev->bus);
> @@ -2671,6 +2682,7 @@ static const TypeInfo pci_device_type_info = {
>      .abstract = true,
>      .class_size = sizeof(PCIDeviceClass),
>      .class_init = pci_device_class_init,
> +    .class_base_init = pci_device_class_base_init,
>  };
>  
>  static void pci_register_types(void)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
  2017-09-27 19:56   ` Eduardo Habkost
@ 2017-09-28  8:33     ` Jan Beulich
  -1 siblings, 0 replies; 37+ messages in thread
From: Jan Beulich @ 2017-09-28  8:33 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Aurelien Jarno, Anthony Perard, David Gibson, Alistair Francis,
	Artyom Tarasenko, Alberto Garcia, Mark Cave-Ayland, Yongbok Kim,
	Stefano Stabellini, Peter Maydell, xen-devel, qemu-arm,
	qemu-block, qemu-devel, qemu-ppc, Hervé Poussineau,
	Alex Williamson, David Gibson, Igor Mammedov, Jason Wang,
	John Snow, Gerd Hoffmann, Laine Stump, Marcel Apfelbaum,
	Michael S. Tsirkin, Paolo Bonzini, Jiri Pirko, Hannes Reinecke,
	Jiri Slaby, Alexander Graf, Richard Henderson

>>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
>      .instance_size = sizeof(XenPCIPassthroughState),
>      .instance_finalize = xen_pci_passthrough_finalize,
>      .class_init = xen_pci_passthrough_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };

Passed through devices can be both PCI and PCIe, so following
the description of the patch I don't think these can be statically
given either property. Granted quite a bit of PCIe specific
functionality may be missing in the Xen code ...

Jan

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
@ 2017-09-28  8:33     ` Jan Beulich
  0 siblings, 0 replies; 37+ messages in thread
From: Jan Beulich @ 2017-09-28  8:33 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	qemu-devel, Gerd Hoffmann, David Gibson, Jiri Slaby,
	Hannes Reinecke, Stefano Stabellini, Alberto Garcia, qemu-block,
	Alexander Graf, Hervé Poussineau, Anthony Perard, xen-devel,
	Richard Henderson, Artyom Tarasenko, Jiri Pirko,
	Marcel Apfelbaum, Alex Williamson, qemu-arm, Laine Stump,
	Paolo Bonzini

>>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
>      .instance_size = sizeof(XenPCIPassthroughState),
>      .instance_finalize = xen_pci_passthrough_finalize,
>      .class_init = xen_pci_passthrough_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>  };

Passed through devices can be both PCI and PCIe, so following
the description of the patch I don't think these can be statically
given either property. Granted quite a bit of PCIe specific
functionality may be missing in the Xen code ...

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 1/5] pci: conventional-pci-device and pci-express-device interfaces
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 1/5] pci: conventional-pci-device and pci-express-device interfaces Eduardo Habkost
  2017-09-28  4:04   ` David Gibson
@ 2017-09-28  9:08   ` Marcel Apfelbaum
  1 sibling, 0 replies; 37+ messages in thread
From: Marcel Apfelbaum @ 2017-09-28  9:08 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin

On 27/09/2017 22:56, Eduardo Habkost wrote:
> Those two interfaces will be used to indicate which device types
> support Conventional PCI or PCI Express buses.  Management
> software will be able to use the qom-list-types QMP command to
> query that information.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes v1 -> v2:
> * s/legacy/conventional/
>    * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>   include/hw/pci/pci.h |  6 ++++++
>   hw/pci/pci.c         | 12 ++++++++++++
>   2 files changed, 18 insertions(+)
> 
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index aa7ef9cf69..8d02a0a383 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -198,6 +198,12 @@ enum {
>   #define PCI_DEVICE_GET_CLASS(obj) \
>        OBJECT_GET_CLASS(PCIDeviceClass, (obj), TYPE_PCI_DEVICE)
>   
> +/* Implemented by devices that can be plugged on PCI Express buses */
> +#define INTERFACE_PCIE_DEVICE "pci-express-device"
> +
> +/* Implemented by devices that can be plugged on Conventional PCI buses */
> +#define INTERFACE_CONVENTIONAL_PCI_DEVICE "conventional-pci-device"
> +
>   typedef struct PCIINTxRoute {
>       enum {
>           PCI_INTX_ENABLED,
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 1e6fb88eba..1b08e18205 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -170,6 +170,16 @@ static const TypeInfo pci_bus_info = {
>       .class_init = pci_bus_class_init,
>   };
>   
> +static const TypeInfo pcie_interface_info = {
> +    .name          = INTERFACE_PCIE_DEVICE,
> +    .parent        = TYPE_INTERFACE,
> +};
> +
> +static const TypeInfo conventional_pci_interface_info = {
> +    .name          = INTERFACE_CONVENTIONAL_PCI_DEVICE,
> +    .parent        = TYPE_INTERFACE,
> +};
> +
>   static const TypeInfo pcie_bus_info = {
>       .name = TYPE_PCIE_BUS,
>       .parent = TYPE_PCI_BUS,
> @@ -2667,6 +2677,8 @@ static void pci_register_types(void)
>   {
>       type_register_static(&pci_bus_info);
>       type_register_static(&pcie_bus_info);
> +    type_register_static(&conventional_pci_interface_info);
> +    type_register_static(&pcie_interface_info);
>       type_register_static(&pci_device_type_info);
>   }
>   
> 


Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/5] pci: Add interface names to hybrid PCI devices
  2017-09-28  4:08   ` David Gibson
@ 2017-09-28  9:27     ` Marcel Apfelbaum
  2017-09-28 13:06     ` Eduardo Habkost
  1 sibling, 0 replies; 37+ messages in thread
From: Marcel Apfelbaum @ 2017-09-28  9:27 UTC (permalink / raw)
  To: David Gibson, Eduardo Habkost
  Cc: qemu-devel, David Gibson, Alistair Francis, Laine Stump,
	Alex Williamson, Michael S. Tsirkin, Dmitry Fleytman, Jason Wang,
	Paolo Bonzini, Gerd Hoffmann

On 28/09/2017 7:08, David Gibson wrote:
> On Wed, Sep 27, 2017 at 04:56:32PM -0300, Eduardo Habkost wrote:
>> The following devices support both PCI Express and Conventional
>> PCI, by including special code to handle the QEMU_PCI_CAP_EXPRESS
>> flag and/or conditional pcie_endpoint_cap_init() calls:
>>
>> * vfio-pci (is_express=1, but legacy PCI handled by
>>    vfio_populate_device())
> 
> In the case of VFIO, won't this depend on the capabilities of the
> device on the host?
> 

Most (almost all?) assigned devices are PCI Express,
they will be exposed as PCI/PCI express depending on the
slot they are plugged into.

Anyway, the interface only states the device can be PCI or PCI Express,
so I think is OK.

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel

>> * vmxnet3 (is_express=0, but PCIe handled by vmxnet3_realize())
>> * pvscsi (is_express=0, but PCIe handled by pvscsi_realize())
>> * virtio-pci (is_express=0, but PCIe handled by
>>    virtio_pci_dc_realize(), and additional legacy PCI code at
>>    virtio_pci_realize())
>> * base-xhci (is_express=1, but pcie_endpoint_cap_init() call
>>    is conditional on pci_bus_is_express(dev->bus)
>>    * Note that xhci does not clear QEMU_PCI_CAP_EXPRESS like the
>>      other hybrid devices
>>
>> Cc: Dmitry Fleytman <dmitry@daynix.com>
>> Cc: Jason Wang <jasowang@redhat.com>
>> Cc: Paolo Bonzini <pbonzini@redhat.com>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Alex Williamson <alex.williamson@redhat.com>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> 
> Except for the query above,
> 
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> 
>> ---
>> Changes v1 -> v2:
>> * s/legacy/conventional/
>>    * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
>> * Mark base-xhci as hybrid too
>> ---
>>   hw/net/vmxnet3.c       | 5 +++++
>>   hw/scsi/vmw_pvscsi.c   | 2 ++
>>   hw/usb/hcd-xhci.c      | 5 +++++
>>   hw/vfio/pci.c          | 5 +++++
>>   hw/virtio/virtio-pci.c | 5 +++++
>>   5 files changed, 22 insertions(+)
>>
>> diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
>> index a19a7a31dd..f99d9a69ec 100644
>> --- a/hw/net/vmxnet3.c
>> +++ b/hw/net/vmxnet3.c
>> @@ -2651,6 +2651,11 @@ static const TypeInfo vmxnet3_info = {
>>       .instance_size = sizeof(VMXNET3State),
>>       .class_init    = vmxnet3_class_init,
>>       .instance_init = vmxnet3_instance_init,
>> +    .interfaces = (InterfaceInfo[]) {
>> +        { INTERFACE_PCIE_DEVICE },
>> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>> +        { }
>> +    },
>>   };
>>   
>>   static void vmxnet3_register_types(void)
>> diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
>> index 6d3f0bf11d..d6b315f8b2 100644
>> --- a/hw/scsi/vmw_pvscsi.c
>> +++ b/hw/scsi/vmw_pvscsi.c
>> @@ -1300,6 +1300,8 @@ static const TypeInfo pvscsi_info = {
>>       .class_init    = pvscsi_class_init,
>>       .interfaces = (InterfaceInfo[]) {
>>           { TYPE_HOTPLUG_HANDLER },
>> +        { INTERFACE_PCIE_DEVICE },
>> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>>           { }
>>       }
>>   };
>> diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
>> index d75c085d94..af3a9d88de 100644
>> --- a/hw/usb/hcd-xhci.c
>> +++ b/hw/usb/hcd-xhci.c
>> @@ -3670,6 +3670,11 @@ static const TypeInfo xhci_info = {
>>       .instance_size = sizeof(XHCIState),
>>       .class_init    = xhci_class_init,
>>       .abstract      = true,
>> +    .interfaces = (InterfaceInfo[]) {
>> +        { INTERFACE_PCIE_DEVICE },
>> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>> +        { }
>> +    },
>>   };
>>   
>>   static void qemu_xhci_class_init(ObjectClass *klass, void *data)
>> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
>> index 31e1edf447..913433d6ba 100644
>> --- a/hw/vfio/pci.c
>> +++ b/hw/vfio/pci.c
>> @@ -3023,6 +3023,11 @@ static const TypeInfo vfio_pci_dev_info = {
>>       .class_init = vfio_pci_dev_class_init,
>>       .instance_init = vfio_instance_init,
>>       .instance_finalize = vfio_instance_finalize,
>> +    .interfaces = (InterfaceInfo[]) {
>> +        { INTERFACE_PCIE_DEVICE },
>> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>> +        { }
>> +    },
>>   };
>>   
>>   static void register_vfio_pci_dev_type(void)
>> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
>> index 8b0d6b69cd..67c8ab63ad 100644
>> --- a/hw/virtio/virtio-pci.c
>> +++ b/hw/virtio/virtio-pci.c
>> @@ -1958,6 +1958,11 @@ static const TypeInfo virtio_pci_info = {
>>       .class_init    = virtio_pci_class_init,
>>       .class_size    = sizeof(VirtioPCIClass),
>>       .abstract      = true,
>> +    .interfaces = (InterfaceInfo[]) {
>> +        { INTERFACE_PCIE_DEVICE },
>> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>> +        { }
>> +    },
>>   };
>>   
>>   /* virtio-blk-pci */
> 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 3/5] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 3/5] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices Eduardo Habkost
  2017-09-28  4:10   ` David Gibson
@ 2017-09-28  9:31   ` Marcel Apfelbaum
  1 sibling, 0 replies; 37+ messages in thread
From: Marcel Apfelbaum @ 2017-09-28  9:31 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin, Keith Busch, Kevin Wolf, Max Reitz,
	Dmitry Fleytman, Jason Wang, Paul Burton, Paolo Bonzini,
	Hannes Reinecke, qemu-block

On 27/09/2017 22:56, Eduardo Habkost wrote:
> Change all devices that set is_express=1 to implement
> INTERFACE_PCIE_DEVICE.
> 
> Cc: Keith Busch <keith.busch@intel.com>
> Cc: Kevin Wolf <kwolf@redhat.com>
> Cc: Max Reitz <mreitz@redhat.com>
> Cc: Dmitry Fleytman <dmitry@daynix.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Marcel Apfelbaum <marcel@redhat.com>
> Cc: Paul Burton <paul.burton@imgtec.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Hannes Reinecke <hare@suse.com>
> Cc: qemu-block@nongnu.org
> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes v1 -> v2:
> * base-xhci is marked as hybrid, now (in another patch)
> * Included pcie-pci-bridge
> ---
>   hw/block/nvme.c                    | 4 ++++
>   hw/net/e1000e.c                    | 4 ++++
>   hw/pci-bridge/pcie_pci_bridge.c    | 1 +
>   hw/pci-bridge/pcie_root_port.c     | 4 ++++
>   hw/pci-bridge/xio3130_downstream.c | 4 ++++
>   hw/pci-bridge/xio3130_upstream.c   | 4 ++++
>   hw/pci-host/xilinx-pcie.c          | 4 ++++
>   hw/scsi/megasas.c                  | 6 ++++++
>   8 files changed, 31 insertions(+)
> 
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index 9aa32692a3..441e21ed1f 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -1110,6 +1110,10 @@ static const TypeInfo nvme_info = {
>       .instance_size = sizeof(NvmeCtrl),
>       .class_init    = nvme_class_init,
>       .instance_init = nvme_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>   };
>   
>   static void nvme_register_types(void)
> diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c
> index 6c42b4478c..81f7934a59 100644
> --- a/hw/net/e1000e.c
> +++ b/hw/net/e1000e.c
> @@ -708,6 +708,10 @@ static const TypeInfo e1000e_info = {
>       .instance_size = sizeof(E1000EState),
>       .class_init = e1000e_class_init,
>       .instance_init = e1000e_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>   };
>   
>   static void e1000e_register_types(void)
> diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridge.c
> index 9aa5cc3e45..88db143633 100644
> --- a/hw/pci-bridge/pcie_pci_bridge.c
> +++ b/hw/pci-bridge/pcie_pci_bridge.c
> @@ -180,6 +180,7 @@ static const TypeInfo pcie_pci_bridge_info = {
>           .class_init = pcie_pci_bridge_class_init,
>           .interfaces = (InterfaceInfo[]) {
>               { TYPE_HOTPLUG_HANDLER },
> +            { INTERFACE_PCIE_DEVICE },
>               { },
>           }
>   };
> diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c
> index 4d588cb22e..9b6e4ce512 100644
> --- a/hw/pci-bridge/pcie_root_port.c
> +++ b/hw/pci-bridge/pcie_root_port.c
> @@ -161,6 +161,10 @@ static const TypeInfo rp_info = {
>       .class_init    = rp_class_init,
>       .abstract      = true,
>       .class_size = sizeof(PCIERootPortClass),
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>   };
>   
>   static void rp_register_types(void)
> diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_downstream.c
> index e706f36cb7..7d2f7629c1 100644
> --- a/hw/pci-bridge/xio3130_downstream.c
> +++ b/hw/pci-bridge/xio3130_downstream.c
> @@ -195,6 +195,10 @@ static const TypeInfo xio3130_downstream_info = {
>       .name          = "xio3130-downstream",
>       .parent        = TYPE_PCIE_SLOT,
>       .class_init    = xio3130_downstream_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>   };
>   
>   static void xio3130_downstream_register_types(void)
> diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstream.c
> index a052224bbf..227997ce46 100644
> --- a/hw/pci-bridge/xio3130_upstream.c
> +++ b/hw/pci-bridge/xio3130_upstream.c
> @@ -166,6 +166,10 @@ static const TypeInfo xio3130_upstream_info = {
>       .name          = "x3130-upstream",
>       .parent        = TYPE_PCIE_PORT,
>       .class_init    = xio3130_upstream_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>   };
>   
>   static void xio3130_upstream_register_types(void)
> diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c
> index 4613dda1d2..7659253090 100644
> --- a/hw/pci-host/xilinx-pcie.c
> +++ b/hw/pci-host/xilinx-pcie.c
> @@ -317,6 +317,10 @@ static const TypeInfo xilinx_pcie_root_info = {
>       .parent = TYPE_PCI_BRIDGE,
>       .instance_size = sizeof(XilinxPCIERoot),
>       .class_init = xilinx_pcie_root_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_PCIE_DEVICE },
> +        { }
> +    },
>   };
>   
>   static void xilinx_pcie_register(void)
> diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
> index 0db68aacee..535ee267c3 100644
> --- a/hw/scsi/megasas.c
> +++ b/hw/scsi/megasas.c
> @@ -2451,6 +2451,7 @@ typedef struct MegasasInfo {
>       int osts;
>       const VMStateDescription *vmsd;
>       Property *props;
> +    InterfaceInfo *interfaces;
>   } MegasasInfo;
>   
>   static struct MegasasInfo megasas_devices[] = {
> @@ -2480,6 +2481,10 @@ static struct MegasasInfo megasas_devices[] = {
>           .is_express = true,
>           .vmsd = &vmstate_megasas_gen2,
>           .props = megasas_properties_gen2,
> +        .interfaces = (InterfaceInfo[]) {
> +            { INTERFACE_PCIE_DEVICE },
> +            { }
> +        },
>       }
>   };
>   
> @@ -2531,6 +2536,7 @@ static void megasas_register_types(void)
>           type_info.parent = TYPE_MEGASAS_BASE;
>           type_info.class_data = (void *)info;
>           type_info.class_init = megasas_class_init;
> +        type_info.interfaces = info->interfaces;
>   
>           type_register(&type_info);
>       }
> 

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
  2017-09-27 19:56   ` Eduardo Habkost
                     ` (3 preceding siblings ...)
  (?)
@ 2017-09-28  9:35   ` Marcel Apfelbaum
  -1 siblings, 0 replies; 37+ messages in thread
From: Marcel Apfelbaum @ 2017-09-28  9:35 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin, Igor Mammedov, Gerd Hoffmann, Paolo Bonzini,
	Richard Henderson, Stefano Stabellini, Anthony Perard, John Snow,
	Alberto Garcia, Aurelien Jarno, Yongbok Kim, Jiri Slaby,
	Alexander Graf, Jason Wang, Jiri Pirko, Hervé Poussineau,
	Peter Maydell, David Gibson, Hannes Reinecke, Mark Cave-Ayland,
	Artyom Tarasenko, xen-devel, qemu-block, qemu-ppc, qemu-arm

On 27/09/2017 22:56, Eduardo Habkost wrote:
> Add INTERFACE_CONVENTIONAL_PCI_DEVICE to all direct subtypes of
> TYPE_PCI_DEVICE, except:
> 
> 1) The ones that already have INTERFACE_PCIE_DEVICE set:
> 
> * base-xhci
> * e1000e
> * nvme
> * pvscsi
> * vfio-pci
> * virtio-pci
> * vmxnet3
> 
> 2) base-pci-bridge
> 
> Not all PCI bridges are Conventional PCI devices, so
> INTERFACE_CONVENTIONAL_PCI_DEVICE is added only to the subtypes
> that are actually Conventional PCI:
> 
> * dec-21154-p2p-bridge
> * i82801b11-bridge
> * pbm-bridge
> * pci-bridge
> 
> The direct subtypes of base-pci-bridge not touched by this patch
> are:
> 
> * xilinx-pcie-root: Already marked as PCIe-only.
> * pcie-pci-bridge: Already marked as PCIe-only.
> * pcie-port: all non-abstract subtypes of pcie-port are already
>    marked as PCIe-only devices.
> 
> 3) megasas-base
> 
> Not all megasas devices are Conventional PCI devices, so the
> interface names are added to the subclasses registered by
> megasas_register_types(), according to information in the
> megasas_devices[] array.
> 
> "megasas-gen2" already implements INTERFACE_PCIE_DEVICE, so add
> INTERFACE_CONVENTIONAL_PCI_DEVICE only to "megasas".
> 
> Acked-by: Alberto Garcia <berto@igalia.com>
> Acked-by: John Snow <jsnow@redhat.com>
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes v1 -> v2:
> * s/legacy/conventional/
>    * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> * Note about pcie-pci-bridge on commit message.
> * New devices: sungem, sunhme
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: John Snow <jsnow@redhat.com>
> Cc: Alberto Garcia <berto@igalia.com>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Yongbok Kim <yongbok.kim@imgtec.com>
> Cc: Jiri Slaby <jslaby@suse.cz>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: Marcel Apfelbaum <marcel@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: Jiri Pirko <jiri@resnulli.us>
> Cc: "Hervé Poussineau" <hpoussin@reactos.org>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Hannes Reinecke <hare@suse.com>
> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Cc: Artyom Tarasenko <atar4qemu@gmail.com>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: qemu-devel@nongnu.org
> Cc: xen-devel@lists.xenproject.org
> Cc: qemu-block@nongnu.org
> Cc: qemu-ppc@nongnu.org
> Cc: qemu-arm@nongnu.org
> ---
>   hw/acpi/piix4.c                     |  1 +
>   hw/audio/ac97.c                     |  4 ++++
>   hw/audio/es1370.c                   |  4 ++++
>   hw/audio/intel-hda.c                |  4 ++++
>   hw/char/serial-pci.c                | 12 ++++++++++++
>   hw/display/cirrus_vga.c             |  4 ++++
>   hw/display/qxl.c                    |  4 ++++
>   hw/display/sm501.c                  |  4 ++++
>   hw/display/vga-pci.c                |  4 ++++
>   hw/display/vmware_vga.c             |  4 ++++
>   hw/i2c/smbus_ich9.c                 |  4 ++++
>   hw/i386/amd_iommu.c                 |  4 ++++
>   hw/i386/kvm/pci-assign.c            |  4 ++++
>   hw/i386/pc_piix.c                   |  4 ++++
>   hw/i386/xen/xen_platform.c          |  4 ++++
>   hw/i386/xen/xen_pvdevice.c          |  4 ++++
>   hw/ide/ich.c                        |  4 ++++
>   hw/ide/pci.c                        |  4 ++++
>   hw/ipack/tpci200.c                  |  4 ++++
>   hw/isa/i82378.c                     |  4 ++++
>   hw/isa/lpc_ich9.c                   |  1 +
>   hw/isa/piix4.c                      |  4 ++++
>   hw/isa/vt82c686.c                   | 16 ++++++++++++++++
>   hw/mips/gt64xxx_pci.c               |  4 ++++
>   hw/misc/edu.c                       |  5 +++++
>   hw/misc/ivshmem.c                   |  4 ++++
>   hw/misc/macio/macio.c               |  4 ++++
>   hw/misc/pci-testdev.c               |  4 ++++
>   hw/net/e1000.c                      |  4 ++++
>   hw/net/eepro100.c                   |  4 ++++
>   hw/net/ne2000.c                     |  4 ++++
>   hw/net/pcnet-pci.c                  |  4 ++++
>   hw/net/rocker/rocker.c              |  4 ++++
>   hw/net/rtl8139.c                    |  4 ++++
>   hw/net/sungem.c                     |  4 ++++
>   hw/net/sunhme.c                     |  4 ++++
>   hw/pci-bridge/dec.c                 |  8 ++++++++
>   hw/pci-bridge/i82801b11.c           |  4 ++++
>   hw/pci-bridge/pci_bridge_dev.c      |  1 +
>   hw/pci-bridge/pci_expander_bridge.c |  8 ++++++++
>   hw/pci-host/apb.c                   |  8 ++++++++
>   hw/pci-host/bonito.c                |  4 ++++
>   hw/pci-host/gpex.c                  |  4 ++++
>   hw/pci-host/grackle.c               |  4 ++++
>   hw/pci-host/piix.c                  |  8 ++++++++
>   hw/pci-host/ppce500.c               |  4 ++++
>   hw/pci-host/prep.c                  |  4 ++++
>   hw/pci-host/q35.c                   |  4 ++++
>   hw/pci-host/uninorth.c              | 16 ++++++++++++++++
>   hw/pci-host/versatile.c             |  4 ++++
>   hw/ppc/ppc4xx_pci.c                 |  4 ++++
>   hw/scsi/esp-pci.c                   |  4 ++++
>   hw/scsi/lsi53c895a.c                |  4 ++++
>   hw/scsi/megasas.c                   |  4 ++++
>   hw/scsi/mptsas.c                    |  4 ++++
>   hw/sd/sdhci.c                       |  4 ++++
>   hw/sh4/sh_pci.c                     |  4 ++++
>   hw/sparc64/sun4u.c                  |  4 ++++
>   hw/usb/hcd-ehci-pci.c               |  4 ++++
>   hw/usb/hcd-ohci.c                   |  4 ++++
>   hw/usb/hcd-uhci.c                   |  4 ++++
>   hw/vfio/pci-quirks.c                |  4 ++++
>   hw/watchdog/wdt_i6300esb.c          |  4 ++++
>   hw/xen/xen_pt.c                     |  4 ++++
>   64 files changed, 296 insertions(+)
> 
> diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
> index f4fd5907b8..a0fb1ce037 100644
> --- a/hw/acpi/piix4.c
> +++ b/hw/acpi/piix4.c
> @@ -718,6 +718,7 @@ static const TypeInfo piix4_pm_info = {
>       .interfaces = (InterfaceInfo[]) {
>           { TYPE_HOTPLUG_HANDLER },
>           { TYPE_ACPI_DEVICE_IF },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>           { }
>       }
>   };
> diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
> index 959c786261..337402e9c6 100644
> --- a/hw/audio/ac97.c
> +++ b/hw/audio/ac97.c
> @@ -1431,6 +1431,10 @@ static const TypeInfo ac97_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof (AC97LinkState),
>       .class_init    = ac97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ac97_register_types (void)
> diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
> index dd7c23d185..59cf252754 100644
> --- a/hw/audio/es1370.c
> +++ b/hw/audio/es1370.c
> @@ -1082,6 +1082,10 @@ static const TypeInfo es1370_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof (ES1370State),
>       .class_init    = es1370_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void es1370_register_types (void)
> diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
> index 18a50a8f83..a3e670c188 100644
> --- a/hw/audio/intel-hda.c
> +++ b/hw/audio/intel-hda.c
> @@ -1263,6 +1263,10 @@ static const TypeInfo intel_hda_info = {
>       .instance_size = sizeof(IntelHDAState),
>       .class_init    = intel_hda_class_init,
>       .abstract      = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const TypeInfo intel_hda_info_ich6 = {
> diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
> index 303104dd19..cb0d04c1d9 100644
> --- a/hw/char/serial-pci.c
> +++ b/hw/char/serial-pci.c
> @@ -250,6 +250,10 @@ static const TypeInfo serial_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCISerialState),
>       .class_init    = serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const TypeInfo multi_2x_serial_pci_info = {
> @@ -257,6 +261,10 @@ static const TypeInfo multi_2x_serial_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIMultiSerialState),
>       .class_init    = multi_2x_serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const TypeInfo multi_4x_serial_pci_info = {
> @@ -264,6 +272,10 @@ static const TypeInfo multi_4x_serial_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIMultiSerialState),
>       .class_init    = multi_4x_serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void serial_pci_register_types(void)
> diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
> index afc290ab91..b4d579857a 100644
> --- a/hw/display/cirrus_vga.c
> +++ b/hw/display/cirrus_vga.c
> @@ -3162,6 +3162,10 @@ static const TypeInfo cirrus_vga_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCICirrusVGAState),
>       .class_init    = cirrus_vga_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void cirrus_vga_register_types(void)
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index ae3677fd1e..b20e259122 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -2430,6 +2430,10 @@ static const TypeInfo qxl_pci_type_info = {
>       .instance_size = sizeof(PCIQXLDevice),
>       .abstract = true,
>       .class_init = qxl_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void qxl_primary_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index 9aa515b3da..6eddac911e 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -1843,6 +1843,10 @@ static const TypeInfo sm501_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(SM501PCIState),
>       .class_init    = sm501_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void sm501_register_types(void)
> diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
> index ac9a76499e..7adb89fcb4 100644
> --- a/hw/display/vga-pci.c
> +++ b/hw/display/vga-pci.c
> @@ -338,6 +338,10 @@ static const TypeInfo vga_pci_type_info = {
>       .instance_size = sizeof(PCIVGAState),
>       .abstract = true,
>       .class_init = vga_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void vga_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
> index 4a64b41259..cdc3fed6ca 100644
> --- a/hw/display/vmware_vga.c
> +++ b/hw/display/vmware_vga.c
> @@ -1350,6 +1350,10 @@ static const TypeInfo vmsvga_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(struct pci_vmsvga_state_s),
>       .class_init    = vmsvga_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void vmsvga_register_types(void)
> diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
> index ea51e09186..e47556c9d8 100644
> --- a/hw/i2c/smbus_ich9.c
> +++ b/hw/i2c/smbus_ich9.c
> @@ -119,6 +119,10 @@ static const TypeInfo ich9_smb_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(ICH9SMBState),
>       .class_init = ich9_smb_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ich9_smb_register(void)
> diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
> index 334938a280..ad8155ca4c 100644
> --- a/hw/i386/amd_iommu.c
> +++ b/hw/i386/amd_iommu.c
> @@ -1227,6 +1227,10 @@ static const TypeInfo amdviPCI = {
>       .name = "AMDVI-PCI",
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(AMDVIPCIState),
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void amdvi_iommu_memory_region_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
> index 33e20cb3e8..d8559d8342 100644
> --- a/hw/i386/kvm/pci-assign.c
> +++ b/hw/i386/kvm/pci-assign.c
> @@ -1864,6 +1864,10 @@ static const TypeInfo assign_info = {
>       .instance_size      = sizeof(AssignedDevice),
>       .class_init         = assign_class_init,
>       .instance_init      = assigned_dev_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void assign_register_types(void)
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 9ff79b1fd9..1a56465490 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -1055,6 +1055,10 @@ static TypeInfo isa_bridge_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = isa_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pt_graphics_register_types(void)
> diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
> index 9ba7474566..056b87de0b 100644
> --- a/hw/i386/xen/xen_platform.c
> +++ b/hw/i386/xen/xen_platform.c
> @@ -517,6 +517,10 @@ static const TypeInfo xen_platform_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIXenPlatformState),
>       .class_init    = xen_platform_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void xen_platform_register_types(void)
> diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c
> index c093b34458..f748823658 100644
> --- a/hw/i386/xen/xen_pvdevice.c
> +++ b/hw/i386/xen/xen_pvdevice.c
> @@ -127,6 +127,10 @@ static const TypeInfo xen_pv_type_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(XenPVDevice),
>       .class_init    = xen_pv_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void xen_pv_register_types(void)
> diff --git a/hw/ide/ich.c b/hw/ide/ich.c
> index 9472a60cab..8dd0ced6b3 100644
> --- a/hw/ide/ich.c
> +++ b/hw/ide/ich.c
> @@ -184,6 +184,10 @@ static const TypeInfo ich_ahci_info = {
>       .instance_size = sizeof(AHCIPCIState),
>       .instance_init = pci_ich9_ahci_init,
>       .class_init    = ich_ahci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ich_ahci_register_types(void)
> diff --git a/hw/ide/pci.c b/hw/ide/pci.c
> index f2dcc0ed77..053c0375c1 100644
> --- a/hw/ide/pci.c
> +++ b/hw/ide/pci.c
> @@ -451,6 +451,10 @@ static const TypeInfo pci_ide_type_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIIDEState),
>       .abstract = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_ide_register_types(void)
> diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c
> index 4dfa6b33f3..da05c8589d 100644
> --- a/hw/ipack/tpci200.c
> +++ b/hw/ipack/tpci200.c
> @@ -646,6 +646,10 @@ static const TypeInfo tpci200_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(TPCI200State),
>       .class_init    = tpci200_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void tpci200_register_types(void)
> diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
> index 4d29a9900c..d20ea4c2ee 100644
> --- a/hw/isa/i82378.c
> +++ b/hw/isa/i82378.c
> @@ -138,6 +138,10 @@ static const TypeInfo i82378_type_info = {
>       .instance_size = sizeof(I82378State),
>       .instance_init = i82378_init,
>       .class_init = i82378_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void i82378_register_types(void)
> diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
> index ac8416d42b..39f56ba44e 100644
> --- a/hw/isa/lpc_ich9.c
> +++ b/hw/isa/lpc_ich9.c
> @@ -823,6 +823,7 @@ static const TypeInfo ich9_lpc_info = {
>       .interfaces = (InterfaceInfo[]) {
>           { TYPE_HOTPLUG_HANDLER },
>           { TYPE_ACPI_DEVICE_IF },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>           { }
>       }
>   };
> diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
> index f811eba59d..6b8bc3faf0 100644
> --- a/hw/isa/piix4.c
> +++ b/hw/isa/piix4.c
> @@ -132,6 +132,10 @@ static const TypeInfo piix4_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PIIX4State),
>       .class_init    = piix4_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void piix4_register_types(void)
> diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
> index 50dc83df77..c129985e2a 100644
> --- a/hw/isa/vt82c686.c
> +++ b/hw/isa/vt82c686.c
> @@ -301,6 +301,10 @@ static const TypeInfo via_ac97_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(VT686AC97State),
>       .class_init    = via_ac97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void vt82c686b_mc97_realize(PCIDevice *dev, Error **errp)
> @@ -341,6 +345,10 @@ static const TypeInfo via_mc97_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(VT686MC97State),
>       .class_init    = via_mc97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   /* vt82c686 pm init */
> @@ -419,6 +427,10 @@ static const TypeInfo via_pm_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(VT686PMState),
>       .class_init    = via_pm_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const VMStateDescription vmstate_via = {
> @@ -502,6 +514,10 @@ static const TypeInfo via_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(VT82C686BState),
>       .class_init    = via_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void vt82c686b_register_types(void)
> diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c
> index e8b2eef688..5a9dad9aae 100644
> --- a/hw/mips/gt64xxx_pci.c
> +++ b/hw/mips/gt64xxx_pci.c
> @@ -1232,6 +1232,10 @@ static const TypeInfo gt64120_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = gt64120_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void gt64120_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/misc/edu.c b/hw/misc/edu.c
> index 01acacf142..34eb05d213 100644
> --- a/hw/misc/edu.c
> +++ b/hw/misc/edu.c
> @@ -408,12 +408,17 @@ static void edu_class_init(ObjectClass *class, void *data)
>   
>   static void pci_edu_register_types(void)
>   {
> +    static InterfaceInfo interfaces[] = {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    };
>       static const TypeInfo edu_info = {
>           .name          = "edu",
>           .parent        = TYPE_PCI_DEVICE,
>           .instance_size = sizeof(EduState),
>           .instance_init = edu_instance_init,
>           .class_init    = edu_class_init,
> +        .interfaces = interfaces,
>       };
>   
>       type_register_static(&edu_info);
> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
> index b3ef3ec1e3..a5a46827fe 100644
> --- a/hw/misc/ivshmem.c
> +++ b/hw/misc/ivshmem.c
> @@ -1010,6 +1010,10 @@ static const TypeInfo ivshmem_common_info = {
>       .instance_size = sizeof(IVShmemState),
>       .abstract      = true,
>       .class_init    = ivshmem_common_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const VMStateDescription ivshmem_plain_vmsd = {
> diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
> index 5d57f45dc6..298e65071c 100644
> --- a/hw/misc/macio/macio.c
> +++ b/hw/misc/macio/macio.c
> @@ -415,6 +415,10 @@ static const TypeInfo macio_type_info = {
>       .instance_init = macio_instance_init,
>       .abstract      = true,
>       .class_init    = macio_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void macio_register_types(void)
> diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
> index 7d5990213e..32041f535f 100644
> --- a/hw/misc/pci-testdev.c
> +++ b/hw/misc/pci-testdev.c
> @@ -326,6 +326,10 @@ static const TypeInfo pci_testdev_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCITestDevState),
>       .class_init    = pci_testdev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_testdev_register_types(void)
> diff --git a/hw/net/e1000.c b/hw/net/e1000.c
> index eebe3a9c13..acdb935af5 100644
> --- a/hw/net/e1000.c
> +++ b/hw/net/e1000.c
> @@ -1685,6 +1685,10 @@ static const TypeInfo e1000_base_info = {
>       .instance_init = e1000_instance_init,
>       .class_size    = sizeof(E1000BaseClass),
>       .abstract      = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const E1000Info e1000_devices[] = {
> diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
> index a7b9f77519..80b8f47c4b 100644
> --- a/hw/net/eepro100.c
> +++ b/hw/net/eepro100.c
> @@ -2116,6 +2116,10 @@ static void eepro100_register_types(void)
>           type_info.class_init = eepro100_class_init;
>           type_info.instance_size = sizeof(EEPRO100State);
>           type_info.instance_init = eepro100_instance_init;
> +        type_info.interfaces = (InterfaceInfo[]) {
> +            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +            { },
> +        };
>   
>           type_register(&type_info);
>       }
> diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
> index 798d681e25..3938e6ddd8 100644
> --- a/hw/net/ne2000.c
> +++ b/hw/net/ne2000.c
> @@ -786,6 +786,10 @@ static const TypeInfo ne2000_info = {
>       .instance_size = sizeof(PCINE2000State),
>       .class_init    = ne2000_class_init,
>       .instance_init = ne2000_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ne2000_register_types(void)
> diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
> index 0acf8a4879..0ae5ca4701 100644
> --- a/hw/net/pcnet-pci.c
> +++ b/hw/net/pcnet-pci.c
> @@ -365,6 +365,10 @@ static const TypeInfo pcnet_info = {
>       .instance_size = sizeof(PCIPCNetState),
>       .class_init    = pcnet_class_init,
>       .instance_init = pcnet_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_pcnet_register_types(void)
> diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
> index 9273473d59..823a29df03 100644
> --- a/hw/net/rocker/rocker.c
> +++ b/hw/net/rocker/rocker.c
> @@ -1525,6 +1525,10 @@ static const TypeInfo rocker_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(Rocker),
>       .class_init    = rocker_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void rocker_register_types(void)
> diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
> index 3be24bbee7..bef0464b2e 100644
> --- a/hw/net/rtl8139.c
> +++ b/hw/net/rtl8139.c
> @@ -3442,6 +3442,10 @@ static const TypeInfo rtl8139_info = {
>       .instance_size = sizeof(RTL8139State),
>       .class_init    = rtl8139_class_init,
>       .instance_init = rtl8139_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void rtl8139_register_types(void)
> diff --git a/hw/net/sungem.c b/hw/net/sungem.c
> index dffa0c90f3..6aa8d1117b 100644
> --- a/hw/net/sungem.c
> +++ b/hw/net/sungem.c
> @@ -1437,6 +1437,10 @@ static const TypeInfo sungem_info = {
>       .instance_size = sizeof(SunGEMState),
>       .class_init    = sungem_class_init,
>       .instance_init = sungem_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    }
>   };
>   
>   static void sungem_register_types(void)
> diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c
> index 60277adcf1..b1efa1b88d 100644
> --- a/hw/net/sunhme.c
> +++ b/hw/net/sunhme.c
> @@ -968,6 +968,10 @@ static const TypeInfo sunhme_info = {
>       .class_init    = sunhme_class_init,
>       .instance_size = sizeof(SunHMEState),
>       .instance_init = sunhme_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    }
>   };
>   
>   static void sunhme_register_types(void)
> diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
> index eb275e1a25..84492d5e5f 100644
> --- a/hw/pci-bridge/dec.c
> +++ b/hw/pci-bridge/dec.c
> @@ -79,6 +79,10 @@ static const TypeInfo dec_21154_pci_bridge_info = {
>       .parent        = TYPE_PCI_BRIDGE,
>       .instance_size = sizeof(PCIBridge),
>       .class_init    = dec_21154_pci_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
> @@ -138,6 +142,10 @@ static const TypeInfo dec_21154_pci_host_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = dec_21154_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
> index 2c1b747b4b..cb522bf30c 100644
> --- a/hw/pci-bridge/i82801b11.c
> +++ b/hw/pci-bridge/i82801b11.c
> @@ -106,6 +106,10 @@ static const TypeInfo i82801b11_bridge_info = {
>       .parent        = TYPE_PCI_BRIDGE,
>       .instance_size = sizeof(I82801b11Bridge),
>       .class_init    = i82801b11_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void d2pbr_register(void)
> diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
> index 4373f1d3e2..d56f6638c2 100644
> --- a/hw/pci-bridge/pci_bridge_dev.c
> +++ b/hw/pci-bridge/pci_bridge_dev.c
> @@ -238,6 +238,7 @@ static const TypeInfo pci_bridge_dev_info = {
>       .instance_finalize = pci_bridge_dev_instance_finalize,
>       .interfaces = (InterfaceInfo[]) {
>           { TYPE_HOTPLUG_HANDLER },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>           { }
>       }
>   };
> diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
> index ff59abf208..8c8ac737ad 100644
> --- a/hw/pci-bridge/pci_expander_bridge.c
> +++ b/hw/pci-bridge/pci_expander_bridge.c
> @@ -316,6 +316,10 @@ static const TypeInfo pxb_dev_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PXBDev),
>       .class_init    = pxb_dev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pxb_pcie_dev_realize(PCIDevice *dev, Error **errp)
> @@ -350,6 +354,10 @@ static const TypeInfo pxb_pcie_dev_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PXBDev),
>       .class_init    = pxb_pcie_dev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pxb_register_types(void)
> diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
> index b709456b97..1edf57f600 100644
> --- a/hw/pci-host/apb.c
> +++ b/hw/pci-host/apb.c
> @@ -836,6 +836,10 @@ static const TypeInfo pbm_pci_host_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = pbm_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pbm_host_class_init(ObjectClass *klass, void *data)
> @@ -883,6 +887,10 @@ static const TypeInfo pbm_pci_bridge_info = {
>       .parent        = TYPE_PCI_BRIDGE,
>       .class_init    = pbm_pci_bridge_class_init,
>       .instance_size = sizeof(PBMPCIBridge),
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pbm_iommu_memory_region_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
> index 89133a9dd3..9f61e27edc 100644
> --- a/hw/pci-host/bonito.c
> +++ b/hw/pci-host/bonito.c
> @@ -833,6 +833,10 @@ static const TypeInfo bonito_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIBonitoState),
>       .class_init    = bonito_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void bonito_pcihost_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
> index be25245219..4090793cf0 100644
> --- a/hw/pci-host/gpex.c
> +++ b/hw/pci-host/gpex.c
> @@ -166,6 +166,10 @@ static const TypeInfo gpex_root_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(GPEXRootState),
>       .class_init = gpex_root_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void gpex_register(void)
> diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c
> index 2e281f6155..38cd279b6b 100644
> --- a/hw/pci-host/grackle.c
> +++ b/hw/pci-host/grackle.c
> @@ -142,6 +142,10 @@ static const TypeInfo grackle_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = grackle_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_grackle_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
> index 894e131c00..2b8d90a853 100644
> --- a/hw/pci-host/piix.c
> +++ b/hw/pci-host/piix.c
> @@ -694,6 +694,10 @@ static const TypeInfo piix3_pci_type_info = {
>       .instance_size = sizeof(PIIX3State),
>       .abstract = true,
>       .class_init = pci_piix3_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void piix3_class_init(ObjectClass *klass, void *data)
> @@ -748,6 +752,10 @@ static const TypeInfo i440fx_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCII440FXState),
>       .class_init    = i440fx_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   /* IGD Passthrough Host Bridge. */
> diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
> index becc0eeb76..39cd24464d 100644
> --- a/hw/pci-host/ppce500.c
> +++ b/hw/pci-host/ppce500.c
> @@ -516,6 +516,10 @@ static const TypeInfo e500_host_bridge_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PPCE500PCIBridgeState),
>       .class_init    = e500_host_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static Property pcihost_properties[] = {
> diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
> index 8b293ba0f1..92eed0f3e1 100644
> --- a/hw/pci-host/prep.c
> +++ b/hw/pci-host/prep.c
> @@ -372,6 +372,10 @@ static const TypeInfo raven_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(RavenPCIState),
>       .class_init = raven_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static Property raven_pcihost_properties[] = {
> diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
> index 1ff648e80c..ddaa7d1b44 100644
> --- a/hw/pci-host/q35.c
> +++ b/hw/pci-host/q35.c
> @@ -591,6 +591,10 @@ static const TypeInfo mch_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(MCHPCIState),
>       .class_init = mch_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void q35_register(void)
> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
> index 6cf5e59f86..ea5c265718 100644
> --- a/hw/pci-host/uninorth.c
> +++ b/hw/pci-host/uninorth.c
> @@ -374,6 +374,10 @@ static const TypeInfo unin_main_pci_host_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = unin_main_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void u3_agp_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -398,6 +402,10 @@ static const TypeInfo u3_agp_pci_host_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = u3_agp_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void unin_agp_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -422,6 +430,10 @@ static const TypeInfo unin_agp_pci_host_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = unin_agp_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void unin_internal_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -446,6 +458,10 @@ static const TypeInfo unin_internal_pci_host_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = unin_internal_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_unin_main_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
> index aa1fdf75fd..6394a520fc 100644
> --- a/hw/pci-host/versatile.c
> +++ b/hw/pci-host/versatile.c
> @@ -487,6 +487,10 @@ static const TypeInfo versatile_pci_host_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = versatile_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static Property pci_vpb_properties[] = {
> diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
> index 6953f8b9ac..4765dcecca 100644
> --- a/hw/ppc/ppc4xx_pci.c
> +++ b/hw/ppc/ppc4xx_pci.c
> @@ -359,6 +359,10 @@ static const TypeInfo ppc4xx_host_bridge_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = ppc4xx_host_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ppc4xx_pcihost_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
> index e295d88939..419fc668ac 100644
> --- a/hw/scsi/esp-pci.c
> +++ b/hw/scsi/esp-pci.c
> @@ -398,6 +398,10 @@ static const TypeInfo esp_pci_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIESPState),
>       .class_init = esp_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   typedef struct {
> diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
> index 3e56ab267c..423a2848ea 100644
> --- a/hw/scsi/lsi53c895a.c
> +++ b/hw/scsi/lsi53c895a.c
> @@ -2244,6 +2244,10 @@ static const TypeInfo lsi_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(LSIState),
>       .class_init    = lsi_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void lsi53c810_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
> index 535ee267c3..d5eae6239a 100644
> --- a/hw/scsi/megasas.c
> +++ b/hw/scsi/megasas.c
> @@ -2468,6 +2468,10 @@ static struct MegasasInfo megasas_devices[] = {
>           .is_express = false,
>           .vmsd = &vmstate_megasas_gen1,
>           .props = megasas_properties_gen1,
> +        .interfaces = (InterfaceInfo[]) {
> +            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +            { },
> +        },
>       },{
>           .name = TYPE_MEGASAS_GEN2,
>           .desc = "LSI MegaRAID SAS 2108",
> diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
> index d05fa9f549..f6db1b0103 100644
> --- a/hw/scsi/mptsas.c
> +++ b/hw/scsi/mptsas.c
> @@ -1439,6 +1439,10 @@ static const TypeInfo mptsas_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(MPTSASState),
>       .class_init = mptsas1068_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void mptsas_register_types(void)
> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
> index 6d6a791ee9..b064a087c9 100644
> --- a/hw/sd/sdhci.c
> +++ b/hw/sd/sdhci.c
> @@ -1315,6 +1315,10 @@ static const TypeInfo sdhci_pci_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(SDHCIState),
>       .class_init = sdhci_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static Property sdhci_sysbus_properties[] = {
> diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c
> index 38395c082b..cbb01af57f 100644
> --- a/hw/sh4/sh_pci.c
> +++ b/hw/sh4/sh_pci.c
> @@ -179,6 +179,10 @@ static const TypeInfo sh_pci_host_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = sh_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void sh_pci_device_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index c3280aaf38..8282651aeb 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -275,6 +275,10 @@ static const TypeInfo ebus_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(EbusState),
>       .class_init    = ebus_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   #define TYPE_OPENPROM "openprom"
> diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
> index 6dedcb8989..8c0fc53a26 100644
> --- a/hw/usb/hcd-ehci-pci.c
> +++ b/hw/usb/hcd-ehci-pci.c
> @@ -170,6 +170,10 @@ static const TypeInfo ehci_pci_type_info = {
>       .instance_finalize = usb_ehci_pci_finalize,
>       .abstract = true,
>       .class_init = ehci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ehci_data_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
> index 267982e160..a31df67daa 100644
> --- a/hw/usb/hcd-ohci.c
> +++ b/hw/usb/hcd-ohci.c
> @@ -2139,6 +2139,10 @@ static const TypeInfo ohci_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(OHCIPCIState),
>       .class_init    = ohci_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static Property ohci_sysbus_properties[] = {
> diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
> index e3562a4c60..836b11f177 100644
> --- a/hw/usb/hcd-uhci.c
> +++ b/hw/usb/hcd-uhci.c
> @@ -1323,6 +1323,10 @@ static const TypeInfo uhci_pci_type_info = {
>       .class_size    = sizeof(UHCIPCIDeviceClass),
>       .abstract = true,
>       .class_init = uhci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void uhci_data_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
> index 349085ea12..2bd9d126d1 100644
> --- a/hw/vfio/pci-quirks.c
> +++ b/hw/vfio/pci-quirks.c
> @@ -1197,6 +1197,10 @@ static TypeInfo vfio_pci_igd_lpc_bridge_info = {
>       .name = "vfio-pci-igd-lpc-bridge",
>       .parent = TYPE_PCI_DEVICE,
>       .class_init = vfio_pci_igd_lpc_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void vfio_pci_igd_register_types(void)
> diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
> index 49b3cd188a..e596b0804d 100644
> --- a/hw/watchdog/wdt_i6300esb.c
> +++ b/hw/watchdog/wdt_i6300esb.c
> @@ -463,6 +463,10 @@ static const TypeInfo i6300esb_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(I6300State),
>       .class_init    = i6300esb_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void i6300esb_register_types(void)
> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
> index 375efa68f6..01df3414d3 100644
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
>       .instance_size = sizeof(XenPCIPassthroughState),
>       .instance_finalize = xen_pci_passthrough_finalize,
>       .class_init = xen_pci_passthrough_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void xen_pci_passthrough_register_types(void)
> 

For the PCI/x86 code:

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
  2017-09-27 19:56   ` Eduardo Habkost
                     ` (4 preceding siblings ...)
  (?)
@ 2017-09-28  9:35   ` Marcel Apfelbaum
  -1 siblings, 0 replies; 37+ messages in thread
From: Marcel Apfelbaum @ 2017-09-28  9:35 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	Gerd Hoffmann, David Gibson, Jiri Slaby, Hannes Reinecke,
	Stefano Stabellini, Alberto Garcia, qemu-block, Alexander Graf,
	Hervé Poussineau, Anthony Perard, xen-devel,
	Richard Henderson, Artyom Tarasenko, Jiri Pirko, Alex Williamson,
	qemu-arm, Laine Stump, Igor Mammedov, Yongbok Kim,
	Alistair Francis

On 27/09/2017 22:56, Eduardo Habkost wrote:
> Add INTERFACE_CONVENTIONAL_PCI_DEVICE to all direct subtypes of
> TYPE_PCI_DEVICE, except:
> 
> 1) The ones that already have INTERFACE_PCIE_DEVICE set:
> 
> * base-xhci
> * e1000e
> * nvme
> * pvscsi
> * vfio-pci
> * virtio-pci
> * vmxnet3
> 
> 2) base-pci-bridge
> 
> Not all PCI bridges are Conventional PCI devices, so
> INTERFACE_CONVENTIONAL_PCI_DEVICE is added only to the subtypes
> that are actually Conventional PCI:
> 
> * dec-21154-p2p-bridge
> * i82801b11-bridge
> * pbm-bridge
> * pci-bridge
> 
> The direct subtypes of base-pci-bridge not touched by this patch
> are:
> 
> * xilinx-pcie-root: Already marked as PCIe-only.
> * pcie-pci-bridge: Already marked as PCIe-only.
> * pcie-port: all non-abstract subtypes of pcie-port are already
>    marked as PCIe-only devices.
> 
> 3) megasas-base
> 
> Not all megasas devices are Conventional PCI devices, so the
> interface names are added to the subclasses registered by
> megasas_register_types(), according to information in the
> megasas_devices[] array.
> 
> "megasas-gen2" already implements INTERFACE_PCIE_DEVICE, so add
> INTERFACE_CONVENTIONAL_PCI_DEVICE only to "megasas".
> 
> Acked-by: Alberto Garcia <berto@igalia.com>
> Acked-by: John Snow <jsnow@redhat.com>
> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes v1 -> v2:
> * s/legacy/conventional/
>    * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> * Note about pcie-pci-bridge on commit message.
> * New devices: sungem, sunhme
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: John Snow <jsnow@redhat.com>
> Cc: Alberto Garcia <berto@igalia.com>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Cc: Yongbok Kim <yongbok.kim@imgtec.com>
> Cc: Jiri Slaby <jslaby@suse.cz>
> Cc: Alexander Graf <agraf@suse.de>
> Cc: Marcel Apfelbaum <marcel@redhat.com>
> Cc: Jason Wang <jasowang@redhat.com>
> Cc: Jiri Pirko <jiri@resnulli.us>
> Cc: "Hervé Poussineau" <hpoussin@reactos.org>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: David Gibson <david@gibson.dropbear.id.au>
> Cc: Hannes Reinecke <hare@suse.com>
> Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Cc: Artyom Tarasenko <atar4qemu@gmail.com>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: qemu-devel@nongnu.org
> Cc: xen-devel@lists.xenproject.org
> Cc: qemu-block@nongnu.org
> Cc: qemu-ppc@nongnu.org
> Cc: qemu-arm@nongnu.org
> ---
>   hw/acpi/piix4.c                     |  1 +
>   hw/audio/ac97.c                     |  4 ++++
>   hw/audio/es1370.c                   |  4 ++++
>   hw/audio/intel-hda.c                |  4 ++++
>   hw/char/serial-pci.c                | 12 ++++++++++++
>   hw/display/cirrus_vga.c             |  4 ++++
>   hw/display/qxl.c                    |  4 ++++
>   hw/display/sm501.c                  |  4 ++++
>   hw/display/vga-pci.c                |  4 ++++
>   hw/display/vmware_vga.c             |  4 ++++
>   hw/i2c/smbus_ich9.c                 |  4 ++++
>   hw/i386/amd_iommu.c                 |  4 ++++
>   hw/i386/kvm/pci-assign.c            |  4 ++++
>   hw/i386/pc_piix.c                   |  4 ++++
>   hw/i386/xen/xen_platform.c          |  4 ++++
>   hw/i386/xen/xen_pvdevice.c          |  4 ++++
>   hw/ide/ich.c                        |  4 ++++
>   hw/ide/pci.c                        |  4 ++++
>   hw/ipack/tpci200.c                  |  4 ++++
>   hw/isa/i82378.c                     |  4 ++++
>   hw/isa/lpc_ich9.c                   |  1 +
>   hw/isa/piix4.c                      |  4 ++++
>   hw/isa/vt82c686.c                   | 16 ++++++++++++++++
>   hw/mips/gt64xxx_pci.c               |  4 ++++
>   hw/misc/edu.c                       |  5 +++++
>   hw/misc/ivshmem.c                   |  4 ++++
>   hw/misc/macio/macio.c               |  4 ++++
>   hw/misc/pci-testdev.c               |  4 ++++
>   hw/net/e1000.c                      |  4 ++++
>   hw/net/eepro100.c                   |  4 ++++
>   hw/net/ne2000.c                     |  4 ++++
>   hw/net/pcnet-pci.c                  |  4 ++++
>   hw/net/rocker/rocker.c              |  4 ++++
>   hw/net/rtl8139.c                    |  4 ++++
>   hw/net/sungem.c                     |  4 ++++
>   hw/net/sunhme.c                     |  4 ++++
>   hw/pci-bridge/dec.c                 |  8 ++++++++
>   hw/pci-bridge/i82801b11.c           |  4 ++++
>   hw/pci-bridge/pci_bridge_dev.c      |  1 +
>   hw/pci-bridge/pci_expander_bridge.c |  8 ++++++++
>   hw/pci-host/apb.c                   |  8 ++++++++
>   hw/pci-host/bonito.c                |  4 ++++
>   hw/pci-host/gpex.c                  |  4 ++++
>   hw/pci-host/grackle.c               |  4 ++++
>   hw/pci-host/piix.c                  |  8 ++++++++
>   hw/pci-host/ppce500.c               |  4 ++++
>   hw/pci-host/prep.c                  |  4 ++++
>   hw/pci-host/q35.c                   |  4 ++++
>   hw/pci-host/uninorth.c              | 16 ++++++++++++++++
>   hw/pci-host/versatile.c             |  4 ++++
>   hw/ppc/ppc4xx_pci.c                 |  4 ++++
>   hw/scsi/esp-pci.c                   |  4 ++++
>   hw/scsi/lsi53c895a.c                |  4 ++++
>   hw/scsi/megasas.c                   |  4 ++++
>   hw/scsi/mptsas.c                    |  4 ++++
>   hw/sd/sdhci.c                       |  4 ++++
>   hw/sh4/sh_pci.c                     |  4 ++++
>   hw/sparc64/sun4u.c                  |  4 ++++
>   hw/usb/hcd-ehci-pci.c               |  4 ++++
>   hw/usb/hcd-ohci.c                   |  4 ++++
>   hw/usb/hcd-uhci.c                   |  4 ++++
>   hw/vfio/pci-quirks.c                |  4 ++++
>   hw/watchdog/wdt_i6300esb.c          |  4 ++++
>   hw/xen/xen_pt.c                     |  4 ++++
>   64 files changed, 296 insertions(+)
> 
> diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
> index f4fd5907b8..a0fb1ce037 100644
> --- a/hw/acpi/piix4.c
> +++ b/hw/acpi/piix4.c
> @@ -718,6 +718,7 @@ static const TypeInfo piix4_pm_info = {
>       .interfaces = (InterfaceInfo[]) {
>           { TYPE_HOTPLUG_HANDLER },
>           { TYPE_ACPI_DEVICE_IF },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>           { }
>       }
>   };
> diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c
> index 959c786261..337402e9c6 100644
> --- a/hw/audio/ac97.c
> +++ b/hw/audio/ac97.c
> @@ -1431,6 +1431,10 @@ static const TypeInfo ac97_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof (AC97LinkState),
>       .class_init    = ac97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ac97_register_types (void)
> diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
> index dd7c23d185..59cf252754 100644
> --- a/hw/audio/es1370.c
> +++ b/hw/audio/es1370.c
> @@ -1082,6 +1082,10 @@ static const TypeInfo es1370_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof (ES1370State),
>       .class_init    = es1370_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void es1370_register_types (void)
> diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
> index 18a50a8f83..a3e670c188 100644
> --- a/hw/audio/intel-hda.c
> +++ b/hw/audio/intel-hda.c
> @@ -1263,6 +1263,10 @@ static const TypeInfo intel_hda_info = {
>       .instance_size = sizeof(IntelHDAState),
>       .class_init    = intel_hda_class_init,
>       .abstract      = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const TypeInfo intel_hda_info_ich6 = {
> diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c
> index 303104dd19..cb0d04c1d9 100644
> --- a/hw/char/serial-pci.c
> +++ b/hw/char/serial-pci.c
> @@ -250,6 +250,10 @@ static const TypeInfo serial_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCISerialState),
>       .class_init    = serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const TypeInfo multi_2x_serial_pci_info = {
> @@ -257,6 +261,10 @@ static const TypeInfo multi_2x_serial_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIMultiSerialState),
>       .class_init    = multi_2x_serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const TypeInfo multi_4x_serial_pci_info = {
> @@ -264,6 +272,10 @@ static const TypeInfo multi_4x_serial_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIMultiSerialState),
>       .class_init    = multi_4x_serial_pci_class_initfn,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void serial_pci_register_types(void)
> diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
> index afc290ab91..b4d579857a 100644
> --- a/hw/display/cirrus_vga.c
> +++ b/hw/display/cirrus_vga.c
> @@ -3162,6 +3162,10 @@ static const TypeInfo cirrus_vga_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCICirrusVGAState),
>       .class_init    = cirrus_vga_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void cirrus_vga_register_types(void)
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index ae3677fd1e..b20e259122 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -2430,6 +2430,10 @@ static const TypeInfo qxl_pci_type_info = {
>       .instance_size = sizeof(PCIQXLDevice),
>       .abstract = true,
>       .class_init = qxl_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void qxl_primary_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index 9aa515b3da..6eddac911e 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -1843,6 +1843,10 @@ static const TypeInfo sm501_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(SM501PCIState),
>       .class_init    = sm501_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void sm501_register_types(void)
> diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
> index ac9a76499e..7adb89fcb4 100644
> --- a/hw/display/vga-pci.c
> +++ b/hw/display/vga-pci.c
> @@ -338,6 +338,10 @@ static const TypeInfo vga_pci_type_info = {
>       .instance_size = sizeof(PCIVGAState),
>       .abstract = true,
>       .class_init = vga_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void vga_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
> index 4a64b41259..cdc3fed6ca 100644
> --- a/hw/display/vmware_vga.c
> +++ b/hw/display/vmware_vga.c
> @@ -1350,6 +1350,10 @@ static const TypeInfo vmsvga_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(struct pci_vmsvga_state_s),
>       .class_init    = vmsvga_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void vmsvga_register_types(void)
> diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c
> index ea51e09186..e47556c9d8 100644
> --- a/hw/i2c/smbus_ich9.c
> +++ b/hw/i2c/smbus_ich9.c
> @@ -119,6 +119,10 @@ static const TypeInfo ich9_smb_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(ICH9SMBState),
>       .class_init = ich9_smb_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ich9_smb_register(void)
> diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
> index 334938a280..ad8155ca4c 100644
> --- a/hw/i386/amd_iommu.c
> +++ b/hw/i386/amd_iommu.c
> @@ -1227,6 +1227,10 @@ static const TypeInfo amdviPCI = {
>       .name = "AMDVI-PCI",
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(AMDVIPCIState),
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void amdvi_iommu_memory_region_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
> index 33e20cb3e8..d8559d8342 100644
> --- a/hw/i386/kvm/pci-assign.c
> +++ b/hw/i386/kvm/pci-assign.c
> @@ -1864,6 +1864,10 @@ static const TypeInfo assign_info = {
>       .instance_size      = sizeof(AssignedDevice),
>       .class_init         = assign_class_init,
>       .instance_init      = assigned_dev_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void assign_register_types(void)
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index 9ff79b1fd9..1a56465490 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -1055,6 +1055,10 @@ static TypeInfo isa_bridge_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = isa_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pt_graphics_register_types(void)
> diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
> index 9ba7474566..056b87de0b 100644
> --- a/hw/i386/xen/xen_platform.c
> +++ b/hw/i386/xen/xen_platform.c
> @@ -517,6 +517,10 @@ static const TypeInfo xen_platform_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIXenPlatformState),
>       .class_init    = xen_platform_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void xen_platform_register_types(void)
> diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c
> index c093b34458..f748823658 100644
> --- a/hw/i386/xen/xen_pvdevice.c
> +++ b/hw/i386/xen/xen_pvdevice.c
> @@ -127,6 +127,10 @@ static const TypeInfo xen_pv_type_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(XenPVDevice),
>       .class_init    = xen_pv_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void xen_pv_register_types(void)
> diff --git a/hw/ide/ich.c b/hw/ide/ich.c
> index 9472a60cab..8dd0ced6b3 100644
> --- a/hw/ide/ich.c
> +++ b/hw/ide/ich.c
> @@ -184,6 +184,10 @@ static const TypeInfo ich_ahci_info = {
>       .instance_size = sizeof(AHCIPCIState),
>       .instance_init = pci_ich9_ahci_init,
>       .class_init    = ich_ahci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ich_ahci_register_types(void)
> diff --git a/hw/ide/pci.c b/hw/ide/pci.c
> index f2dcc0ed77..053c0375c1 100644
> --- a/hw/ide/pci.c
> +++ b/hw/ide/pci.c
> @@ -451,6 +451,10 @@ static const TypeInfo pci_ide_type_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIIDEState),
>       .abstract = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_ide_register_types(void)
> diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c
> index 4dfa6b33f3..da05c8589d 100644
> --- a/hw/ipack/tpci200.c
> +++ b/hw/ipack/tpci200.c
> @@ -646,6 +646,10 @@ static const TypeInfo tpci200_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(TPCI200State),
>       .class_init    = tpci200_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void tpci200_register_types(void)
> diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
> index 4d29a9900c..d20ea4c2ee 100644
> --- a/hw/isa/i82378.c
> +++ b/hw/isa/i82378.c
> @@ -138,6 +138,10 @@ static const TypeInfo i82378_type_info = {
>       .instance_size = sizeof(I82378State),
>       .instance_init = i82378_init,
>       .class_init = i82378_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void i82378_register_types(void)
> diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
> index ac8416d42b..39f56ba44e 100644
> --- a/hw/isa/lpc_ich9.c
> +++ b/hw/isa/lpc_ich9.c
> @@ -823,6 +823,7 @@ static const TypeInfo ich9_lpc_info = {
>       .interfaces = (InterfaceInfo[]) {
>           { TYPE_HOTPLUG_HANDLER },
>           { TYPE_ACPI_DEVICE_IF },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>           { }
>       }
>   };
> diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
> index f811eba59d..6b8bc3faf0 100644
> --- a/hw/isa/piix4.c
> +++ b/hw/isa/piix4.c
> @@ -132,6 +132,10 @@ static const TypeInfo piix4_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PIIX4State),
>       .class_init    = piix4_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void piix4_register_types(void)
> diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
> index 50dc83df77..c129985e2a 100644
> --- a/hw/isa/vt82c686.c
> +++ b/hw/isa/vt82c686.c
> @@ -301,6 +301,10 @@ static const TypeInfo via_ac97_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(VT686AC97State),
>       .class_init    = via_ac97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void vt82c686b_mc97_realize(PCIDevice *dev, Error **errp)
> @@ -341,6 +345,10 @@ static const TypeInfo via_mc97_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(VT686MC97State),
>       .class_init    = via_mc97_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   /* vt82c686 pm init */
> @@ -419,6 +427,10 @@ static const TypeInfo via_pm_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(VT686PMState),
>       .class_init    = via_pm_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const VMStateDescription vmstate_via = {
> @@ -502,6 +514,10 @@ static const TypeInfo via_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(VT82C686BState),
>       .class_init    = via_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void vt82c686b_register_types(void)
> diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c
> index e8b2eef688..5a9dad9aae 100644
> --- a/hw/mips/gt64xxx_pci.c
> +++ b/hw/mips/gt64xxx_pci.c
> @@ -1232,6 +1232,10 @@ static const TypeInfo gt64120_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = gt64120_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void gt64120_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/misc/edu.c b/hw/misc/edu.c
> index 01acacf142..34eb05d213 100644
> --- a/hw/misc/edu.c
> +++ b/hw/misc/edu.c
> @@ -408,12 +408,17 @@ static void edu_class_init(ObjectClass *class, void *data)
>   
>   static void pci_edu_register_types(void)
>   {
> +    static InterfaceInfo interfaces[] = {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    };
>       static const TypeInfo edu_info = {
>           .name          = "edu",
>           .parent        = TYPE_PCI_DEVICE,
>           .instance_size = sizeof(EduState),
>           .instance_init = edu_instance_init,
>           .class_init    = edu_class_init,
> +        .interfaces = interfaces,
>       };
>   
>       type_register_static(&edu_info);
> diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
> index b3ef3ec1e3..a5a46827fe 100644
> --- a/hw/misc/ivshmem.c
> +++ b/hw/misc/ivshmem.c
> @@ -1010,6 +1010,10 @@ static const TypeInfo ivshmem_common_info = {
>       .instance_size = sizeof(IVShmemState),
>       .abstract      = true,
>       .class_init    = ivshmem_common_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const VMStateDescription ivshmem_plain_vmsd = {
> diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
> index 5d57f45dc6..298e65071c 100644
> --- a/hw/misc/macio/macio.c
> +++ b/hw/misc/macio/macio.c
> @@ -415,6 +415,10 @@ static const TypeInfo macio_type_info = {
>       .instance_init = macio_instance_init,
>       .abstract      = true,
>       .class_init    = macio_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void macio_register_types(void)
> diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c
> index 7d5990213e..32041f535f 100644
> --- a/hw/misc/pci-testdev.c
> +++ b/hw/misc/pci-testdev.c
> @@ -326,6 +326,10 @@ static const TypeInfo pci_testdev_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCITestDevState),
>       .class_init    = pci_testdev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_testdev_register_types(void)
> diff --git a/hw/net/e1000.c b/hw/net/e1000.c
> index eebe3a9c13..acdb935af5 100644
> --- a/hw/net/e1000.c
> +++ b/hw/net/e1000.c
> @@ -1685,6 +1685,10 @@ static const TypeInfo e1000_base_info = {
>       .instance_init = e1000_instance_init,
>       .class_size    = sizeof(E1000BaseClass),
>       .abstract      = true,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static const E1000Info e1000_devices[] = {
> diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
> index a7b9f77519..80b8f47c4b 100644
> --- a/hw/net/eepro100.c
> +++ b/hw/net/eepro100.c
> @@ -2116,6 +2116,10 @@ static void eepro100_register_types(void)
>           type_info.class_init = eepro100_class_init;
>           type_info.instance_size = sizeof(EEPRO100State);
>           type_info.instance_init = eepro100_instance_init;
> +        type_info.interfaces = (InterfaceInfo[]) {
> +            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +            { },
> +        };
>   
>           type_register(&type_info);
>       }
> diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
> index 798d681e25..3938e6ddd8 100644
> --- a/hw/net/ne2000.c
> +++ b/hw/net/ne2000.c
> @@ -786,6 +786,10 @@ static const TypeInfo ne2000_info = {
>       .instance_size = sizeof(PCINE2000State),
>       .class_init    = ne2000_class_init,
>       .instance_init = ne2000_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ne2000_register_types(void)
> diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c
> index 0acf8a4879..0ae5ca4701 100644
> --- a/hw/net/pcnet-pci.c
> +++ b/hw/net/pcnet-pci.c
> @@ -365,6 +365,10 @@ static const TypeInfo pcnet_info = {
>       .instance_size = sizeof(PCIPCNetState),
>       .class_init    = pcnet_class_init,
>       .instance_init = pcnet_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_pcnet_register_types(void)
> diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
> index 9273473d59..823a29df03 100644
> --- a/hw/net/rocker/rocker.c
> +++ b/hw/net/rocker/rocker.c
> @@ -1525,6 +1525,10 @@ static const TypeInfo rocker_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(Rocker),
>       .class_init    = rocker_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void rocker_register_types(void)
> diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
> index 3be24bbee7..bef0464b2e 100644
> --- a/hw/net/rtl8139.c
> +++ b/hw/net/rtl8139.c
> @@ -3442,6 +3442,10 @@ static const TypeInfo rtl8139_info = {
>       .instance_size = sizeof(RTL8139State),
>       .class_init    = rtl8139_class_init,
>       .instance_init = rtl8139_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void rtl8139_register_types(void)
> diff --git a/hw/net/sungem.c b/hw/net/sungem.c
> index dffa0c90f3..6aa8d1117b 100644
> --- a/hw/net/sungem.c
> +++ b/hw/net/sungem.c
> @@ -1437,6 +1437,10 @@ static const TypeInfo sungem_info = {
>       .instance_size = sizeof(SunGEMState),
>       .class_init    = sungem_class_init,
>       .instance_init = sungem_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    }
>   };
>   
>   static void sungem_register_types(void)
> diff --git a/hw/net/sunhme.c b/hw/net/sunhme.c
> index 60277adcf1..b1efa1b88d 100644
> --- a/hw/net/sunhme.c
> +++ b/hw/net/sunhme.c
> @@ -968,6 +968,10 @@ static const TypeInfo sunhme_info = {
>       .class_init    = sunhme_class_init,
>       .instance_size = sizeof(SunHMEState),
>       .instance_init = sunhme_instance_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { }
> +    }
>   };
>   
>   static void sunhme_register_types(void)
> diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c
> index eb275e1a25..84492d5e5f 100644
> --- a/hw/pci-bridge/dec.c
> +++ b/hw/pci-bridge/dec.c
> @@ -79,6 +79,10 @@ static const TypeInfo dec_21154_pci_bridge_info = {
>       .parent        = TYPE_PCI_BRIDGE,
>       .instance_size = sizeof(PCIBridge),
>       .class_init    = dec_21154_pci_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
> @@ -138,6 +142,10 @@ static const TypeInfo dec_21154_pci_host_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = dec_21154_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c
> index 2c1b747b4b..cb522bf30c 100644
> --- a/hw/pci-bridge/i82801b11.c
> +++ b/hw/pci-bridge/i82801b11.c
> @@ -106,6 +106,10 @@ static const TypeInfo i82801b11_bridge_info = {
>       .parent        = TYPE_PCI_BRIDGE,
>       .instance_size = sizeof(I82801b11Bridge),
>       .class_init    = i82801b11_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void d2pbr_register(void)
> diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c
> index 4373f1d3e2..d56f6638c2 100644
> --- a/hw/pci-bridge/pci_bridge_dev.c
> +++ b/hw/pci-bridge/pci_bridge_dev.c
> @@ -238,6 +238,7 @@ static const TypeInfo pci_bridge_dev_info = {
>       .instance_finalize = pci_bridge_dev_instance_finalize,
>       .interfaces = (InterfaceInfo[]) {
>           { TYPE_HOTPLUG_HANDLER },
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>           { }
>       }
>   };
> diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
> index ff59abf208..8c8ac737ad 100644
> --- a/hw/pci-bridge/pci_expander_bridge.c
> +++ b/hw/pci-bridge/pci_expander_bridge.c
> @@ -316,6 +316,10 @@ static const TypeInfo pxb_dev_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PXBDev),
>       .class_init    = pxb_dev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pxb_pcie_dev_realize(PCIDevice *dev, Error **errp)
> @@ -350,6 +354,10 @@ static const TypeInfo pxb_pcie_dev_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PXBDev),
>       .class_init    = pxb_pcie_dev_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pxb_register_types(void)
> diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
> index b709456b97..1edf57f600 100644
> --- a/hw/pci-host/apb.c
> +++ b/hw/pci-host/apb.c
> @@ -836,6 +836,10 @@ static const TypeInfo pbm_pci_host_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = pbm_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pbm_host_class_init(ObjectClass *klass, void *data)
> @@ -883,6 +887,10 @@ static const TypeInfo pbm_pci_bridge_info = {
>       .parent        = TYPE_PCI_BRIDGE,
>       .class_init    = pbm_pci_bridge_class_init,
>       .instance_size = sizeof(PBMPCIBridge),
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pbm_iommu_memory_region_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
> index 89133a9dd3..9f61e27edc 100644
> --- a/hw/pci-host/bonito.c
> +++ b/hw/pci-host/bonito.c
> @@ -833,6 +833,10 @@ static const TypeInfo bonito_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIBonitoState),
>       .class_init    = bonito_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void bonito_pcihost_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
> index be25245219..4090793cf0 100644
> --- a/hw/pci-host/gpex.c
> +++ b/hw/pci-host/gpex.c
> @@ -166,6 +166,10 @@ static const TypeInfo gpex_root_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(GPEXRootState),
>       .class_init = gpex_root_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void gpex_register(void)
> diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c
> index 2e281f6155..38cd279b6b 100644
> --- a/hw/pci-host/grackle.c
> +++ b/hw/pci-host/grackle.c
> @@ -142,6 +142,10 @@ static const TypeInfo grackle_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = grackle_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_grackle_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
> index 894e131c00..2b8d90a853 100644
> --- a/hw/pci-host/piix.c
> +++ b/hw/pci-host/piix.c
> @@ -694,6 +694,10 @@ static const TypeInfo piix3_pci_type_info = {
>       .instance_size = sizeof(PIIX3State),
>       .abstract = true,
>       .class_init = pci_piix3_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void piix3_class_init(ObjectClass *klass, void *data)
> @@ -748,6 +752,10 @@ static const TypeInfo i440fx_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCII440FXState),
>       .class_init    = i440fx_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   /* IGD Passthrough Host Bridge. */
> diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c
> index becc0eeb76..39cd24464d 100644
> --- a/hw/pci-host/ppce500.c
> +++ b/hw/pci-host/ppce500.c
> @@ -516,6 +516,10 @@ static const TypeInfo e500_host_bridge_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PPCE500PCIBridgeState),
>       .class_init    = e500_host_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static Property pcihost_properties[] = {
> diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c
> index 8b293ba0f1..92eed0f3e1 100644
> --- a/hw/pci-host/prep.c
> +++ b/hw/pci-host/prep.c
> @@ -372,6 +372,10 @@ static const TypeInfo raven_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(RavenPCIState),
>       .class_init = raven_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static Property raven_pcihost_properties[] = {
> diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
> index 1ff648e80c..ddaa7d1b44 100644
> --- a/hw/pci-host/q35.c
> +++ b/hw/pci-host/q35.c
> @@ -591,6 +591,10 @@ static const TypeInfo mch_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(MCHPCIState),
>       .class_init = mch_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void q35_register(void)
> diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c
> index 6cf5e59f86..ea5c265718 100644
> --- a/hw/pci-host/uninorth.c
> +++ b/hw/pci-host/uninorth.c
> @@ -374,6 +374,10 @@ static const TypeInfo unin_main_pci_host_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = unin_main_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void u3_agp_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -398,6 +402,10 @@ static const TypeInfo u3_agp_pci_host_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = u3_agp_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void unin_agp_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -422,6 +430,10 @@ static const TypeInfo unin_agp_pci_host_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = unin_agp_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void unin_internal_pci_host_class_init(ObjectClass *klass, void *data)
> @@ -446,6 +458,10 @@ static const TypeInfo unin_internal_pci_host_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init = unin_internal_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void pci_unin_main_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c
> index aa1fdf75fd..6394a520fc 100644
> --- a/hw/pci-host/versatile.c
> +++ b/hw/pci-host/versatile.c
> @@ -487,6 +487,10 @@ static const TypeInfo versatile_pci_host_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = versatile_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static Property pci_vpb_properties[] = {
> diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c
> index 6953f8b9ac..4765dcecca 100644
> --- a/hw/ppc/ppc4xx_pci.c
> +++ b/hw/ppc/ppc4xx_pci.c
> @@ -359,6 +359,10 @@ static const TypeInfo ppc4xx_host_bridge_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = ppc4xx_host_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ppc4xx_pcihost_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
> index e295d88939..419fc668ac 100644
> --- a/hw/scsi/esp-pci.c
> +++ b/hw/scsi/esp-pci.c
> @@ -398,6 +398,10 @@ static const TypeInfo esp_pci_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIESPState),
>       .class_init = esp_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   typedef struct {
> diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
> index 3e56ab267c..423a2848ea 100644
> --- a/hw/scsi/lsi53c895a.c
> +++ b/hw/scsi/lsi53c895a.c
> @@ -2244,6 +2244,10 @@ static const TypeInfo lsi_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(LSIState),
>       .class_init    = lsi_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void lsi53c810_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
> index 535ee267c3..d5eae6239a 100644
> --- a/hw/scsi/megasas.c
> +++ b/hw/scsi/megasas.c
> @@ -2468,6 +2468,10 @@ static struct MegasasInfo megasas_devices[] = {
>           .is_express = false,
>           .vmsd = &vmstate_megasas_gen1,
>           .props = megasas_properties_gen1,
> +        .interfaces = (InterfaceInfo[]) {
> +            { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +            { },
> +        },
>       },{
>           .name = TYPE_MEGASAS_GEN2,
>           .desc = "LSI MegaRAID SAS 2108",
> diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c
> index d05fa9f549..f6db1b0103 100644
> --- a/hw/scsi/mptsas.c
> +++ b/hw/scsi/mptsas.c
> @@ -1439,6 +1439,10 @@ static const TypeInfo mptsas_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(MPTSASState),
>       .class_init = mptsas1068_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void mptsas_register_types(void)
> diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
> index 6d6a791ee9..b064a087c9 100644
> --- a/hw/sd/sdhci.c
> +++ b/hw/sd/sdhci.c
> @@ -1315,6 +1315,10 @@ static const TypeInfo sdhci_pci_info = {
>       .parent = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(SDHCIState),
>       .class_init = sdhci_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static Property sdhci_sysbus_properties[] = {
> diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c
> index 38395c082b..cbb01af57f 100644
> --- a/hw/sh4/sh_pci.c
> +++ b/hw/sh4/sh_pci.c
> @@ -179,6 +179,10 @@ static const TypeInfo sh_pci_host_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(PCIDevice),
>       .class_init    = sh_pci_host_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void sh_pci_device_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
> index c3280aaf38..8282651aeb 100644
> --- a/hw/sparc64/sun4u.c
> +++ b/hw/sparc64/sun4u.c
> @@ -275,6 +275,10 @@ static const TypeInfo ebus_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(EbusState),
>       .class_init    = ebus_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   #define TYPE_OPENPROM "openprom"
> diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
> index 6dedcb8989..8c0fc53a26 100644
> --- a/hw/usb/hcd-ehci-pci.c
> +++ b/hw/usb/hcd-ehci-pci.c
> @@ -170,6 +170,10 @@ static const TypeInfo ehci_pci_type_info = {
>       .instance_finalize = usb_ehci_pci_finalize,
>       .abstract = true,
>       .class_init = ehci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void ehci_data_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
> index 267982e160..a31df67daa 100644
> --- a/hw/usb/hcd-ohci.c
> +++ b/hw/usb/hcd-ohci.c
> @@ -2139,6 +2139,10 @@ static const TypeInfo ohci_pci_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(OHCIPCIState),
>       .class_init    = ohci_pci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static Property ohci_sysbus_properties[] = {
> diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
> index e3562a4c60..836b11f177 100644
> --- a/hw/usb/hcd-uhci.c
> +++ b/hw/usb/hcd-uhci.c
> @@ -1323,6 +1323,10 @@ static const TypeInfo uhci_pci_type_info = {
>       .class_size    = sizeof(UHCIPCIDeviceClass),
>       .abstract = true,
>       .class_init = uhci_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void uhci_data_class_init(ObjectClass *klass, void *data)
> diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
> index 349085ea12..2bd9d126d1 100644
> --- a/hw/vfio/pci-quirks.c
> +++ b/hw/vfio/pci-quirks.c
> @@ -1197,6 +1197,10 @@ static TypeInfo vfio_pci_igd_lpc_bridge_info = {
>       .name = "vfio-pci-igd-lpc-bridge",
>       .parent = TYPE_PCI_DEVICE,
>       .class_init = vfio_pci_igd_lpc_bridge_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void vfio_pci_igd_register_types(void)
> diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
> index 49b3cd188a..e596b0804d 100644
> --- a/hw/watchdog/wdt_i6300esb.c
> +++ b/hw/watchdog/wdt_i6300esb.c
> @@ -463,6 +463,10 @@ static const TypeInfo i6300esb_info = {
>       .parent        = TYPE_PCI_DEVICE,
>       .instance_size = sizeof(I6300State),
>       .class_init    = i6300esb_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void i6300esb_register_types(void)
> diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
> index 375efa68f6..01df3414d3 100644
> --- a/hw/xen/xen_pt.c
> +++ b/hw/xen/xen_pt.c
> @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
>       .instance_size = sizeof(XenPCIPassthroughState),
>       .instance_finalize = xen_pci_passthrough_finalize,
>       .class_init = xen_pci_passthrough_class_init,
> +    .interfaces = (InterfaceInfo[]) {
> +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> +        { },
> +    },
>   };
>   
>   static void xen_pci_passthrough_register_types(void)
> 

For the PCI/x86 code:

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 5/5] pci: Validate interfaces on base_class_init
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 5/5] pci: Validate interfaces on base_class_init Eduardo Habkost
  2017-09-28  4:13   ` David Gibson
@ 2017-09-28  9:36   ` Marcel Apfelbaum
  1 sibling, 0 replies; 37+ messages in thread
From: Marcel Apfelbaum @ 2017-09-28  9:36 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin

On 27/09/2017 22:56, Eduardo Habkost wrote:
> Make sure we don't forget to add the Conventional PCI or PCI
> Express interface names on PCI device classes in the future.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes v1 -> v2:
> * s/legacy/conventional/
>    * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>   hw/pci/pci.c | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 1b08e18205..5ed3c8dca4 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -2547,6 +2547,17 @@ static void pci_device_class_init(ObjectClass *klass, void *data)
>       pc->realize = pci_default_realize;
>   }
>   
> +static void pci_device_class_base_init(ObjectClass *klass, void *data)
> +{
> +    if (!object_class_is_abstract(klass)) {
> +        ObjectClass *conventional =
> +            object_class_dynamic_cast(klass, INTERFACE_CONVENTIONAL_PCI_DEVICE);
> +        ObjectClass *pcie =
> +            object_class_dynamic_cast(klass, INTERFACE_PCIE_DEVICE);
> +        assert(conventional || pcie);
> +    }
> +}
> +
>   AddressSpace *pci_device_iommu_address_space(PCIDevice *dev)
>   {
>       PCIBus *bus = PCI_BUS(dev->bus);
> @@ -2671,6 +2682,7 @@ static const TypeInfo pci_device_type_info = {
>       .abstract = true,
>       .class_size = sizeof(PCIDeviceClass),
>       .class_init = pci_device_class_init,
> +    .class_base_init = pci_device_class_base_init,
>   };
>   
>   static void pci_register_types(void)
> 

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names
  2017-09-27 19:56 [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names Eduardo Habkost
                   ` (4 preceding siblings ...)
  2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 5/5] pci: Validate interfaces on base_class_init Eduardo Habkost
@ 2017-09-28  9:39 ` Marcel Apfelbaum
  2017-09-28 13:15   ` Eduardo Habkost
  5 siblings, 1 reply; 37+ messages in thread
From: Marcel Apfelbaum @ 2017-09-28  9:39 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel
  Cc: David Gibson, Alistair Francis, Laine Stump, Alex Williamson,
	Michael S. Tsirkin

On 27/09/2017 22:56, Eduardo Habkost wrote:
> Changes v1 -> v2:
> * Use "Conventional PCI" instead of "legacy PCI"
>    * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> * Mark base-xhci as hybrid too
>    * Reported-by: Marcel Apfelbaum <marcel@redhat.com>
> * Mark pcie-pci-bridge as PCI Express only
> * New Conventional PCI devices: sungem, sunhme
> 
> v1 was a reimplementation of one portion of an old RFC:
>    Subject: [RFC v2 00/20] qmp: Report bus information on
>             'query-machines'
> 
> This series marks each PCI device type as Conventional PCI, PCI
> Express, or "hybrid".  It uses two new QOM interface names to do
> that: INTERFACE_CONVENTIONAL_PCI_DEVICE
> ("conventional-pci-device") and INTERFACE_PCIE_DEVICE
> ("pci-express-device").  Conventional PCI devices will implement
> only the former; PCIe-only devices will implement only the
> latter; hybrid devices will implement both interfaces.
> 
> With this, management software will then be able to use
> qom-list-types to find out which PCI devices are
> conventional/express/hybrid.
> 
> In the future, the new interface names can be used in the
> bus/slot querying commands, to indicate which types of devices
> are accepted on each slot.
> 
> The last patch in the series adds an assertion to the PCI device
> class code, to ensure we won't forget to add the corresponding
> interface names to new PCI device classes.
> 

Hi Eduardo,

Now we need to get rid of the "is_express" field,
otherwise we have the same information on two places.

Thanks,
Marcel

> Eduardo Habkost (5):
>    pci: conventional-pci-device and pci-express-device interfaces
>    pci: Add interface names to hybrid PCI devices
>    pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices
>    pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
>    pci: Validate interfaces on base_class_init
> 
>   include/hw/pci/pci.h                |  6 ++++++
>   hw/acpi/piix4.c                     |  1 +
>   hw/audio/ac97.c                     |  4 ++++
>   hw/audio/es1370.c                   |  4 ++++
>   hw/audio/intel-hda.c                |  4 ++++
>   hw/block/nvme.c                     |  4 ++++
>   hw/char/serial-pci.c                | 12 ++++++++++++
>   hw/display/cirrus_vga.c             |  4 ++++
>   hw/display/qxl.c                    |  4 ++++
>   hw/display/sm501.c                  |  4 ++++
>   hw/display/vga-pci.c                |  4 ++++
>   hw/display/vmware_vga.c             |  4 ++++
>   hw/i2c/smbus_ich9.c                 |  4 ++++
>   hw/i386/amd_iommu.c                 |  4 ++++
>   hw/i386/kvm/pci-assign.c            |  4 ++++
>   hw/i386/pc_piix.c                   |  4 ++++
>   hw/i386/xen/xen_platform.c          |  4 ++++
>   hw/i386/xen/xen_pvdevice.c          |  4 ++++
>   hw/ide/ich.c                        |  4 ++++
>   hw/ide/pci.c                        |  4 ++++
>   hw/ipack/tpci200.c                  |  4 ++++
>   hw/isa/i82378.c                     |  4 ++++
>   hw/isa/lpc_ich9.c                   |  1 +
>   hw/isa/piix4.c                      |  4 ++++
>   hw/isa/vt82c686.c                   | 16 ++++++++++++++++
>   hw/mips/gt64xxx_pci.c               |  4 ++++
>   hw/misc/edu.c                       |  5 +++++
>   hw/misc/ivshmem.c                   |  4 ++++
>   hw/misc/macio/macio.c               |  4 ++++
>   hw/misc/pci-testdev.c               |  4 ++++
>   hw/net/e1000.c                      |  4 ++++
>   hw/net/e1000e.c                     |  4 ++++
>   hw/net/eepro100.c                   |  4 ++++
>   hw/net/ne2000.c                     |  4 ++++
>   hw/net/pcnet-pci.c                  |  4 ++++
>   hw/net/rocker/rocker.c              |  4 ++++
>   hw/net/rtl8139.c                    |  4 ++++
>   hw/net/sungem.c                     |  4 ++++
>   hw/net/sunhme.c                     |  4 ++++
>   hw/net/vmxnet3.c                    |  5 +++++
>   hw/pci-bridge/dec.c                 |  8 ++++++++
>   hw/pci-bridge/i82801b11.c           |  4 ++++
>   hw/pci-bridge/pci_bridge_dev.c      |  1 +
>   hw/pci-bridge/pci_expander_bridge.c |  8 ++++++++
>   hw/pci-bridge/pcie_pci_bridge.c     |  1 +
>   hw/pci-bridge/pcie_root_port.c      |  4 ++++
>   hw/pci-bridge/xio3130_downstream.c  |  4 ++++
>   hw/pci-bridge/xio3130_upstream.c    |  4 ++++
>   hw/pci-host/apb.c                   |  8 ++++++++
>   hw/pci-host/bonito.c                |  4 ++++
>   hw/pci-host/gpex.c                  |  4 ++++
>   hw/pci-host/grackle.c               |  4 ++++
>   hw/pci-host/piix.c                  |  8 ++++++++
>   hw/pci-host/ppce500.c               |  4 ++++
>   hw/pci-host/prep.c                  |  4 ++++
>   hw/pci-host/q35.c                   |  4 ++++
>   hw/pci-host/uninorth.c              | 16 ++++++++++++++++
>   hw/pci-host/versatile.c             |  4 ++++
>   hw/pci-host/xilinx-pcie.c           |  4 ++++
>   hw/pci/pci.c                        | 24 ++++++++++++++++++++++++
>   hw/ppc/ppc4xx_pci.c                 |  4 ++++
>   hw/scsi/esp-pci.c                   |  4 ++++
>   hw/scsi/lsi53c895a.c                |  4 ++++
>   hw/scsi/megasas.c                   | 10 ++++++++++
>   hw/scsi/mptsas.c                    |  4 ++++
>   hw/scsi/vmw_pvscsi.c                |  2 ++
>   hw/sd/sdhci.c                       |  4 ++++
>   hw/sh4/sh_pci.c                     |  4 ++++
>   hw/sparc64/sun4u.c                  |  4 ++++
>   hw/usb/hcd-ehci-pci.c               |  4 ++++
>   hw/usb/hcd-ohci.c                   |  4 ++++
>   hw/usb/hcd-uhci.c                   |  4 ++++
>   hw/usb/hcd-xhci.c                   |  5 +++++
>   hw/vfio/pci-quirks.c                |  4 ++++
>   hw/vfio/pci.c                       |  5 +++++
>   hw/virtio/virtio-pci.c              |  5 +++++
>   hw/watchdog/wdt_i6300esb.c          |  4 ++++
>   hw/xen/xen_pt.c                     |  4 ++++
>   78 files changed, 379 insertions(+)
> 

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/5] pci: Add interface names to hybrid PCI devices
  2017-09-28  4:08   ` David Gibson
  2017-09-28  9:27     ` Marcel Apfelbaum
@ 2017-09-28 13:06     ` Eduardo Habkost
  2017-09-29  0:35       ` David Gibson
  1 sibling, 1 reply; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-28 13:06 UTC (permalink / raw)
  To: David Gibson
  Cc: qemu-devel, David Gibson, Alistair Francis, Laine Stump,
	Alex Williamson, Michael S. Tsirkin, Marcel Apfelbaum,
	Dmitry Fleytman, Jason Wang, Paolo Bonzini, Gerd Hoffmann

On Thu, Sep 28, 2017 at 02:08:09PM +1000, David Gibson wrote:
> On Wed, Sep 27, 2017 at 04:56:32PM -0300, Eduardo Habkost wrote:
> > The following devices support both PCI Express and Conventional
> > PCI, by including special code to handle the QEMU_PCI_CAP_EXPRESS
> > flag and/or conditional pcie_endpoint_cap_init() calls:
> > 
> > * vfio-pci (is_express=1, but legacy PCI handled by
> >   vfio_populate_device())
> 
> In the case of VFIO, won't this depend on the capabilities of the
> device on the host?

Yes.  But the interface names are static data about the device
type, which really supports both cases.

Deciding where exactly a VFIO device can be plugged before
running the VM will require additional data about the host, and
that can't be provided by QEMU (because it's not running yet).

> 
> > * vmxnet3 (is_express=0, but PCIe handled by vmxnet3_realize())
> > * pvscsi (is_express=0, but PCIe handled by pvscsi_realize())
> > * virtio-pci (is_express=0, but PCIe handled by
> >   virtio_pci_dc_realize(), and additional legacy PCI code at
> >   virtio_pci_realize())
> > * base-xhci (is_express=1, but pcie_endpoint_cap_init() call
> >   is conditional on pci_bus_is_express(dev->bus)
> >   * Note that xhci does not clear QEMU_PCI_CAP_EXPRESS like the
> >     other hybrid devices
> > 
> > Cc: Dmitry Fleytman <dmitry@daynix.com>
> > Cc: Jason Wang <jasowang@redhat.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Alex Williamson <alex.williamson@redhat.com>
> > Cc: "Michael S. Tsirkin" <mst@redhat.com>
> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> 
> Except for the query above,
> 
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> 
> > ---
> > Changes v1 -> v2:
> > * s/legacy/conventional/
> >   * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> > * Mark base-xhci as hybrid too
> > ---
> >  hw/net/vmxnet3.c       | 5 +++++
> >  hw/scsi/vmw_pvscsi.c   | 2 ++
> >  hw/usb/hcd-xhci.c      | 5 +++++
> >  hw/vfio/pci.c          | 5 +++++
> >  hw/virtio/virtio-pci.c | 5 +++++
> >  5 files changed, 22 insertions(+)
> > 
> > diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
> > index a19a7a31dd..f99d9a69ec 100644
> > --- a/hw/net/vmxnet3.c
> > +++ b/hw/net/vmxnet3.c
> > @@ -2651,6 +2651,11 @@ static const TypeInfo vmxnet3_info = {
> >      .instance_size = sizeof(VMXNET3State),
> >      .class_init    = vmxnet3_class_init,
> >      .instance_init = vmxnet3_instance_init,
> > +    .interfaces = (InterfaceInfo[]) {
> > +        { INTERFACE_PCIE_DEVICE },
> > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > +        { }
> > +    },
> >  };
> >  
> >  static void vmxnet3_register_types(void)
> > diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
> > index 6d3f0bf11d..d6b315f8b2 100644
> > --- a/hw/scsi/vmw_pvscsi.c
> > +++ b/hw/scsi/vmw_pvscsi.c
> > @@ -1300,6 +1300,8 @@ static const TypeInfo pvscsi_info = {
> >      .class_init    = pvscsi_class_init,
> >      .interfaces = (InterfaceInfo[]) {
> >          { TYPE_HOTPLUG_HANDLER },
> > +        { INTERFACE_PCIE_DEVICE },
> > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> >          { }
> >      }
> >  };
> > diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
> > index d75c085d94..af3a9d88de 100644
> > --- a/hw/usb/hcd-xhci.c
> > +++ b/hw/usb/hcd-xhci.c
> > @@ -3670,6 +3670,11 @@ static const TypeInfo xhci_info = {
> >      .instance_size = sizeof(XHCIState),
> >      .class_init    = xhci_class_init,
> >      .abstract      = true,
> > +    .interfaces = (InterfaceInfo[]) {
> > +        { INTERFACE_PCIE_DEVICE },
> > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > +        { }
> > +    },
> >  };
> >  
> >  static void qemu_xhci_class_init(ObjectClass *klass, void *data)
> > diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> > index 31e1edf447..913433d6ba 100644
> > --- a/hw/vfio/pci.c
> > +++ b/hw/vfio/pci.c
> > @@ -3023,6 +3023,11 @@ static const TypeInfo vfio_pci_dev_info = {
> >      .class_init = vfio_pci_dev_class_init,
> >      .instance_init = vfio_instance_init,
> >      .instance_finalize = vfio_instance_finalize,
> > +    .interfaces = (InterfaceInfo[]) {
> > +        { INTERFACE_PCIE_DEVICE },
> > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > +        { }
> > +    },
> >  };
> >  
> >  static void register_vfio_pci_dev_type(void)
> > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> > index 8b0d6b69cd..67c8ab63ad 100644
> > --- a/hw/virtio/virtio-pci.c
> > +++ b/hw/virtio/virtio-pci.c
> > @@ -1958,6 +1958,11 @@ static const TypeInfo virtio_pci_info = {
> >      .class_init    = virtio_pci_class_init,
> >      .class_size    = sizeof(VirtioPCIClass),
> >      .abstract      = true,
> > +    .interfaces = (InterfaceInfo[]) {
> > +        { INTERFACE_PCIE_DEVICE },
> > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > +        { }
> > +    },
> >  };
> >  
> >  /* virtio-blk-pci */
> 
> -- 
> David Gibson			| I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
> 				| _way_ _around_!
> http://www.ozlabs.org/~dgibson



-- 
Eduardo

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
  2017-09-28  8:33     ` Jan Beulich
  (?)
@ 2017-09-28 13:12     ` Eduardo Habkost
  2017-10-03  0:12       ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices) Eduardo Habkost
  2017-10-03  0:12       ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Eduardo Habkost
  -1 siblings, 2 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-28 13:12 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Aurelien Jarno, Anthony Perard, David Gibson, Alistair Francis,
	Artyom Tarasenko, Alberto Garcia, Mark Cave-Ayland, Yongbok Kim,
	Stefano Stabellini, Peter Maydell, xen-devel, qemu-arm,
	qemu-block, qemu-devel, qemu-ppc, Hervé Poussineau,
	Alex Williamson, David Gibson, Igor Mammedov, Jason Wang,
	John Snow, Gerd Hoffmann, Laine Stump, Marcel Apfelbaum,
	Michael S. Tsirkin, Paolo Bonzini, Jiri Pirko, Hannes Reinecke,
	Jiri Slaby, Alexander Graf, Richard Henderson

On Thu, Sep 28, 2017 at 02:33:57AM -0600, Jan Beulich wrote:
> >>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
> > --- a/hw/xen/xen_pt.c
> > +++ b/hw/xen/xen_pt.c
> > @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
> >      .instance_size = sizeof(XenPCIPassthroughState),
> >      .instance_finalize = xen_pci_passthrough_finalize,
> >      .class_init = xen_pci_passthrough_class_init,
> > +    .interfaces = (InterfaceInfo[]) {
> > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > +        { },
> > +    },
> >  };
> 
> Passed through devices can be both PCI and PCIe, so following
> the description of the patch I don't think these can be statically
> given either property. Granted quite a bit of PCIe specific
> functionality may be missing in the Xen code ...

This is just static data about what the device type supports, not
about what a given device instance really is.  Deciding if the
device is PCIe or Conventional at runtime is out of the scope of
this series.

That said, if passed through PCI Express devices are really
supported, it looks like this should be marked as hybrid.

-- 
Eduardo

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
  2017-09-28  8:33     ` Jan Beulich
  (?)
  (?)
@ 2017-09-28 13:12     ` Eduardo Habkost
  -1 siblings, 0 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-28 13:12 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	qemu-devel, Gerd Hoffmann, David Gibson, Jiri Slaby,
	Hannes Reinecke, Stefano Stabellini, Alberto Garcia, qemu-block,
	Alexander Graf, Hervé Poussineau, Anthony Perard, xen-devel,
	Richard Henderson, Artyom Tarasenko, Jiri Pirko,
	Marcel Apfelbaum, Alex Williamson, qemu-arm, Laine Stump,
	Paolo Bonzini

On Thu, Sep 28, 2017 at 02:33:57AM -0600, Jan Beulich wrote:
> >>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
> > --- a/hw/xen/xen_pt.c
> > +++ b/hw/xen/xen_pt.c
> > @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
> >      .instance_size = sizeof(XenPCIPassthroughState),
> >      .instance_finalize = xen_pci_passthrough_finalize,
> >      .class_init = xen_pci_passthrough_class_init,
> > +    .interfaces = (InterfaceInfo[]) {
> > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > +        { },
> > +    },
> >  };
> 
> Passed through devices can be both PCI and PCIe, so following
> the description of the patch I don't think these can be statically
> given either property. Granted quite a bit of PCIe specific
> functionality may be missing in the Xen code ...

This is just static data about what the device type supports, not
about what a given device instance really is.  Deciding if the
device is PCIe or Conventional at runtime is out of the scope of
this series.

That said, if passed through PCI Express devices are really
supported, it looks like this should be marked as hybrid.

-- 
Eduardo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names
  2017-09-28  9:39 ` [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names Marcel Apfelbaum
@ 2017-09-28 13:15   ` Eduardo Habkost
  0 siblings, 0 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-09-28 13:15 UTC (permalink / raw)
  To: Marcel Apfelbaum
  Cc: qemu-devel, David Gibson, Alistair Francis, Laine Stump,
	Alex Williamson, Michael S. Tsirkin

On Thu, Sep 28, 2017 at 12:39:23PM +0300, Marcel Apfelbaum wrote:
> On 27/09/2017 22:56, Eduardo Habkost wrote:
> > Changes v1 -> v2:
> > * Use "Conventional PCI" instead of "legacy PCI"
> >    * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> > * Mark base-xhci as hybrid too
> >    * Reported-by: Marcel Apfelbaum <marcel@redhat.com>
> > * Mark pcie-pci-bridge as PCI Express only
> > * New Conventional PCI devices: sungem, sunhme
> > 
> > v1 was a reimplementation of one portion of an old RFC:
> >    Subject: [RFC v2 00/20] qmp: Report bus information on
> >             'query-machines'
> > 
> > This series marks each PCI device type as Conventional PCI, PCI
> > Express, or "hybrid".  It uses two new QOM interface names to do
> > that: INTERFACE_CONVENTIONAL_PCI_DEVICE
> > ("conventional-pci-device") and INTERFACE_PCIE_DEVICE
> > ("pci-express-device").  Conventional PCI devices will implement
> > only the former; PCIe-only devices will implement only the
> > latter; hybrid devices will implement both interfaces.
> > 
> > With this, management software will then be able to use
> > qom-list-types to find out which PCI devices are
> > conventional/express/hybrid.
> > 
> > In the future, the new interface names can be used in the
> > bus/slot querying commands, to indicate which types of devices
> > are accepted on each slot.
> > 
> > The last patch in the series adds an assertion to the PCI device
> > class code, to ensure we won't forget to add the corresponding
> > interface names to new PCI device classes.
> > 
> 
> Hi Eduardo,
> 
> Now we need to get rid of the "is_express" field,
> otherwise we have the same information on two places.

Agreed, it's on my TODO-list.  is_express is completely
inconsistent on hybrid devices (some of them have is_express=0,
some of them have is_express=1).

-- 
Eduardo

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/5] pci: Add interface names to hybrid PCI devices
  2017-09-28 13:06     ` Eduardo Habkost
@ 2017-09-29  0:35       ` David Gibson
  0 siblings, 0 replies; 37+ messages in thread
From: David Gibson @ 2017-09-29  0:35 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: qemu-devel, David Gibson, Alistair Francis, Laine Stump,
	Alex Williamson, Michael S. Tsirkin, Marcel Apfelbaum,
	Dmitry Fleytman, Jason Wang, Paolo Bonzini, Gerd Hoffmann

[-- Attachment #1: Type: text/plain, Size: 5647 bytes --]

On Thu, Sep 28, 2017 at 10:06:44AM -0300, Eduardo Habkost wrote:
> On Thu, Sep 28, 2017 at 02:08:09PM +1000, David Gibson wrote:
> > On Wed, Sep 27, 2017 at 04:56:32PM -0300, Eduardo Habkost wrote:
> > > The following devices support both PCI Express and Conventional
> > > PCI, by including special code to handle the QEMU_PCI_CAP_EXPRESS
> > > flag and/or conditional pcie_endpoint_cap_init() calls:
> > > 
> > > * vfio-pci (is_express=1, but legacy PCI handled by
> > >   vfio_populate_device())
> > 
> > In the case of VFIO, won't this depend on the capabilities of the
> > device on the host?
> 
> Yes.  But the interface names are static data about the device
> type, which really supports both cases.

Ok, makes sense.

> Deciding where exactly a VFIO device can be plugged before
> running the VM will require additional data about the host, and
> that can't be provided by QEMU (because it's not running yet).

Right, obviously.

> 
> > 
> > > * vmxnet3 (is_express=0, but PCIe handled by vmxnet3_realize())
> > > * pvscsi (is_express=0, but PCIe handled by pvscsi_realize())
> > > * virtio-pci (is_express=0, but PCIe handled by
> > >   virtio_pci_dc_realize(), and additional legacy PCI code at
> > >   virtio_pci_realize())
> > > * base-xhci (is_express=1, but pcie_endpoint_cap_init() call
> > >   is conditional on pci_bus_is_express(dev->bus)
> > >   * Note that xhci does not clear QEMU_PCI_CAP_EXPRESS like the
> > >     other hybrid devices
> > > 
> > > Cc: Dmitry Fleytman <dmitry@daynix.com>
> > > Cc: Jason Wang <jasowang@redhat.com>
> > > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > > Cc: Alex Williamson <alex.williamson@redhat.com>
> > > Cc: "Michael S. Tsirkin" <mst@redhat.com>
> > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> > 
> > Except for the query above,
> > 
> > Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> > 
> > > ---
> > > Changes v1 -> v2:
> > > * s/legacy/conventional/
> > >   * Suggested-by: Alex Williamson <alex.williamson@redhat.com>
> > > * Mark base-xhci as hybrid too
> > > ---
> > >  hw/net/vmxnet3.c       | 5 +++++
> > >  hw/scsi/vmw_pvscsi.c   | 2 ++
> > >  hw/usb/hcd-xhci.c      | 5 +++++
> > >  hw/vfio/pci.c          | 5 +++++
> > >  hw/virtio/virtio-pci.c | 5 +++++
> > >  5 files changed, 22 insertions(+)
> > > 
> > > diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
> > > index a19a7a31dd..f99d9a69ec 100644
> > > --- a/hw/net/vmxnet3.c
> > > +++ b/hw/net/vmxnet3.c
> > > @@ -2651,6 +2651,11 @@ static const TypeInfo vmxnet3_info = {
> > >      .instance_size = sizeof(VMXNET3State),
> > >      .class_init    = vmxnet3_class_init,
> > >      .instance_init = vmxnet3_instance_init,
> > > +    .interfaces = (InterfaceInfo[]) {
> > > +        { INTERFACE_PCIE_DEVICE },
> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > > +        { }
> > > +    },
> > >  };
> > >  
> > >  static void vmxnet3_register_types(void)
> > > diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
> > > index 6d3f0bf11d..d6b315f8b2 100644
> > > --- a/hw/scsi/vmw_pvscsi.c
> > > +++ b/hw/scsi/vmw_pvscsi.c
> > > @@ -1300,6 +1300,8 @@ static const TypeInfo pvscsi_info = {
> > >      .class_init    = pvscsi_class_init,
> > >      .interfaces = (InterfaceInfo[]) {
> > >          { TYPE_HOTPLUG_HANDLER },
> > > +        { INTERFACE_PCIE_DEVICE },
> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > >          { }
> > >      }
> > >  };
> > > diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
> > > index d75c085d94..af3a9d88de 100644
> > > --- a/hw/usb/hcd-xhci.c
> > > +++ b/hw/usb/hcd-xhci.c
> > > @@ -3670,6 +3670,11 @@ static const TypeInfo xhci_info = {
> > >      .instance_size = sizeof(XHCIState),
> > >      .class_init    = xhci_class_init,
> > >      .abstract      = true,
> > > +    .interfaces = (InterfaceInfo[]) {
> > > +        { INTERFACE_PCIE_DEVICE },
> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > > +        { }
> > > +    },
> > >  };
> > >  
> > >  static void qemu_xhci_class_init(ObjectClass *klass, void *data)
> > > diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> > > index 31e1edf447..913433d6ba 100644
> > > --- a/hw/vfio/pci.c
> > > +++ b/hw/vfio/pci.c
> > > @@ -3023,6 +3023,11 @@ static const TypeInfo vfio_pci_dev_info = {
> > >      .class_init = vfio_pci_dev_class_init,
> > >      .instance_init = vfio_instance_init,
> > >      .instance_finalize = vfio_instance_finalize,
> > > +    .interfaces = (InterfaceInfo[]) {
> > > +        { INTERFACE_PCIE_DEVICE },
> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > > +        { }
> > > +    },
> > >  };
> > >  
> > >  static void register_vfio_pci_dev_type(void)
> > > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> > > index 8b0d6b69cd..67c8ab63ad 100644
> > > --- a/hw/virtio/virtio-pci.c
> > > +++ b/hw/virtio/virtio-pci.c
> > > @@ -1958,6 +1958,11 @@ static const TypeInfo virtio_pci_info = {
> > >      .class_init    = virtio_pci_class_init,
> > >      .class_size    = sizeof(VirtioPCIClass),
> > >      .abstract      = true,
> > > +    .interfaces = (InterfaceInfo[]) {
> > > +        { INTERFACE_PCIE_DEVICE },
> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > > +        { }
> > > +    },
> > >  };
> > >  
> > >  /* virtio-blk-pci */
> > 
> 
> 
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices)
  2017-09-28 13:12     ` [Qemu-devel] [Xen-devel] " Eduardo Habkost
  2017-10-03  0:12       ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices) Eduardo Habkost
@ 2017-10-03  0:12       ` Eduardo Habkost
  2017-10-03 17:12         ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] " Stefano Stabellini
                           ` (3 more replies)
  1 sibling, 4 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-10-03  0:12 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	qemu-devel, Gerd Hoffmann, David Gibson, Jiri Slaby,
	Hannes Reinecke, Stefano Stabellini, Alberto Garcia, qemu-block,
	Alexander Graf, Hervé Poussineau, Anthony Perard, xen-devel,
	Richard Henderson, Artyom Tarasenko, Jiri Pirko,
	Marcel Apfelbaum, Alex Williamson, qemu-arm, Laine Stump,
	Paolo Bonzini, Yongbok Kim, Alistair Francis, John Snow,
	David Gibson, qemu-ppc, Igor Mammedov, Aurelien Jarno

On Thu, Sep 28, 2017 at 10:12:34AM -0300, Eduardo Habkost wrote:
> On Thu, Sep 28, 2017 at 02:33:57AM -0600, Jan Beulich wrote:
> > >>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
> > > --- a/hw/xen/xen_pt.c
> > > +++ b/hw/xen/xen_pt.c
> > > @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
> > >      .instance_size = sizeof(XenPCIPassthroughState),
> > >      .instance_finalize = xen_pci_passthrough_finalize,
> > >      .class_init = xen_pci_passthrough_class_init,
> > > +    .interfaces = (InterfaceInfo[]) {
> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > > +        { },
> > > +    },
> > >  };
> > 
> > Passed through devices can be both PCI and PCIe, so following
> > the description of the patch I don't think these can be statically
> > given either property. Granted quite a bit of PCIe specific
> > functionality may be missing in the Xen code ...
> 
> This is just static data about what the device type supports, not
> about what a given device instance really is.  Deciding if the
> device is PCIe or Conventional at runtime is out of the scope of
> this series.
> 
> That said, if passed through PCI Express devices are really
> supported, it looks like this should be marked as hybrid.

Can anybody confirm if PCI Express devices are really supported
by xen-pci-passthrough?

I suggest we add only INTERFACE_CONVENTIONAL_PCI_DEVICE to the
class info until we confirm that.

(In other words, apply this patch as-is, and add
INTERFACE_PCIE_DEVICE later as a follow-up patch if appropriate.)

-- 
Eduardo

^ permalink raw reply	[flat|nested] 37+ messages in thread

* xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices)
  2017-09-28 13:12     ` [Qemu-devel] [Xen-devel] " Eduardo Habkost
@ 2017-10-03  0:12       ` Eduardo Habkost
  2017-10-03  0:12       ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Eduardo Habkost
  1 sibling, 0 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-10-03  0:12 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	qemu-devel, Gerd Hoffmann, David Gibson, Jiri Slaby,
	Hannes Reinecke, Stefano Stabellini, Alberto Garcia, qemu-block,
	Alexander Graf, Hervé Poussineau, Marcel Apfelbaum,
	xen-devel, David Gibson, Artyom Tarasenko, Jiri Pirko,
	Anthony Perard, Alex Williamson, qemu-arm, Laine Stump,
	Igor Mammedov

On Thu, Sep 28, 2017 at 10:12:34AM -0300, Eduardo Habkost wrote:
> On Thu, Sep 28, 2017 at 02:33:57AM -0600, Jan Beulich wrote:
> > >>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
> > > --- a/hw/xen/xen_pt.c
> > > +++ b/hw/xen/xen_pt.c
> > > @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
> > >      .instance_size = sizeof(XenPCIPassthroughState),
> > >      .instance_finalize = xen_pci_passthrough_finalize,
> > >      .class_init = xen_pci_passthrough_class_init,
> > > +    .interfaces = (InterfaceInfo[]) {
> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > > +        { },
> > > +    },
> > >  };
> > 
> > Passed through devices can be both PCI and PCIe, so following
> > the description of the patch I don't think these can be statically
> > given either property. Granted quite a bit of PCIe specific
> > functionality may be missing in the Xen code ...
> 
> This is just static data about what the device type supports, not
> about what a given device instance really is.  Deciding if the
> device is PCIe or Conventional at runtime is out of the scope of
> this series.
> 
> That said, if passed through PCI Express devices are really
> supported, it looks like this should be marked as hybrid.

Can anybody confirm if PCI Express devices are really supported
by xen-pci-passthrough?

I suggest we add only INTERFACE_CONVENTIONAL_PCI_DEVICE to the
class info until we confirm that.

(In other words, apply this patch as-is, and add
INTERFACE_PCIE_DEVICE later as a follow-up patch if appropriate.)

-- 
Eduardo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices)
  2017-10-03  0:12       ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Eduardo Habkost
  2017-10-03 17:12         ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] " Stefano Stabellini
@ 2017-10-03 17:12         ` Stefano Stabellini
  2017-10-04  9:08         ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] " Jan Beulich
  2017-10-04  9:08         ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Jan Beulich
  3 siblings, 0 replies; 37+ messages in thread
From: Stefano Stabellini @ 2017-10-03 17:12 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Jan Beulich, Peter Maydell, Michael S. Tsirkin, Jason Wang,
	Mark Cave-Ayland, qemu-devel, Gerd Hoffmann, David Gibson,
	Jiri Slaby, Hannes Reinecke, Stefano Stabellini, Alberto Garcia,
	qemu-block, Alexander Graf, Hervé Poussineau,
	Anthony Perard, xen-devel, Richard Henderson, Artyom Tarasenko,
	Jiri Pirko, Marcel Apfelbaum, Alex Williamson, qemu-arm,
	Laine Stump, Paolo Bonzini, Yongbok Kim, Alistair Francis,
	John Snow, David Gibson, qemu-ppc, Igor Mammedov, Aurelien Jarno

On Mon, 2 Oct 2017, Eduardo Habkost wrote:
> On Thu, Sep 28, 2017 at 10:12:34AM -0300, Eduardo Habkost wrote:
> > On Thu, Sep 28, 2017 at 02:33:57AM -0600, Jan Beulich wrote:
> > > >>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
> > > > --- a/hw/xen/xen_pt.c
> > > > +++ b/hw/xen/xen_pt.c
> > > > @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
> > > >      .instance_size = sizeof(XenPCIPassthroughState),
> > > >      .instance_finalize = xen_pci_passthrough_finalize,
> > > >      .class_init = xen_pci_passthrough_class_init,
> > > > +    .interfaces = (InterfaceInfo[]) {
> > > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > > > +        { },
> > > > +    },
> > > >  };
> > > 
> > > Passed through devices can be both PCI and PCIe, so following
> > > the description of the patch I don't think these can be statically
> > > given either property. Granted quite a bit of PCIe specific
> > > functionality may be missing in the Xen code ...
> > 
> > This is just static data about what the device type supports, not
> > about what a given device instance really is.  Deciding if the
> > device is PCIe or Conventional at runtime is out of the scope of
> > this series.
> > 
> > That said, if passed through PCI Express devices are really
> > supported, it looks like this should be marked as hybrid.
> 
> Can anybody confirm if PCI Express devices are really supported
> by xen-pci-passthrough?
> 
> I suggest we add only INTERFACE_CONVENTIONAL_PCI_DEVICE to the
> class info until we confirm that.
> 
> (In other words, apply this patch as-is, and add
> INTERFACE_PCIE_DEVICE later as a follow-up patch if appropriate.)

Yes, xen-pci-passthrough can expose PCI Express devices to the guest.  I
don't think the old xen-pci-passthrough code does anything special to
mark it as such internally in QEMU, but it can deal with the PCI Express
Capabilities and expose/emulate them for the guest's benefit.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices)
  2017-10-03  0:12       ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Eduardo Habkost
@ 2017-10-03 17:12         ` Stefano Stabellini
  2017-10-03 17:12         ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Stefano Stabellini
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 37+ messages in thread
From: Stefano Stabellini @ 2017-10-03 17:12 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	qemu-devel, Gerd Hoffmann, Jan Beulich, David Gibson, Jiri Slaby,
	Hannes Reinecke, Stefano Stabellini, Alberto Garcia, qemu-block,
	Alexander Graf, Hervé Poussineau, Marcel Apfelbaum,
	xen-devel, David Gibson, Artyom Tarasenko, Jiri Pirko,
	Anthony Perard, Alex Williamson, qemu-arm, Laine Stump

On Mon, 2 Oct 2017, Eduardo Habkost wrote:
> On Thu, Sep 28, 2017 at 10:12:34AM -0300, Eduardo Habkost wrote:
> > On Thu, Sep 28, 2017 at 02:33:57AM -0600, Jan Beulich wrote:
> > > >>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
> > > > --- a/hw/xen/xen_pt.c
> > > > +++ b/hw/xen/xen_pt.c
> > > > @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
> > > >      .instance_size = sizeof(XenPCIPassthroughState),
> > > >      .instance_finalize = xen_pci_passthrough_finalize,
> > > >      .class_init = xen_pci_passthrough_class_init,
> > > > +    .interfaces = (InterfaceInfo[]) {
> > > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> > > > +        { },
> > > > +    },
> > > >  };
> > > 
> > > Passed through devices can be both PCI and PCIe, so following
> > > the description of the patch I don't think these can be statically
> > > given either property. Granted quite a bit of PCIe specific
> > > functionality may be missing in the Xen code ...
> > 
> > This is just static data about what the device type supports, not
> > about what a given device instance really is.  Deciding if the
> > device is PCIe or Conventional at runtime is out of the scope of
> > this series.
> > 
> > That said, if passed through PCI Express devices are really
> > supported, it looks like this should be marked as hybrid.
> 
> Can anybody confirm if PCI Express devices are really supported
> by xen-pci-passthrough?
> 
> I suggest we add only INTERFACE_CONVENTIONAL_PCI_DEVICE to the
> class info until we confirm that.
> 
> (In other words, apply this patch as-is, and add
> INTERFACE_PCIE_DEVICE later as a follow-up patch if appropriate.)

Yes, xen-pci-passthrough can expose PCI Express devices to the guest.  I
don't think the old xen-pci-passthrough code does anything special to
mark it as such internally in QEMU, but it can deal with the PCI Express
Capabilities and expose/emulate them for the guest's benefit.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices)
  2017-10-03  0:12       ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Eduardo Habkost
                           ` (2 preceding siblings ...)
  2017-10-04  9:08         ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] " Jan Beulich
@ 2017-10-04  9:08         ` Jan Beulich
  2017-10-04 13:06           ` Eduardo Habkost
  2017-10-04 13:06           ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices) Eduardo Habkost
  3 siblings, 2 replies; 37+ messages in thread
From: Jan Beulich @ 2017-10-04  9:08 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Aurelien Jarno, Anthony Perard, David Gibson, Alistair Francis,
	Artyom Tarasenko, Alberto Garcia, Mark Cave-Ayland, Yongbok Kim,
	Stefano Stabellini, Peter Maydell, xen-devel, qemu-arm,
	qemu-block, qemu-devel, qemu-ppc, Hervé Poussineau,
	Alex Williamson, David Gibson, Igor Mammedov, Jason Wang,
	John Snow, Gerd Hoffmann, Laine Stump, Marcel Apfelbaum,
	Michael S. Tsirkin, Paolo Bonzini, Jiri Pirko, Hannes Reinecke,
	Jiri Slaby, Alexander Graf, Richard Henderson

>>> On 03.10.17 at 02:12, <ehabkost@redhat.com> wrote:
> On Thu, Sep 28, 2017 at 10:12:34AM -0300, Eduardo Habkost wrote:
>> On Thu, Sep 28, 2017 at 02:33:57AM -0600, Jan Beulich wrote:
>> > >>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
>> > > --- a/hw/xen/xen_pt.c
>> > > +++ b/hw/xen/xen_pt.c
>> > > @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
>> > >      .instance_size = sizeof(XenPCIPassthroughState),
>> > >      .instance_finalize = xen_pci_passthrough_finalize,
>> > >      .class_init = xen_pci_passthrough_class_init,
>> > > +    .interfaces = (InterfaceInfo[]) {
>> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>> > > +        { },
>> > > +    },
>> > >  };
>> > 
>> > Passed through devices can be both PCI and PCIe, so following
>> > the description of the patch I don't think these can be statically
>> > given either property. Granted quite a bit of PCIe specific
>> > functionality may be missing in the Xen code ...
>> 
>> This is just static data about what the device type supports, not
>> about what a given device instance really is.  Deciding if the
>> device is PCIe or Conventional at runtime is out of the scope of
>> this series.
>> 
>> That said, if passed through PCI Express devices are really
>> supported, it looks like this should be marked as hybrid.
> 
> Can anybody confirm if PCI Express devices are really supported
> by xen-pci-passthrough?

I think I've clearly said they're supported, with some limitations.

Jan

^ permalink raw reply	[flat|nested] 37+ messages in thread

* xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices)
  2017-10-03  0:12       ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Eduardo Habkost
  2017-10-03 17:12         ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] " Stefano Stabellini
  2017-10-03 17:12         ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Stefano Stabellini
@ 2017-10-04  9:08         ` Jan Beulich
  2017-10-04  9:08         ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Jan Beulich
  3 siblings, 0 replies; 37+ messages in thread
From: Jan Beulich @ 2017-10-04  9:08 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	qemu-devel, Gerd Hoffmann, David Gibson, Jiri Slaby,
	Hannes Reinecke, Stefano Stabellini, Alberto Garcia, qemu-block,
	Alexander Graf, Hervé Poussineau, Anthony Perard, xen-devel,
	Richard Henderson, Artyom Tarasenko, Jiri Pirko,
	Marcel Apfelbaum, Alex Williamson, qemu-arm, Laine Stump,
	Paolo Bonzini

>>> On 03.10.17 at 02:12, <ehabkost@redhat.com> wrote:
> On Thu, Sep 28, 2017 at 10:12:34AM -0300, Eduardo Habkost wrote:
>> On Thu, Sep 28, 2017 at 02:33:57AM -0600, Jan Beulich wrote:
>> > >>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
>> > > --- a/hw/xen/xen_pt.c
>> > > +++ b/hw/xen/xen_pt.c
>> > > @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
>> > >      .instance_size = sizeof(XenPCIPassthroughState),
>> > >      .instance_finalize = xen_pci_passthrough_finalize,
>> > >      .class_init = xen_pci_passthrough_class_init,
>> > > +    .interfaces = (InterfaceInfo[]) {
>> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
>> > > +        { },
>> > > +    },
>> > >  };
>> > 
>> > Passed through devices can be both PCI and PCIe, so following
>> > the description of the patch I don't think these can be statically
>> > given either property. Granted quite a bit of PCIe specific
>> > functionality may be missing in the Xen code ...
>> 
>> This is just static data about what the device type supports, not
>> about what a given device instance really is.  Deciding if the
>> device is PCIe or Conventional at runtime is out of the scope of
>> this series.
>> 
>> That said, if passed through PCI Express devices are really
>> supported, it looks like this should be marked as hybrid.
> 
> Can anybody confirm if PCI Express devices are really supported
> by xen-pci-passthrough?

I think I've clearly said they're supported, with some limitations.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices)
  2017-10-04  9:08         ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Jan Beulich
@ 2017-10-04 13:06           ` Eduardo Habkost
  2017-10-05 12:45             ` [Qemu-devel] [PATCH] xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid Eduardo Habkost
  2017-10-05 12:45             ` Eduardo Habkost
  2017-10-04 13:06           ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices) Eduardo Habkost
  1 sibling, 2 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-10-04 13:06 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Aurelien Jarno, Anthony Perard, David Gibson, Alistair Francis,
	Artyom Tarasenko, Alberto Garcia, Mark Cave-Ayland, Yongbok Kim,
	Stefano Stabellini, Peter Maydell, xen-devel, qemu-arm,
	qemu-block, qemu-devel, qemu-ppc, Hervé Poussineau,
	Alex Williamson, David Gibson, Igor Mammedov, Jason Wang,
	John Snow, Gerd Hoffmann, Laine Stump, Marcel Apfelbaum,
	Michael S. Tsirkin, Paolo Bonzini, Jiri Pirko, Hannes Reinecke,
	Jiri Slaby, Alexander Graf, Richard Henderson

On Wed, Oct 04, 2017 at 03:08:15AM -0600, Jan Beulich wrote:
> >>> On 03.10.17 at 02:12, <ehabkost@redhat.com> wrote:
> > On Thu, Sep 28, 2017 at 10:12:34AM -0300, Eduardo Habkost wrote:
> >> On Thu, Sep 28, 2017 at 02:33:57AM -0600, Jan Beulich wrote:
> >> > >>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
> >> > > --- a/hw/xen/xen_pt.c
> >> > > +++ b/hw/xen/xen_pt.c
> >> > > @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
> >> > >      .instance_size = sizeof(XenPCIPassthroughState),
> >> > >      .instance_finalize = xen_pci_passthrough_finalize,
> >> > >      .class_init = xen_pci_passthrough_class_init,
> >> > > +    .interfaces = (InterfaceInfo[]) {
> >> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> >> > > +        { },
> >> > > +    },
> >> > >  };
> >> > 
> >> > Passed through devices can be both PCI and PCIe, so following
> >> > the description of the patch I don't think these can be statically
> >> > given either property. Granted quite a bit of PCIe specific
> >> > functionality may be missing in the Xen code ...
> >> 
> >> This is just static data about what the device type supports, not
> >> about what a given device instance really is.  Deciding if the
> >> device is PCIe or Conventional at runtime is out of the scope of
> >> this series.
> >> 
> >> That said, if passed through PCI Express devices are really
> >> supported, it looks like this should be marked as hybrid.
> > 
> > Can anybody confirm if PCI Express devices are really supported
> > by xen-pci-passthrough?
> 
> I think I've clearly said they're supported, with some limitations.

Sorry, thanks.  I thought the possible missing PCIe functionality
could mean the device couldn't appear as PCI Express to the
guest.

I will submit a follow-up patch adding INTERFACE_PCIE_DEVICE to
xen-pci-passthrough.

-- 
Eduardo

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices)
  2017-10-04  9:08         ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Jan Beulich
  2017-10-04 13:06           ` Eduardo Habkost
@ 2017-10-04 13:06           ` Eduardo Habkost
  1 sibling, 0 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-10-04 13:06 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	qemu-devel, Gerd Hoffmann, David Gibson, Jiri Slaby,
	Hannes Reinecke, Stefano Stabellini, Alberto Garcia, qemu-block,
	Alexander Graf, Hervé Poussineau, Anthony Perard, xen-devel,
	Richard Henderson, Artyom Tarasenko, Jiri Pirko,
	Marcel Apfelbaum, Alex Williamson, qemu-arm, Laine Stump,
	Paolo Bonzini

On Wed, Oct 04, 2017 at 03:08:15AM -0600, Jan Beulich wrote:
> >>> On 03.10.17 at 02:12, <ehabkost@redhat.com> wrote:
> > On Thu, Sep 28, 2017 at 10:12:34AM -0300, Eduardo Habkost wrote:
> >> On Thu, Sep 28, 2017 at 02:33:57AM -0600, Jan Beulich wrote:
> >> > >>> On 27.09.17 at 21:56, <ehabkost@redhat.com> wrote:
> >> > > --- a/hw/xen/xen_pt.c
> >> > > +++ b/hw/xen/xen_pt.c
> >> > > @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info = {
> >> > >      .instance_size = sizeof(XenPCIPassthroughState),
> >> > >      .instance_finalize = xen_pci_passthrough_finalize,
> >> > >      .class_init = xen_pci_passthrough_class_init,
> >> > > +    .interfaces = (InterfaceInfo[]) {
> >> > > +        { INTERFACE_CONVENTIONAL_PCI_DEVICE },
> >> > > +        { },
> >> > > +    },
> >> > >  };
> >> > 
> >> > Passed through devices can be both PCI and PCIe, so following
> >> > the description of the patch I don't think these can be statically
> >> > given either property. Granted quite a bit of PCIe specific
> >> > functionality may be missing in the Xen code ...
> >> 
> >> This is just static data about what the device type supports, not
> >> about what a given device instance really is.  Deciding if the
> >> device is PCIe or Conventional at runtime is out of the scope of
> >> this series.
> >> 
> >> That said, if passed through PCI Express devices are really
> >> supported, it looks like this should be marked as hybrid.
> > 
> > Can anybody confirm if PCI Express devices are really supported
> > by xen-pci-passthrough?
> 
> I think I've clearly said they're supported, with some limitations.

Sorry, thanks.  I thought the possible missing PCIe functionality
could mean the device couldn't appear as PCI Express to the
guest.

I will submit a follow-up patch adding INTERFACE_PCIE_DEVICE to
xen-pci-passthrough.

-- 
Eduardo

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [Qemu-devel] [PATCH] xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid
  2017-10-04 13:06           ` Eduardo Habkost
@ 2017-10-05 12:45             ` Eduardo Habkost
  2017-10-05 12:45             ` Eduardo Habkost
  1 sibling, 0 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-10-05 12:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jan Beulich, Peter Maydell, Michael S. Tsirkin, Jason Wang,
	Mark Cave-Ayland, Gerd Hoffmann, David Gibson, Jiri Slaby,
	Hannes Reinecke, Stefano Stabellini, Alberto Garcia, qemu-block,
	Alexander Graf, Hervé Poussineau, Anthony Perard, xen-devel,
	Richard Henderson, Artyom Tarasenko, Jiri Pirko,
	Marcel Apfelbaum, Alex Williamson, qemu-arm, Laine Stump,
	Paolo Bonzini, Yongbok Kim, Alistair Francis, John Snow,
	David Gibson, qemu-ppc, Igor Mammedov, Aurelien Jarno

xen-pt doesn't set the is_express field, but is supposed to be
able to handle PCI Express devices too.  Mark it as hybrid.

Suggested-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/xen/xen_pt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 01df3414d3..9bba717708 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -966,6 +966,7 @@ static const TypeInfo xen_pci_passthrough_info = {
     .class_init = xen_pci_passthrough_class_init,
     .interfaces = (InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { INTERFACE_PCIE_DEVICE },
         { },
     },
 };
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH] xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid
  2017-10-04 13:06           ` Eduardo Habkost
  2017-10-05 12:45             ` [Qemu-devel] [PATCH] xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid Eduardo Habkost
@ 2017-10-05 12:45             ` Eduardo Habkost
  1 sibling, 0 replies; 37+ messages in thread
From: Eduardo Habkost @ 2017-10-05 12:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Mark Cave-Ayland,
	Gerd Hoffmann, Jan Beulich, David Gibson, Jiri Slaby,
	Hannes Reinecke, Stefano Stabellini, Alberto Garcia, qemu-block,
	Alexander Graf, Hervé Poussineau, Marcel Apfelbaum,
	xen-devel, David Gibson, Artyom Tarasenko, Jiri Pirko,
	Anthony Perard, Alex Williamson, qemu-arm, Laine Stump,
	Igor Mammedov

xen-pt doesn't set the is_express field, but is supposed to be
able to handle PCI Express devices too.  Mark it as hybrid.

Suggested-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/xen/xen_pt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c
index 01df3414d3..9bba717708 100644
--- a/hw/xen/xen_pt.c
+++ b/hw/xen/xen_pt.c
@@ -966,6 +966,7 @@ static const TypeInfo xen_pci_passthrough_info = {
     .class_init = xen_pci_passthrough_class_init,
     .interfaces = (InterfaceInfo[]) {
         { INTERFACE_CONVENTIONAL_PCI_DEVICE },
+        { INTERFACE_PCIE_DEVICE },
         { },
     },
 };
-- 
2.13.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2017-10-05 12:45 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-27 19:56 [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names Eduardo Habkost
2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 1/5] pci: conventional-pci-device and pci-express-device interfaces Eduardo Habkost
2017-09-28  4:04   ` David Gibson
2017-09-28  9:08   ` Marcel Apfelbaum
2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 2/5] pci: Add interface names to hybrid PCI devices Eduardo Habkost
2017-09-28  4:08   ` David Gibson
2017-09-28  9:27     ` Marcel Apfelbaum
2017-09-28 13:06     ` Eduardo Habkost
2017-09-29  0:35       ` David Gibson
2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 3/5] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices Eduardo Habkost
2017-09-28  4:10   ` David Gibson
2017-09-28  9:31   ` Marcel Apfelbaum
2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices Eduardo Habkost
2017-09-27 19:56   ` Eduardo Habkost
2017-09-28  4:12   ` David Gibson
2017-09-28  4:12   ` [Qemu-devel] " David Gibson
2017-09-28  8:33   ` [Qemu-devel] [Xen-devel] " Jan Beulich
2017-09-28  8:33     ` Jan Beulich
2017-09-28 13:12     ` [Qemu-devel] [Xen-devel] " Eduardo Habkost
2017-10-03  0:12       ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices) Eduardo Habkost
2017-10-03  0:12       ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Eduardo Habkost
2017-10-03 17:12         ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] " Stefano Stabellini
2017-10-03 17:12         ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Stefano Stabellini
2017-10-04  9:08         ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] " Jan Beulich
2017-10-04  9:08         ` [Qemu-devel] xen-pci-passthrough PCI Express support? (Re: [Xen-devel] " Jan Beulich
2017-10-04 13:06           ` Eduardo Habkost
2017-10-05 12:45             ` [Qemu-devel] [PATCH] xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid Eduardo Habkost
2017-10-05 12:45             ` Eduardo Habkost
2017-10-04 13:06           ` xen-pci-passthrough PCI Express support? (Re: [Qemu-devel] [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices) Eduardo Habkost
2017-09-28 13:12     ` [PATCH v2 4/5] pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices Eduardo Habkost
2017-09-28  9:35   ` [Qemu-devel] " Marcel Apfelbaum
2017-09-28  9:35   ` Marcel Apfelbaum
2017-09-27 19:56 ` [Qemu-devel] [PATCH v2 5/5] pci: Validate interfaces on base_class_init Eduardo Habkost
2017-09-28  4:13   ` David Gibson
2017-09-28  9:36   ` Marcel Apfelbaum
2017-09-28  9:39 ` [Qemu-devel] [PATCH v2 0/5] Mark conventional/PCIe/hybrid PCI devices using interface names Marcel Apfelbaum
2017-09-28 13:15   ` Eduardo Habkost

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.