From nobody Mon May 6 10:47:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503526634327776.2515720914562; Wed, 23 Aug 2017 15:17:14 -0700 (PDT) Received: from localhost ([::1]:45832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkdxY-0006ve-SW for importer@patchew.org; Wed, 23 Aug 2017 18:17:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkdvV-0005Vz-O0 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkdvR-0001pI-TA for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35226) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkdvR-0001ol-Na for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D50514E4D3 for ; Wed, 23 Aug 2017 22:15:00 +0000 (UTC) Received: from localhost (ovpn-116-4.gru2.redhat.com [10.97.116.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id EB9056047C; Wed, 23 Aug 2017 22:14:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D50514E4D3 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 19:14:41 -0300 Message-Id: <20170823221445.15243-2-ehabkost@redhat.com> In-Reply-To: <20170823221445.15243-1-ehabkost@redhat.com> References: <20170823221445.15243-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 23 Aug 2017 22:15:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/5] pci: INTERFACE_LEGACY_PCI_DEVICE and INTERFACE_PCIE_DEVICE interfaces X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcel Apfelbaum , Laine Stump , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Those two interfaces will be used to indicate which device types support legacy 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 Reviewed-by: Alistair Francis --- 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 e598b09..f5e8ab9 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -195,6 +195,12 @@ enum { #define PCI_DEVICE_GET_CLASS(obj) \ OBJECT_GET_CLASS(PCIDeviceClass, (obj), TYPE_PCI_DEVICE) =20 +/* Interface implemented by devices that can be plugged on PCIe buses */ +#define INTERFACE_PCIE_DEVICE "pci-express-device" + +/* Interface implemented by devices that can be plugged on legacy PCI buse= s */ +#define INTERFACE_LEGACY_PCI_DEVICE "legacy-pci-device" + typedef struct PCIINTxRoute { enum { PCI_INTX_ENABLED, diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 258fbe5..baa3429 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -168,6 +168,16 @@ static const TypeInfo pci_bus_info =3D { .class_init =3D pci_bus_class_init, }; =20 +static const TypeInfo pcie_interface_info =3D { + .name =3D INTERFACE_PCIE_DEVICE, + .parent =3D TYPE_INTERFACE, +}; + +static const TypeInfo legacy_pci_interface_info =3D { + .name =3D INTERFACE_LEGACY_PCI_DEVICE, + .parent =3D TYPE_INTERFACE, +}; + static const TypeInfo pcie_bus_info =3D { .name =3D TYPE_PCIE_BUS, .parent =3D TYPE_PCI_BUS, @@ -2645,6 +2655,8 @@ static void pci_register_types(void) { type_register_static(&pci_bus_info); type_register_static(&pcie_bus_info); + type_register_static(&legacy_pci_interface_info); + type_register_static(&pcie_interface_info); type_register_static(&pci_device_type_info); } =20 --=20 2.9.4 From nobody Mon May 6 10:47:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503526637755534.902819914323; Wed, 23 Aug 2017 15:17:17 -0700 (PDT) Received: from localhost ([::1]:45833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkdxc-0006yP-Cg for importer@patchew.org; Wed, 23 Aug 2017 18:17:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkdvb-0005aY-V1 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkdvW-0001se-W1 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35274) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkdvW-0001rv-MR for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:06 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B837D4E4D3 for ; Wed, 23 Aug 2017 22:15:05 +0000 (UTC) Received: from localhost (ovpn-116-4.gru2.redhat.com [10.97.116.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F85662464; Wed, 23 Aug 2017 22:15:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B837D4E4D3 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 19:14:42 -0300 Message-Id: <20170823221445.15243-3-ehabkost@redhat.com> In-Reply-To: <20170823221445.15243-1-ehabkost@redhat.com> References: <20170823221445.15243-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 23 Aug 2017 22:15:05 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/5] pci: Add interface names to hybrid PCI devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcel Apfelbaum , Laine Stump , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The following devices support both PCIe and legacy PCI, by including special code to handle the QEMU_PCI_CAP_EXPRESS flag: * vfio-pci (is_express=3D1, but legacy PCI handled by vfio_populate_device()) * vmxnet3 (is_express=3D0, but PCIe handled by vmxnet3_realize()) * pvscsi (is_express=3D0, but PCIe handled by pvscsi_realize()) * virtio-pci (is_express=3D0, but PCIe handled by virtio_pci_dc_realize(), and additional legacy PCI code at virtio_pci_realize()) Signed-off-by: Eduardo Habkost --- hw/net/vmxnet3.c | 5 +++++ hw/scsi/vmw_pvscsi.c | 2 ++ hw/vfio/pci.c | 5 +++++ hw/virtio/virtio-pci.c | 5 +++++ 4 files changed, 17 insertions(+) diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index a19a7a3..61feacf 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -2651,6 +2651,11 @@ static const TypeInfo vmxnet3_info =3D { .instance_size =3D sizeof(VMXNET3State), .class_init =3D vmxnet3_class_init, .instance_init =3D vmxnet3_instance_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { INTERFACE_LEGACY_PCI_DEVICE }, + { } + }, }; =20 static void vmxnet3_register_types(void) diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index 77d8b6f..40dfffa 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -1300,6 +1300,8 @@ static const TypeInfo pvscsi_info =3D { .class_init =3D pvscsi_class_init, .interfaces =3D (InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, + { INTERFACE_PCIE_DEVICE }, + { INTERFACE_LEGACY_PCI_DEVICE }, { } } }; diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 31e1edf..2b21391 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3023,6 +3023,11 @@ static const TypeInfo vfio_pci_dev_info =3D { .class_init =3D vfio_pci_dev_class_init, .instance_init =3D vfio_instance_init, .instance_finalize =3D vfio_instance_finalize, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { INTERFACE_LEGACY_PCI_DEVICE }, + { } + }, }; =20 static void register_vfio_pci_dev_type(void) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 8b0d6b6..8c0b6bf 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1958,6 +1958,11 @@ static const TypeInfo virtio_pci_info =3D { .class_init =3D virtio_pci_class_init, .class_size =3D sizeof(VirtioPCIClass), .abstract =3D true, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { INTERFACE_LEGACY_PCI_DEVICE }, + { } + }, }; =20 /* virtio-blk-pci */ --=20 2.9.4 From nobody Mon May 6 10:47:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503526644369144.80083831128138; Wed, 23 Aug 2017 15:17:24 -0700 (PDT) Received: from localhost ([::1]:45834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkdxj-00074L-4O for importer@patchew.org; Wed, 23 Aug 2017 18:17:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkdvh-0005dW-8K for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkdvf-00023w-Hj for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58886) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkdvf-000238-80 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3C492883B6 for ; Wed, 23 Aug 2017 22:15:14 +0000 (UTC) Received: from localhost (ovpn-116-4.gru2.redhat.com [10.97.116.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A71567C9C; Wed, 23 Aug 2017 22:15:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3C492883B6 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 19:14:43 -0300 Message-Id: <20170823221445.15243-4-ehabkost@redhat.com> In-Reply-To: <20170823221445.15243-1-ehabkost@redhat.com> References: <20170823221445.15243-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 23 Aug 2017 22:15:14 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/5] pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcel Apfelbaum , Laine Stump , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Change all devices that set is_express=3D1 to implement INTERFACE_PCIE_DEVICE. Signed-off-by: Eduardo Habkost Reviewed-by: Alistair Francis --- hw/block/nvme.c | 4 ++++ hw/net/e1000e.c | 4 ++++ 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 ++++++ hw/usb/hcd-xhci.c | 4 ++++ 8 files changed, 34 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 6071dc1..26d58b6 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1110,6 +1110,10 @@ static const TypeInfo nvme_info =3D { .instance_size =3D sizeof(NvmeCtrl), .class_init =3D nvme_class_init, .instance_init =3D nvme_instance_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { } + }, }; =20 static void nvme_register_types(void) diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index 6c42b44..81f7934 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -708,6 +708,10 @@ static const TypeInfo e1000e_info =3D { .instance_size =3D sizeof(E1000EState), .class_init =3D e1000e_class_init, .instance_init =3D e1000e_instance_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { } + }, }; =20 static void e1000e_register_types(void) diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c index 4d588cb..9b6e4ce 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 =3D { .class_init =3D rp_class_init, .abstract =3D true, .class_size =3D sizeof(PCIERootPortClass), + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { } + }, }; =20 static void rp_register_types(void) diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_dow= nstream.c index e706f36..7d2f762 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 =3D { .name =3D "xio3130-downstream", .parent =3D TYPE_PCIE_SLOT, .class_init =3D xio3130_downstream_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { } + }, }; =20 static void xio3130_downstream_register_types(void) diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstr= eam.c index a052224..227997c 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 =3D { .name =3D "x3130-upstream", .parent =3D TYPE_PCIE_PORT, .class_init =3D xio3130_upstream_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { } + }, }; =20 static void xio3130_upstream_register_types(void) diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c index 4613dda..7659253 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 =3D { .parent =3D TYPE_PCI_BRIDGE, .instance_size =3D sizeof(XilinxPCIERoot), .class_init =3D xilinx_pcie_root_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { } + }, }; =20 static void xilinx_pcie_register(void) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 734fdae..3641c30 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; =20 static struct MegasasInfo megasas_devices[] =3D { @@ -2480,6 +2481,10 @@ static struct MegasasInfo megasas_devices[] =3D { .is_express =3D true, .vmsd =3D &vmstate_megasas_gen2, .props =3D megasas_properties_gen2, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { } + }, } }; =20 @@ -2531,6 +2536,7 @@ static void megasas_register_types(void) type_info.parent =3D TYPE_MEGASAS_BASE; type_info.class_data =3D (void *)info; type_info.class_init =3D megasas_class_init; + type_info.interfaces =3D info->interfaces; =20 type_register(&type_info); } diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 204ea69..d95ed4f 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3670,6 +3670,10 @@ static const TypeInfo xhci_info =3D { .instance_size =3D sizeof(XHCIState), .class_init =3D xhci_class_init, .abstract =3D true, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_PCIE_DEVICE }, + { } + }, }; =20 static void qemu_xhci_class_init(ObjectClass *klass, void *data) --=20 2.9.4 From nobody Mon May 6 10:47:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503526760282471.7275634456719; Wed, 23 Aug 2017 15:19:20 -0700 (PDT) Received: from localhost ([::1]:45838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkdza-0000Cq-UG for importer@patchew.org; Wed, 23 Aug 2017 18:19:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkdvp-0005mU-OM for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkdvl-00028m-Lf for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53580) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkdvl-00027q-56 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:21 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3385DC04B930 for ; Wed, 23 Aug 2017 22:15:20 +0000 (UTC) Received: from localhost (ovpn-116-4.gru2.redhat.com [10.97.116.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 928DF69573; Wed, 23 Aug 2017 22:15:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3385DC04B930 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 19:14:44 -0300 Message-Id: <20170823221445.15243-5-ehabkost@redhat.com> In-Reply-To: <20170823221445.15243-1-ehabkost@redhat.com> References: <20170823221445.15243-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 23 Aug 2017 22:15:20 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/5] pci: Add INTERFACE_LEGACY_PCI_DEVICE to legacy PCI devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcel Apfelbaum , Laine Stump , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add INTERFACE_LEGACY_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 legacy PCI devices, so INTERFACE_LEGACY_PCI_DEVICE is added only to the subtypes that are actually legacy PCI devices: * 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 device. * pcie-port: all non-abstract subtypes of pcie-port are already marked as PCIe-only devices. 3) megasas-base Not all megasas devices are legacy 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_LEGACY_PCI_DEVICE only to "megasas". Signed-off-by: Eduardo Habkost Acked-by: Alberto Garcia Acked-by: Anthony PERARD Acked-by: John Snow --- 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/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 ++++ 62 files changed, 288 insertions(+) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index f276967..defe98a 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -723,6 +723,7 @@ static const TypeInfo piix4_pm_info =3D { .interfaces =3D (InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, + { INTERFACE_LEGACY_PCI_DEVICE }, { } } }; diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index 959c786..6027e15 100644 --- a/hw/audio/ac97.c +++ b/hw/audio/ac97.c @@ -1431,6 +1431,10 @@ static const TypeInfo ac97_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof (AC97LinkState), .class_init =3D ac97_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void ac97_register_types (void) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index dd7c23d..ed14ec3 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -1082,6 +1082,10 @@ static const TypeInfo es1370_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof (ES1370State), .class_init =3D es1370_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void es1370_register_types (void) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 06acc98..e2b9bf5 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -1299,6 +1299,10 @@ static const TypeInfo intel_hda_info =3D { .instance_size =3D sizeof(IntelHDAState), .class_init =3D intel_hda_class_init, .abstract =3D true, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static const TypeInfo intel_hda_info_ich6 =3D { diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c index 303104d..c2dbcc0 100644 --- a/hw/char/serial-pci.c +++ b/hw/char/serial-pci.c @@ -250,6 +250,10 @@ static const TypeInfo serial_pci_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCISerialState), .class_init =3D serial_pci_class_initfn, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static const TypeInfo multi_2x_serial_pci_info =3D { @@ -257,6 +261,10 @@ static const TypeInfo multi_2x_serial_pci_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIMultiSerialState), .class_init =3D multi_2x_serial_pci_class_initfn, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static const TypeInfo multi_4x_serial_pci_info =3D { @@ -264,6 +272,10 @@ static const TypeInfo multi_4x_serial_pci_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIMultiSerialState), .class_init =3D multi_4x_serial_pci_class_initfn, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void serial_pci_register_types(void) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index afc290a..9a39fa0 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -3162,6 +3162,10 @@ static const TypeInfo cirrus_vga_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCICirrusVGAState), .class_init =3D cirrus_vga_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void cirrus_vga_register_types(void) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index ae3677f..1a010e8 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -2430,6 +2430,10 @@ static const TypeInfo qxl_pci_type_info =3D { .instance_size =3D sizeof(PCIQXLDevice), .abstract =3D true, .class_init =3D qxl_pci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void qxl_primary_class_init(ObjectClass *klass, void *data) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 9aa515b..7538f0c 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1843,6 +1843,10 @@ static const TypeInfo sm501_pci_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(SM501PCIState), .class_init =3D sm501_pci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void sm501_register_types(void) diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index ac9a764..72477e4 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -338,6 +338,10 @@ static const TypeInfo vga_pci_type_info =3D { .instance_size =3D sizeof(PCIVGAState), .abstract =3D true, .class_init =3D vga_pci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void vga_class_init(ObjectClass *klass, void *data) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 4a64b41..9c2aa2d 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -1350,6 +1350,10 @@ static const TypeInfo vmsvga_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(struct pci_vmsvga_state_s), .class_init =3D vmsvga_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void vmsvga_register_types(void) diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index ea51e09..83b0512 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -119,6 +119,10 @@ static const TypeInfo ich9_smb_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(ICH9SMBState), .class_init =3D ich9_smb_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void ich9_smb_register(void) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 334938a..471c7a9 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1227,6 +1227,10 @@ static const TypeInfo amdviPCI =3D { .name =3D "AMDVI-PCI", .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(AMDVIPCIState), + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 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 33e20cb..57800d3 100644 --- a/hw/i386/kvm/pci-assign.c +++ b/hw/i386/kvm/pci-assign.c @@ -1864,6 +1864,10 @@ static const TypeInfo assign_info =3D { .instance_size =3D sizeof(AssignedDevice), .class_init =3D assign_class_init, .instance_init =3D assigned_dev_instance_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void assign_register_types(void) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 46dfd2c..eafc207 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -1049,6 +1049,10 @@ static TypeInfo isa_bridge_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D isa_bridge_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void pt_graphics_register_types(void) diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c index 9ba7474..2113bd0 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 =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIXenPlatformState), .class_init =3D xen_platform_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void xen_platform_register_types(void) diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c index c093b34..e2ae81b 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 =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(XenPVDevice), .class_init =3D xen_pv_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void xen_pv_register_types(void) diff --git a/hw/ide/ich.c b/hw/ide/ich.c index 9472a60..0c60aa3 100644 --- a/hw/ide/ich.c +++ b/hw/ide/ich.c @@ -184,6 +184,10 @@ static const TypeInfo ich_ahci_info =3D { .instance_size =3D sizeof(AHCIPCIState), .instance_init =3D pci_ich9_ahci_init, .class_init =3D ich_ahci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void ich_ahci_register_types(void) diff --git a/hw/ide/pci.c b/hw/ide/pci.c index 3cfb510..f437298 100644 --- a/hw/ide/pci.c +++ b/hw/ide/pci.c @@ -458,6 +458,10 @@ static const TypeInfo pci_ide_type_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIIDEState), .abstract =3D true, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void pci_ide_register_types(void) diff --git a/hw/ipack/tpci200.c b/hw/ipack/tpci200.c index 4dfa6b3..e380378 100644 --- a/hw/ipack/tpci200.c +++ b/hw/ipack/tpci200.c @@ -646,6 +646,10 @@ static const TypeInfo tpci200_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(TPCI200State), .class_init =3D tpci200_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void tpci200_register_types(void) diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c index 4d29a99..13702b8 100644 --- a/hw/isa/i82378.c +++ b/hw/isa/i82378.c @@ -138,6 +138,10 @@ static const TypeInfo i82378_type_info =3D { .instance_size =3D sizeof(I82378State), .instance_init =3D i82378_init, .class_init =3D i82378_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void i82378_register_types(void) diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index ac8416d..dcde152 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -823,6 +823,7 @@ static const TypeInfo ich9_lpc_info =3D { .interfaces =3D (InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, + { INTERFACE_LEGACY_PCI_DEVICE }, { } } }; diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index f811eba..515e55d 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -132,6 +132,10 @@ static const TypeInfo piix4_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PIIX4State), .class_init =3D piix4_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void piix4_register_types(void) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 50dc83d..319dc7f 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -301,6 +301,10 @@ static const TypeInfo via_ac97_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(VT686AC97State), .class_init =3D via_ac97_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void vt82c686b_mc97_realize(PCIDevice *dev, Error **errp) @@ -341,6 +345,10 @@ static const TypeInfo via_mc97_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(VT686MC97State), .class_init =3D via_mc97_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 /* vt82c686 pm init */ @@ -419,6 +427,10 @@ static const TypeInfo via_pm_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(VT686PMState), .class_init =3D via_pm_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static const VMStateDescription vmstate_via =3D { @@ -502,6 +514,10 @@ static const TypeInfo via_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(VT82C686BState), .class_init =3D via_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void vt82c686b_register_types(void) diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index e8b2eef..96d8cd0 100644 --- a/hw/mips/gt64xxx_pci.c +++ b/hw/mips/gt64xxx_pci.c @@ -1232,6 +1232,10 @@ static const TypeInfo gt64120_pci_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D gt64120_pci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void gt64120_class_init(ObjectClass *klass, void *data) diff --git a/hw/misc/edu.c b/hw/misc/edu.c index 01acacf..64b12b3 100644 --- a/hw/misc/edu.c +++ b/hw/misc/edu.c @@ -408,12 +408,17 @@ static void edu_class_init(ObjectClass *class, void *= data) =20 static void pci_edu_register_types(void) { + static InterfaceInfo interfaces[] =3D { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }; static const TypeInfo edu_info =3D { .name =3D "edu", .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(EduState), .instance_init =3D edu_instance_init, .class_init =3D edu_class_init, + .interfaces =3D interfaces, }; =20 type_register_static(&edu_info); diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c index 47a015f..da63c90 100644 --- a/hw/misc/ivshmem.c +++ b/hw/misc/ivshmem.c @@ -1010,6 +1010,10 @@ static const TypeInfo ivshmem_common_info =3D { .instance_size =3D sizeof(IVShmemState), .abstract =3D true, .class_init =3D ivshmem_common_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static const VMStateDescription ivshmem_plain_vmsd =3D { diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index 5d57f45..fa163e3 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -415,6 +415,10 @@ static const TypeInfo macio_type_info =3D { .instance_init =3D macio_instance_init, .abstract =3D true, .class_init =3D macio_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void macio_register_types(void) diff --git a/hw/misc/pci-testdev.c b/hw/misc/pci-testdev.c index 7d59902..992157f 100644 --- a/hw/misc/pci-testdev.c +++ b/hw/misc/pci-testdev.c @@ -326,6 +326,10 @@ static const TypeInfo pci_testdev_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCITestDevState), .class_init =3D pci_testdev_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void pci_testdev_register_types(void) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index f2e5072..51ab83d 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -1685,6 +1685,10 @@ static const TypeInfo e1000_base_info =3D { .instance_init =3D e1000_instance_init, .class_size =3D sizeof(E1000BaseClass), .abstract =3D true, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static const E1000Info e1000_devices[] =3D { diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index 5a4774a..8f5c567 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -2117,6 +2117,10 @@ static void eepro100_register_types(void) type_info.class_init =3D eepro100_class_init; type_info.instance_size =3D sizeof(EEPRO100State); type_info.instance_init =3D eepro100_instance_init; + type_info.interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }; =20 type_register(&type_info); } diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c index 798d681..fce3420 100644 --- a/hw/net/ne2000.c +++ b/hw/net/ne2000.c @@ -786,6 +786,10 @@ static const TypeInfo ne2000_info =3D { .instance_size =3D sizeof(PCINE2000State), .class_init =3D ne2000_class_init, .instance_init =3D ne2000_instance_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void ne2000_register_types(void) diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c index 0acf8a4..cbe6e99 100644 --- a/hw/net/pcnet-pci.c +++ b/hw/net/pcnet-pci.c @@ -365,6 +365,10 @@ static const TypeInfo pcnet_info =3D { .instance_size =3D sizeof(PCIPCNetState), .class_init =3D pcnet_class_init, .instance_init =3D pcnet_instance_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void pci_pcnet_register_types(void) diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 4f0f6d7..2eb53ad 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -1573,6 +1573,10 @@ static const TypeInfo rocker_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(Rocker), .class_init =3D rocker_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void rocker_register_types(void) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 671c7e4..3371318 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -3489,6 +3489,10 @@ static const TypeInfo rtl8139_info =3D { .instance_size =3D sizeof(RTL8139State), .class_init =3D rtl8139_class_init, .instance_init =3D rtl8139_instance_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void rtl8139_register_types(void) diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c index eb275e1..77a07d0 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 =3D { .parent =3D TYPE_PCI_BRIDGE, .instance_size =3D sizeof(PCIBridge), .class_init =3D dec_21154_pci_bridge_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn) @@ -138,6 +142,10 @@ static const TypeInfo dec_21154_pci_host_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D dec_21154_pci_host_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 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 2c1b747..baac63b 100644 --- a/hw/pci-bridge/i82801b11.c +++ b/hw/pci-bridge/i82801b11.c @@ -106,6 +106,10 @@ static const TypeInfo i82801b11_bridge_info =3D { .parent =3D TYPE_PCI_BRIDGE, .instance_size =3D sizeof(I82801b11Bridge), .class_init =3D i82801b11_bridge_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void d2pbr_register(void) diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c index 4373f1d..d83824b 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 =3D { .instance_finalize =3D pci_bridge_dev_instance_finalize, .interfaces =3D (InterfaceInfo[]) { { TYPE_HOTPLUG_HANDLER }, + { INTERFACE_LEGACY_PCI_DEVICE }, { } } }; diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index ff59abf..cc9ec88 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 =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PXBDev), .class_init =3D pxb_dev_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void pxb_pcie_dev_realize(PCIDevice *dev, Error **errp) @@ -350,6 +354,10 @@ static const TypeInfo pxb_pcie_dev_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PXBDev), .class_init =3D pxb_pcie_dev_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void pxb_register_types(void) diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c index 96e5d0b..c2c8c6d 100644 --- a/hw/pci-host/apb.c +++ b/hw/pci-host/apb.c @@ -817,6 +817,10 @@ static const TypeInfo pbm_pci_host_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D pbm_pci_host_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void pbm_host_class_init(ObjectClass *klass, void *data) @@ -857,6 +861,10 @@ static const TypeInfo pbm_pci_bridge_info =3D { .name =3D "pbm-bridge", .parent =3D TYPE_PCI_BRIDGE, .class_init =3D pbm_pci_bridge_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void pbm_iommu_memory_region_class_init(ObjectClass *klass, void *d= ata) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 89133a9..f037378 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -833,6 +833,10 @@ static const TypeInfo bonito_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIBonitoState), .class_init =3D bonito_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 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 83084b9..c348e84 100644 --- a/hw/pci-host/gpex.c +++ b/hw/pci-host/gpex.c @@ -144,6 +144,10 @@ static const TypeInfo gpex_root_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(GPEXRootState), .class_init =3D gpex_root_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void gpex_register(void) diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 2e281f6..01d3edc 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -142,6 +142,10 @@ static const TypeInfo grackle_pci_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D grackle_pci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 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 072a04e..d35520e 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -694,6 +694,10 @@ static const TypeInfo piix3_pci_type_info =3D { .instance_size =3D sizeof(PIIX3State), .abstract =3D true, .class_init =3D pci_piix3_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void piix3_class_init(ObjectClass *klass, void *data) @@ -748,6 +752,10 @@ static const TypeInfo i440fx_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCII440FXState), .class_init =3D i440fx_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 /* IGD Passthrough Host Bridge. */ diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index becc0ee..6dd66c4 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -516,6 +516,10 @@ static const TypeInfo e500_host_bridge_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PPCE500PCIBridgeState), .class_init =3D e500_host_bridge_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static Property pcihost_properties[] =3D { diff --git a/hw/pci-host/prep.c b/hw/pci-host/prep.c index 8b293ba..bb19b6d 100644 --- a/hw/pci-host/prep.c +++ b/hw/pci-host/prep.c @@ -372,6 +372,10 @@ static const TypeInfo raven_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(RavenPCIState), .class_init =3D raven_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static Property raven_pcihost_properties[] =3D { diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 0e472f2..a6f93f1 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -591,6 +591,10 @@ static const TypeInfo mch_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(MCHPCIState), .class_init =3D mch_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void q35_register(void) diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index 6cf5e59..3b40a9a 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 =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D unin_main_pci_host_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void u3_agp_pci_host_class_init(ObjectClass *klass, void *data) @@ -398,6 +402,10 @@ static const TypeInfo u3_agp_pci_host_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D u3_agp_pci_host_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void unin_agp_pci_host_class_init(ObjectClass *klass, void *data) @@ -422,6 +430,10 @@ static const TypeInfo unin_agp_pci_host_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D unin_agp_pci_host_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void unin_internal_pci_host_class_init(ObjectClass *klass, void *da= ta) @@ -446,6 +458,10 @@ static const TypeInfo unin_internal_pci_host_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D unin_internal_pci_host_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 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 aa1fdf7..e1ba6f4 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -487,6 +487,10 @@ static const TypeInfo versatile_pci_host_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D versatile_pci_host_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static Property pci_vpb_properties[] =3D { diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index 6953f8b..92027c3 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -359,6 +359,10 @@ static const TypeInfo ppc4xx_host_bridge_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D ppc4xx_host_bridge_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 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 e295d88..2f0c659 100644 --- a/hw/scsi/esp-pci.c +++ b/hw/scsi/esp-pci.c @@ -398,6 +398,10 @@ static const TypeInfo esp_pci_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIESPState), .class_init =3D esp_pci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 typedef struct { diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 3e56ab2..788bfc3 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2244,6 +2244,10 @@ static const TypeInfo lsi_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(LSIState), .class_init =3D lsi_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void lsi53c810_class_init(ObjectClass *klass, void *data) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 3641c30..cf69b56 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2468,6 +2468,10 @@ static struct MegasasInfo megasas_devices[] =3D { .is_express =3D false, .vmsd =3D &vmstate_megasas_gen1, .props =3D megasas_properties_gen1, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, },{ .name =3D TYPE_MEGASAS_GEN2, .desc =3D "LSI MegaRAID SAS 2108", diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c index 765ab53..6ff773e 100644 --- a/hw/scsi/mptsas.c +++ b/hw/scsi/mptsas.c @@ -1441,6 +1441,10 @@ static const TypeInfo mptsas_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(MPTSASState), .class_init =3D mptsas1068_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void mptsas_register_types(void) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 6d6a791..f6b18d6 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -1315,6 +1315,10 @@ static const TypeInfo sdhci_pci_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(SDHCIState), .class_init =3D sdhci_pci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static Property sdhci_sysbus_properties[] =3D { diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c index 38395c0..6cec225 100644 --- a/hw/sh4/sh_pci.c +++ b/hw/sh4/sh_pci.c @@ -179,6 +179,10 @@ static const TypeInfo sh_pci_host_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(PCIDevice), .class_init =3D sh_pci_host_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void sh_pci_device_class_init(ObjectClass *klass, void *data) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index bbdb40c..b2b3bab 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -277,6 +277,10 @@ static const TypeInfo ebus_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(EbusState), .class_init =3D ebus_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 #define TYPE_OPENPROM "openprom" diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c index 6dedcb8..464178d 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 =3D { .instance_finalize =3D usb_ehci_pci_finalize, .abstract =3D true, .class_init =3D ehci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 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 267982e..8b5e579 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -2139,6 +2139,10 @@ static const TypeInfo ohci_pci_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(OHCIPCIState), .class_init =3D ohci_pci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static Property ohci_sysbus_properties[] =3D { diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index e3562a4..8842ea6 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1323,6 +1323,10 @@ static const TypeInfo uhci_pci_type_info =3D { .class_size =3D sizeof(UHCIPCIDeviceClass), .abstract =3D true, .class_init =3D uhci_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 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 349085e..83a820a 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 =3D { .name =3D "vfio-pci-igd-lpc-bridge", .parent =3D TYPE_PCI_DEVICE, .class_init =3D vfio_pci_igd_lpc_bridge_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void vfio_pci_igd_register_types(void) diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c index 49b3cd1..f8b7e0c 100644 --- a/hw/watchdog/wdt_i6300esb.c +++ b/hw/watchdog/wdt_i6300esb.c @@ -463,6 +463,10 @@ static const TypeInfo i6300esb_info =3D { .parent =3D TYPE_PCI_DEVICE, .instance_size =3D sizeof(I6300State), .class_init =3D i6300esb_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void i6300esb_register_types(void) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index 375efa6..66664fc 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -964,6 +964,10 @@ static const TypeInfo xen_pci_passthrough_info =3D { .instance_size =3D sizeof(XenPCIPassthroughState), .instance_finalize =3D xen_pci_passthrough_finalize, .class_init =3D xen_pci_passthrough_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_LEGACY_PCI_DEVICE }, + { }, + }, }; =20 static void xen_pci_passthrough_register_types(void) --=20 2.9.4 From nobody Mon May 6 10:47:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1503526879214808.6063751274828; Wed, 23 Aug 2017 15:21:19 -0700 (PDT) Received: from localhost ([::1]:45856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dke1V-0001Ph-UP for importer@patchew.org; Wed, 23 Aug 2017 18:21:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkdvx-0005rz-9g for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkdvs-0002MH-Cj for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59304) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkdvs-0002Jf-66 for qemu-devel@nongnu.org; Wed, 23 Aug 2017 18:15:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 325858763A for ; Wed, 23 Aug 2017 22:15:27 +0000 (UTC) Received: from localhost (ovpn-116-4.gru2.redhat.com [10.97.116.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9391E7AA58; Wed, 23 Aug 2017 22:15:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 325858763A Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=ehabkost@redhat.com From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 23 Aug 2017 19:14:45 -0300 Message-Id: <20170823221445.15243-6-ehabkost@redhat.com> In-Reply-To: <20170823221445.15243-1-ehabkost@redhat.com> References: <20170823221445.15243-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 23 Aug 2017 22:15:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 5/5] pci: Validate interfaces on base_class_init X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcel Apfelbaum , Laine Stump , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Make sure we don't forget to add the legacy-PCI or PCIe interface names on PCI device classes in the future. Signed-off-by: Eduardo Habkost Reviewed-by: Alistair Francis --- hw/pci/pci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index baa3429..7ac5cc6 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2525,6 +2525,17 @@ static void pci_device_class_init(ObjectClass *klass= , void *data) pc->realize =3D pci_default_realize; } =20 +static void pci_device_class_base_init(ObjectClass *klass, void *data) +{ + if (!object_class_is_abstract(klass)) { + ObjectClass *legacy =3D + object_class_dynamic_cast(klass, INTERFACE_LEGACY_PCI_DEVICE); + ObjectClass *pcie =3D + object_class_dynamic_cast(klass, INTERFACE_PCIE_DEVICE); + assert(legacy || pcie); + } +} + AddressSpace *pci_device_iommu_address_space(PCIDevice *dev) { PCIBus *bus =3D PCI_BUS(dev->bus); @@ -2649,6 +2660,7 @@ static const TypeInfo pci_device_type_info =3D { .abstract =3D true, .class_size =3D sizeof(PCIDeviceClass), .class_init =3D pci_device_class_init, + .class_base_init =3D pci_device_class_base_init, }; =20 static void pci_register_types(void) --=20 2.9.4