From nobody Fri May 3 17:06:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1669716907; cv=none; d=zohomail.com; s=zohoarc; b=J8Er99pPEZirOs4CxhiPvWEbLVD5DcZB7DTl6VGRrH66pdDzjleAwAbG+bH4UOexp4UFDjkOqD/mXel4GD6LLknJh39vTumEZ2kyezRkwfLNumaz58dUp3yzS2IEWUHtUEohiFHHBqAZyxzxg+2KPOxENmq8r7IuXZhPfF4ip2k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669716907; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PJ+1lNqyeoKHXCxyA47Aw+3CR6RToV/Jhj3jvHQVxzw=; b=e6xesuUC2FTOBlo3smcTYkKQNcrPHnxdc+O+H17Tut8d+4JvDb2lXGI1zb0utZcyNe5X8TauJ5pNbLyMKee6HCXxbZO9XztPToGGmgl/8M0EjZqYbvz1t2qxAk746eRTpr2Vkyo57RsVvoZTEp7IR2rHeVw3ad6V8pxf6QN4jYA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1669716907848462.55135551181627; Tue, 29 Nov 2022 02:15:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozxch-0001FM-61; Tue, 29 Nov 2022 05:13:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozxcf-0001Eg-MZ for qemu-devel@nongnu.org; Tue, 29 Nov 2022 05:13:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozxcc-0005Cn-GP for qemu-devel@nongnu.org; Tue, 29 Nov 2022 05:13:53 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-328-9PbgqZW-MXq23aSgWCg0Kg-1; Tue, 29 Nov 2022 05:13:47 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 094C4811E75; Tue, 29 Nov 2022 10:13:47 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24D4D2024CBE; Tue, 29 Nov 2022 10:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669716829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PJ+1lNqyeoKHXCxyA47Aw+3CR6RToV/Jhj3jvHQVxzw=; b=LOsDUBPzcFF8FJtsy/mVAZ/tAomI9644mCnffz2y+drXvNJT9RzSDF5nXofpd8/DCd+dXq nzWqZDcIX3RqQIi/brwDFIwNsC/nNBlySQpR8u9mz9e80mdIOOYQ7odKttwX4C/fMEzISD 0EaHYLxWgyjhXwYoXqe+ulqlBjyyjvM= X-MC-Unique: 9PbgqZW-MXq23aSgWCg0Kg-1 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, ani@anisinha.ca, pbonzini@redhat.com, richard.henderson@linaro.org, mark.cave-ayland@ilande.co.uk, peter.maydell@linaro.org, andrew.smirnov@gmail.com, paulburton@kernel.org, aleksandar.rikalo@syrmia.com, danielhb413@gmail.com, clg@kaod.org, david@gibson.dropbear.id.au, groug@kaod.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org Subject: [PATCH v2 for-8.0 1/2] remove DEC 21154 PCI bridge Date: Tue, 29 Nov 2022 11:13:40 +0100 Message-Id: <20221129101341.185621-2-imammedo@redhat.com> In-Reply-To: <20221129101341.185621-1-imammedo@redhat.com> References: <20221129101341.185621-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1669716908569100001 Code has not been used practically since its inception (2004) f2aa58c6f4a20 UniNorth PCI bridge support or maybe even earlier, but it was consuming contributors time as QEMU was being rewritten. Drop it for now. Whomever would like to actually use the thing, can make sure it actually works/reintroduce it back when there is a user. PS: I've stumbled upon this when replacing PCIDeviceClass::is_bridge field with QOM cast to PCI_BRIDGE type. Unused DEC 21154 was the only one trying to use the field with plain PCIDevice. It's not worth keeping the field around for the sake of the code that was commented out 'forever'. Signed-off-by: Igor Mammedov --- v2: (BALATON Zoltan ) - leave reminder about removed bridge so it would be easier to find commit that removed it --- hw/pci-bridge/dec.h | 9 --- include/hw/pci/pci_ids.h | 1 - hw/pci-bridge/dec.c | 164 -------------------------------------- hw/pci-bridge/meson.build | 2 - hw/pci-host/uninorth.c | 9 +-- 5 files changed, 4 insertions(+), 181 deletions(-) delete mode 100644 hw/pci-bridge/dec.h delete mode 100644 hw/pci-bridge/dec.c diff --git a/hw/pci-bridge/dec.h b/hw/pci-bridge/dec.h deleted file mode 100644 index 869e90b136..0000000000 --- a/hw/pci-bridge/dec.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef HW_PCI_BRIDGE_DEC_H -#define HW_PCI_BRIDGE_DEC_H - - -#define TYPE_DEC_21154 "dec-21154-sysbus" - -PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn); - -#endif diff --git a/include/hw/pci/pci_ids.h b/include/hw/pci/pci_ids.h index bc9f834fd1..e4386ebb20 100644 --- a/include/hw/pci/pci_ids.h +++ b/include/hw/pci/pci_ids.h @@ -169,7 +169,6 @@ =20 #define PCI_VENDOR_ID_DEC 0x1011 #define PCI_DEVICE_ID_DEC_21143 0x0019 -#define PCI_DEVICE_ID_DEC_21154 0x0026 =20 #define PCI_VENDOR_ID_CIRRUS 0x1013 =20 diff --git a/hw/pci-bridge/dec.c b/hw/pci-bridge/dec.c deleted file mode 100644 index 4773d07e6d..0000000000 --- a/hw/pci-bridge/dec.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * QEMU DEC 21154 PCI bridge - * - * Copyright (c) 2006-2007 Fabrice Bellard - * Copyright (c) 2007 Jocelyn Mayer - * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN - * THE SOFTWARE. - */ - -#include "qemu/osdep.h" -#include "dec.h" -#include "hw/sysbus.h" -#include "qapi/error.h" -#include "qemu/module.h" -#include "hw/pci/pci.h" -#include "hw/pci/pci_host.h" -#include "hw/pci/pci_bridge.h" -#include "hw/pci/pci_bus.h" -#include "qom/object.h" - -OBJECT_DECLARE_SIMPLE_TYPE(DECState, DEC_21154) - -struct DECState { - PCIHostState parent_obj; -}; - -static int dec_map_irq(PCIDevice *pci_dev, int irq_num) -{ - return irq_num; -} - -static void dec_pci_bridge_realize(PCIDevice *pci_dev, Error **errp) -{ - pci_bridge_initfn(pci_dev, TYPE_PCI_BUS); -} - -static void dec_21154_pci_bridge_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); - - set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); - k->realize =3D dec_pci_bridge_realize; - k->exit =3D pci_bridge_exitfn; - k->vendor_id =3D PCI_VENDOR_ID_DEC; - k->device_id =3D PCI_DEVICE_ID_DEC_21154; - k->config_write =3D pci_bridge_write_config; - k->is_bridge =3D true; - dc->desc =3D "DEC 21154 PCI-PCI bridge"; - dc->reset =3D pci_bridge_reset; - dc->vmsd =3D &vmstate_pci_device; -} - -static const TypeInfo dec_21154_pci_bridge_info =3D { - .name =3D "dec-21154-p2p-bridge", - .parent =3D TYPE_PCI_BRIDGE, - .instance_size =3D sizeof(PCIBridge), - .class_init =3D dec_21154_pci_bridge_class_init, - .interfaces =3D (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - -PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn) -{ - PCIDevice *dev; - PCIBridge *br; - - dev =3D pci_new_multifunction(devfn, false, "dec-21154-p2p-bridge"); - br =3D PCI_BRIDGE(dev); - pci_bridge_map_irq(br, "DEC 21154 PCI-PCI bridge", dec_map_irq); - pci_realize_and_unref(dev, parent_bus, &error_fatal); - return pci_bridge_get_sec_bus(br); -} - -static void pci_dec_21154_device_realize(DeviceState *dev, Error **errp) -{ - PCIHostState *phb; - SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); - - phb =3D PCI_HOST_BRIDGE(dev); - - memory_region_init_io(&phb->conf_mem, OBJECT(dev), &pci_host_conf_le_o= ps, - dev, "pci-conf-idx", 0x1000); - memory_region_init_io(&phb->data_mem, OBJECT(dev), &pci_host_data_le_o= ps, - dev, "pci-data-idx", 0x1000); - sysbus_init_mmio(sbd, &phb->conf_mem); - sysbus_init_mmio(sbd, &phb->data_mem); -} - -static void dec_21154_pci_host_realize(PCIDevice *d, Error **errp) -{ - /* PCI2PCI bridge same values as PearPC - check this */ -} - -static void dec_21154_pci_host_class_init(ObjectClass *klass, void *data) -{ - PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); - DeviceClass *dc =3D DEVICE_CLASS(klass); - - set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); - k->realize =3D dec_21154_pci_host_realize; - k->vendor_id =3D PCI_VENDOR_ID_DEC; - k->device_id =3D PCI_DEVICE_ID_DEC_21154; - k->revision =3D 0x02; - k->class_id =3D PCI_CLASS_BRIDGE_PCI; - k->is_bridge =3D true; - /* - * PCI-facing part of the host bridge, not usable without the - * host-facing part, which can't be device_add'ed, yet. - */ - dc->user_creatable =3D false; -} - -static const TypeInfo dec_21154_pci_host_info =3D { - .name =3D "dec-21154", - .parent =3D TYPE_PCI_DEVICE, - .instance_size =3D sizeof(PCIDevice), - .class_init =3D dec_21154_pci_host_class_init, - .interfaces =3D (InterfaceInfo[]) { - { INTERFACE_CONVENTIONAL_PCI_DEVICE }, - { }, - }, -}; - -static void pci_dec_21154_device_class_init(ObjectClass *klass, void *data) -{ - DeviceClass *dc =3D DEVICE_CLASS(klass); - - dc->realize =3D pci_dec_21154_device_realize; -} - -static const TypeInfo pci_dec_21154_device_info =3D { - .name =3D TYPE_DEC_21154, - .parent =3D TYPE_PCI_HOST_BRIDGE, - .instance_size =3D sizeof(DECState), - .class_init =3D pci_dec_21154_device_class_init, -}; - -static void dec_register_types(void) -{ - type_register_static(&pci_dec_21154_device_info); - type_register_static(&dec_21154_pci_host_info); - type_register_static(&dec_21154_pci_bridge_info); -} - -type_init(dec_register_types) diff --git a/hw/pci-bridge/meson.build b/hw/pci-bridge/meson.build index 243ceeda50..fe92d43de6 100644 --- a/hw/pci-bridge/meson.build +++ b/hw/pci-bridge/meson.build @@ -8,8 +8,6 @@ pci_ss.add(when: 'CONFIG_PXB', if_true: files('pci_expander= _bridge.c'), pci_ss.add(when: 'CONFIG_XIO3130', if_true: files('xio3130_upstream.c', 'x= io3130_downstream.c')) pci_ss.add(when: 'CONFIG_CXL', if_true: files('cxl_root_port.c', 'cxl_upst= ream.c', 'cxl_downstream.c')) =20 -# NewWorld PowerMac -pci_ss.add(when: 'CONFIG_DEC_PCI', if_true: files('dec.c')) # Sun4u pci_ss.add(when: 'CONFIG_SIMBA', if_true: files('simba.c')) =20 diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index aebd44d265..8396c91d59 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -128,11 +128,10 @@ static void pci_unin_main_realize(DeviceState *dev, E= rror **errp) =20 pci_create_simple(h->bus, PCI_DEVFN(11, 0), "uni-north-pci"); =20 - /* DEC 21154 bridge */ -#if 0 - /* XXX: not activated as PPC BIOS doesn't handle multiple buses proper= ly */ - pci_create_simple(h->bus, PCI_DEVFN(12, 0), "dec-21154"); -#endif + /* + * DEC 21154 bridge was unused for many years, this comment is + * a placeholder for whoever wishes to resurrect it + */ } =20 static void pci_unin_main_init(Object *obj) --=20 2.31.1 From nobody Fri May 3 17:06:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1669716904; cv=none; d=zohomail.com; s=zohoarc; b=k/zsF+gSnrSqiabmkSXfhytWtx7JQ9S+lK4zuPqsTd7JW24hGjAezw5kEtgQoeSCXlE5rRdzamI9vAhhB0qwu20CFZrwZBItaHXsmyCt9Brbem7gqHUhWDOQDlYBJ9HK2HqByFBeeV/jDSpCHjCkvkeiczmHdiHyAv5pCOsOU44= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669716904; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YhXJc03Ex32zohig/hs4wlYDF91fEQa2mQWE8b75FTo=; b=StpoqT7DoEelOq3eZwTKUFWIP0GZJa3hSmFRxmQTLeVl6lYgNkcQBIpauNlDT+ntSy2/+KC3aw/mkghXHS7ikXO0TtmgG7B/PYPG9pEiCV9jQAekRFJPY+20y1sLhkCHJ881FYrOowKiqF51IHKpcG4FmWgi4nVbB/nKQX6mpF4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 166971690403514.442369687920177; Tue, 29 Nov 2022 02:15:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozxcm-0001Ht-IW; Tue, 29 Nov 2022 05:14:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozxcl-0001HK-4d for qemu-devel@nongnu.org; Tue, 29 Nov 2022 05:13:59 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozxci-0005FR-Uc for qemu-devel@nongnu.org; Tue, 29 Nov 2022 05:13:58 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-13-GlrMH_6bOrCnfNefxMxL0g-1; Tue, 29 Nov 2022 05:13:50 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 502DA85A588; Tue, 29 Nov 2022 10:13:49 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq2.redhat.com (dell-r430-03.lab.eng.brq2.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39CB42028DC1; Tue, 29 Nov 2022 10:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669716836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YhXJc03Ex32zohig/hs4wlYDF91fEQa2mQWE8b75FTo=; b=e2uepB0fhHy1du2ewqJAYTKsTVdT17vbN0/H1Vn3MsDR+yAliTqBE6eZ61ziMGo0YG1gA4 qoUJOHw2GV0vk3JbZ9e2wo4P838geww8VonSFRD/JqYoiYKqPmWaY4Z6nK0IUFAeO+MZ5w /kyMCmwi6k0Gjhz8yXCh1aOtU+9l2ag= X-MC-Unique: GlrMH_6bOrCnfNefxMxL0g-1 From: Igor Mammedov To: qemu-devel@nongnu.org Cc: mst@redhat.com, ani@anisinha.ca, pbonzini@redhat.com, richard.henderson@linaro.org, mark.cave-ayland@ilande.co.uk, peter.maydell@linaro.org, andrew.smirnov@gmail.com, paulburton@kernel.org, aleksandar.rikalo@syrmia.com, danielhb413@gmail.com, clg@kaod.org, david@gibson.dropbear.id.au, groug@kaod.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 for-8.0 2/2] pci: drop redundant PCIDeviceClass::is_bridge field Date: Tue, 29 Nov 2022 11:13:41 +0100 Message-Id: <20221129101341.185621-3-imammedo@redhat.com> In-Reply-To: <20221129101341.185621-1-imammedo@redhat.com> References: <20221129101341.185621-1-imammedo@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=imammedo@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1669716905040100001 and use cast to TYPE_PCI_BRIDGE instead. Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Greg Kurz --- v2: (Philippe Mathieu-Daud=C3=A9 ) - replace leftover IS_PCI_BRIDGE cast with is_bridge variable --- include/hw/pci/pci.h | 11 +---------- include/hw/pci/pci_bridge.h | 1 + hw/acpi/pcihp.c | 3 +-- hw/i386/acpi-build.c | 5 ++--- hw/pci-bridge/cxl_downstream.c | 1 - hw/pci-bridge/cxl_upstream.c | 1 - hw/pci-bridge/i82801b11.c | 1 - hw/pci-bridge/pci_bridge_dev.c | 1 - hw/pci-bridge/pcie_pci_bridge.c | 1 - hw/pci-bridge/pcie_root_port.c | 1 - hw/pci-bridge/simba.c | 1 - hw/pci-bridge/xio3130_downstream.c | 1 - hw/pci-bridge/xio3130_upstream.c | 1 - hw/pci-host/designware.c | 1 - hw/pci-host/xilinx-pcie.c | 1 - hw/pci/pci.c | 20 +++++++++----------- hw/ppc/spapr_pci.c | 15 +++++---------- 17 files changed, 19 insertions(+), 47 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 6ccaaf5154..8b3a8571bf 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -250,16 +250,7 @@ struct PCIDeviceClass { uint16_t class_id; uint16_t subsystem_vendor_id; /* only for header type =3D 0 */ uint16_t subsystem_id; /* only for header type =3D 0 */ - - /* - * pci-to-pci bridge or normal device. - * This doesn't mean pci host switch. - * When card bus bridge is supported, this would be enhanced. - */ - bool is_bridge; - - /* rom bar */ - const char *romfile; + const char *romfile; /* rom bar */ }; =20 typedef void (*PCIINTxRoutingNotifier)(PCIDevice *dev); diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h index ba4bafac7c..ca6caf487e 100644 --- a/include/hw/pci/pci_bridge.h +++ b/include/hw/pci/pci_bridge.h @@ -53,6 +53,7 @@ struct PCIBridgeWindows { =20 #define TYPE_PCI_BRIDGE "base-pci-bridge" OBJECT_DECLARE_SIMPLE_TYPE(PCIBridge, PCI_BRIDGE) +#define IS_PCI_BRIDGE(dev) object_dynamic_cast(OBJECT(dev), TYPE_PCI_BRIDG= E) =20 struct PCIBridge { /*< private >*/ diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index 84d75e6b84..99a898d9ae 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -186,7 +186,6 @@ static PCIBus *acpi_pcihp_find_hotplug_bus(AcpiPciHpSta= te *s, int bsel) =20 static bool acpi_pcihp_pc_no_hotplug(AcpiPciHpState *s, PCIDevice *dev) { - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(dev); DeviceClass *dc =3D DEVICE_GET_CLASS(dev); /* * ACPI doesn't allow hotplug of bridge devices. Don't allow @@ -196,7 +195,7 @@ static bool acpi_pcihp_pc_no_hotplug(AcpiPciHpState *s,= PCIDevice *dev) * Don't allow hot-unplug of SR-IOV Virtual Functions, as they * will be removed implicitly, when Physical Function is unplugged. */ - return (pc->is_bridge && !dev->qdev.hotplugged) || !dc->hotpluggable || + return (IS_PCI_BRIDGE(dev) && !dev->qdev.hotplugged) || !dc->hotplugga= ble || pci_is_vf(dev); } =20 diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index d9eaa5fc4d..aa15b11cde 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -403,7 +403,6 @@ static void build_append_pci_bus_devices(Aml *parent_sc= ope, PCIBus *bus, =20 for (devfn =3D 0; devfn < ARRAY_SIZE(bus->devices); devfn++) { DeviceClass *dc; - PCIDeviceClass *pc; PCIDevice *pdev =3D bus->devices[devfn]; int slot =3D PCI_SLOT(devfn); int func =3D PCI_FUNC(devfn); @@ -414,14 +413,14 @@ static void build_append_pci_bus_devices(Aml *parent_= scope, PCIBus *bus, bool cold_plugged_bridge =3D false; =20 if (pdev) { - pc =3D PCI_DEVICE_GET_CLASS(pdev); dc =3D DEVICE_GET_CLASS(pdev); =20 /* * Cold plugged bridges aren't themselves hot-pluggable. * Hotplugged bridges *are* hot-pluggable. */ - cold_plugged_bridge =3D pc->is_bridge && !DEVICE(pdev)->hotplu= gged; + cold_plugged_bridge =3D IS_PCI_BRIDGE(pdev) && + !DEVICE(pdev)->hotplugged; bridge_in_acpi =3D cold_plugged_bridge && pcihp_bridge_en; =20 hotpluggbale_slot =3D bsel && dc->hotpluggable && diff --git a/hw/pci-bridge/cxl_downstream.c b/hw/pci-bridge/cxl_downstream.c index a361e519d0..3d4e6b59cd 100644 --- a/hw/pci-bridge/cxl_downstream.c +++ b/hw/pci-bridge/cxl_downstream.c @@ -217,7 +217,6 @@ static void cxl_dsp_class_init(ObjectClass *oc, void *d= ata) DeviceClass *dc =3D DEVICE_CLASS(oc); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(oc); =20 - k->is_bridge =3D true; k->config_write =3D cxl_dsp_config_write; k->realize =3D cxl_dsp_realize; k->exit =3D cxl_dsp_exitfn; diff --git a/hw/pci-bridge/cxl_upstream.c b/hw/pci-bridge/cxl_upstream.c index 9b8b57df9d..9df436cb73 100644 --- a/hw/pci-bridge/cxl_upstream.c +++ b/hw/pci-bridge/cxl_upstream.c @@ -375,7 +375,6 @@ static void cxl_upstream_class_init(ObjectClass *oc, vo= id *data) DeviceClass *dc =3D DEVICE_CLASS(oc); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(oc); =20 - k->is_bridge =3D true; k->config_write =3D cxl_usp_write_config; k->config_read =3D cxl_usp_read_config; k->realize =3D cxl_usp_realize; diff --git a/hw/pci-bridge/i82801b11.c b/hw/pci-bridge/i82801b11.c index f28181e210..d9f224818b 100644 --- a/hw/pci-bridge/i82801b11.c +++ b/hw/pci-bridge/i82801b11.c @@ -92,7 +92,6 @@ static void i82801b11_bridge_class_init(ObjectClass *klas= s, void *data) PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - k->is_bridge =3D true; k->vendor_id =3D PCI_VENDOR_ID_INTEL; k->device_id =3D PCI_DEVICE_ID_INTEL_82801BA_11; k->revision =3D ICH9_D2P_A2_REVISION; diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c index 657a06ddbe..3435df8d73 100644 --- a/hw/pci-bridge/pci_bridge_dev.c +++ b/hw/pci-bridge/pci_bridge_dev.c @@ -254,7 +254,6 @@ static void pci_bridge_dev_class_init(ObjectClass *klas= s, void *data) k->vendor_id =3D PCI_VENDOR_ID_REDHAT; k->device_id =3D PCI_DEVICE_ID_REDHAT_BRIDGE; k->class_id =3D PCI_CLASS_BRIDGE_PCI; - k->is_bridge =3D true; dc->desc =3D "Standard PCI Bridge"; dc->reset =3D qdev_pci_bridge_dev_reset; device_class_set_props(dc, pci_bridge_dev_properties); diff --git a/hw/pci-bridge/pcie_pci_bridge.c b/hw/pci-bridge/pcie_pci_bridg= e.c index 1cd917a459..2301b2ca0b 100644 --- a/hw/pci-bridge/pcie_pci_bridge.c +++ b/hw/pci-bridge/pcie_pci_bridge.c @@ -145,7 +145,6 @@ static void pcie_pci_bridge_class_init(ObjectClass *kla= ss, void *data) DeviceClass *dc =3D DEVICE_CLASS(klass); HotplugHandlerClass *hc =3D HOTPLUG_HANDLER_CLASS(klass); =20 - k->is_bridge =3D true; k->vendor_id =3D PCI_VENDOR_ID_REDHAT; k->device_id =3D PCI_DEVICE_ID_REDHAT_PCIE_BRIDGE; k->realize =3D pcie_pci_bridge_realize; diff --git a/hw/pci-bridge/pcie_root_port.c b/hw/pci-bridge/pcie_root_port.c index 460e48269d..e0a7a036f5 100644 --- a/hw/pci-bridge/pcie_root_port.c +++ b/hw/pci-bridge/pcie_root_port.c @@ -172,7 +172,6 @@ static void rp_class_init(ObjectClass *klass, void *dat= a) DeviceClass *dc =3D DEVICE_CLASS(klass); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 - k->is_bridge =3D true; k->config_write =3D rp_write_config; k->realize =3D rp_realize; k->exit =3D rp_exit; diff --git a/hw/pci-bridge/simba.c b/hw/pci-bridge/simba.c index ba55ab1939..17aa0d7b21 100644 --- a/hw/pci-bridge/simba.c +++ b/hw/pci-bridge/simba.c @@ -77,7 +77,6 @@ static void simba_pci_bridge_class_init(ObjectClass *klas= s, void *data) k->device_id =3D PCI_DEVICE_ID_SUN_SIMBA; k->revision =3D 0x11; k->config_write =3D pci_bridge_write_config; - k->is_bridge =3D true; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->reset =3D pci_bridge_reset; dc->vmsd =3D &vmstate_pci_device; diff --git a/hw/pci-bridge/xio3130_downstream.c b/hw/pci-bridge/xio3130_dow= nstream.c index 05e2b06c0c..38a2361fa2 100644 --- a/hw/pci-bridge/xio3130_downstream.c +++ b/hw/pci-bridge/xio3130_downstream.c @@ -159,7 +159,6 @@ static void xio3130_downstream_class_init(ObjectClass *= klass, void *data) DeviceClass *dc =3D DEVICE_CLASS(klass); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 - k->is_bridge =3D true; k->config_write =3D xio3130_downstream_write_config; k->realize =3D xio3130_downstream_realize; k->exit =3D xio3130_downstream_exitfn; diff --git a/hw/pci-bridge/xio3130_upstream.c b/hw/pci-bridge/xio3130_upstr= eam.c index 5ff46ef050..a48bfe3bc5 100644 --- a/hw/pci-bridge/xio3130_upstream.c +++ b/hw/pci-bridge/xio3130_upstream.c @@ -128,7 +128,6 @@ static void xio3130_upstream_class_init(ObjectClass *kl= ass, void *data) DeviceClass *dc =3D DEVICE_CLASS(klass); PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); =20 - k->is_bridge =3D true; k->config_write =3D xio3130_upstream_write_config; k->realize =3D xio3130_upstream_realize; k->exit =3D xio3130_upstream_exitfn; diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index bde3a343a2..9e183caa48 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -600,7 +600,6 @@ static void designware_pcie_root_class_init(ObjectClass= *klass, void *data) k->device_id =3D 0xABCD; k->revision =3D 0; k->class_id =3D PCI_CLASS_BRIDGE_PCI; - k->is_bridge =3D true; k->exit =3D pci_bridge_exitfn; k->realize =3D designware_pcie_root_realize; k->config_read =3D designware_pcie_root_config_read; diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c index 38d5901a45..c9ab7052f4 100644 --- a/hw/pci-host/xilinx-pcie.c +++ b/hw/pci-host/xilinx-pcie.c @@ -298,7 +298,6 @@ static void xilinx_pcie_root_class_init(ObjectClass *kl= ass, void *data) k->device_id =3D 0x7021; k->revision =3D 0; k->class_id =3D PCI_CLASS_BRIDGE_HOST; - k->is_bridge =3D true; k->realize =3D xilinx_pcie_root_realize; k->exit =3D pci_bridge_exitfn; dc->reset =3D pci_bridge_reset; diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2f450f6a72..fe05b868e1 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -576,7 +576,7 @@ void pci_bus_range(PCIBus *bus, int *min_bus, int *max_= bus) for (i =3D 0; i < ARRAY_SIZE(bus->devices); ++i) { PCIDevice *dev =3D bus->devices[i]; =20 - if (dev && PCI_DEVICE_GET_CLASS(dev)->is_bridge) { + if (dev && IS_PCI_BRIDGE(dev)) { *min_bus =3D MIN(*min_bus, dev->config[PCI_SECONDARY_BUS]); *max_bus =3D MAX(*max_bus, dev->config[PCI_SUBORDINATE_BUS]); } @@ -592,7 +592,6 @@ static int get_pci_config_device(QEMUFile *f, void *pv,= size_t size, const VMStateField *field) { PCIDevice *s =3D container_of(pv, PCIDevice, config); - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(s); uint8_t *config; int i; =20 @@ -614,9 +613,8 @@ static int get_pci_config_device(QEMUFile *f, void *pv,= size_t size, memcpy(s->config, config, size); =20 pci_update_mappings(s); - if (pc->is_bridge) { - PCIBridge *b =3D PCI_BRIDGE(s); - pci_bridge_update_mappings(b); + if (IS_PCI_BRIDGE(s)) { + pci_bridge_update_mappings(PCI_BRIDGE(s)); } =20 memory_region_set_enabled(&s->bus_master_enable_region, @@ -1090,9 +1088,10 @@ static PCIDevice *do_pci_register_device(PCIDevice *= pci_dev, Error *local_err =3D NULL; DeviceState *dev =3D DEVICE(pci_dev); PCIBus *bus =3D pci_get_bus(pci_dev); + bool is_bridge =3D IS_PCI_BRIDGE(pci_dev); =20 /* Only pci bridges can be attached to extra PCI root buses */ - if (pci_bus_is_root(bus) && bus->parent_dev && !pc->is_bridge) { + if (pci_bus_is_root(bus) && bus->parent_dev && !is_bridge) { error_setg(errp, "PCI: Only PCI/PCIe bridges can be plugged into %s", bus->parent_dev->name); @@ -1154,7 +1153,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *p= ci_dev, pci_config_set_revision(pci_dev->config, pc->revision); pci_config_set_class(pci_dev->config, pc->class_id); =20 - if (!pc->is_bridge) { + if (!is_bridge) { if (pc->subsystem_vendor_id || pc->subsystem_id) { pci_set_word(pci_dev->config + PCI_SUBSYSTEM_VENDOR_ID, pc->subsystem_vendor_id); @@ -1171,7 +1170,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *p= ci_dev, pci_init_cmask(pci_dev); pci_init_wmask(pci_dev); pci_init_w1cmask(pci_dev); - if (pc->is_bridge) { + if (is_bridge) { pci_init_mask_bridge(pci_dev); } pci_init_multifunction(bus, pci_dev, &local_err); @@ -2096,7 +2095,7 @@ static bool pci_root_bus_in_range(PCIBus *bus, int bu= s_num) for (i =3D 0; i < ARRAY_SIZE(bus->devices); ++i) { PCIDevice *dev =3D bus->devices[i]; =20 - if (dev && PCI_DEVICE_GET_CLASS(dev)->is_bridge) { + if (dev && IS_PCI_BRIDGE(dev)) { if (pci_secondary_bus_in_range(dev, bus_num)) { return true; } @@ -2841,7 +2840,6 @@ void pci_setup_iommu(PCIBus *bus, PCIIOMMUFunc fn, vo= id *opaque) static void pci_dev_get_w64(PCIBus *b, PCIDevice *dev, void *opaque) { Range *range =3D opaque; - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(dev); uint16_t cmd =3D pci_get_word(dev->config + PCI_COMMAND); int i; =20 @@ -2849,7 +2847,7 @@ static void pci_dev_get_w64(PCIBus *b, PCIDevice *dev= , void *opaque) return; } =20 - if (pc->is_bridge) { + if (IS_PCI_BRIDGE(dev)) { pcibus_t base =3D pci_bridge_get_base(dev, PCI_BASE_ADDRESS_MEM_PR= EFETCH); pcibus_t limit =3D pci_bridge_get_limit(dev, PCI_BASE_ADDRESS_MEM_= PREFETCH); =20 diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 7b7618d5da..75aacda65a 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1361,7 +1361,6 @@ static int spapr_dt_pci_device(SpaprPhbState *sphb, P= CIDevice *dev, { int offset; g_autofree gchar *nodename =3D spapr_pci_fw_dev_name(dev); - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(dev); ResourceProps rp; SpaprDrc *drc =3D drc_from_dev(sphb, dev); uint32_t vendor_id =3D pci_default_read_config(dev, PCI_VENDOR_ID, 2); @@ -1446,7 +1445,7 @@ static int spapr_dt_pci_device(SpaprPhbState *sphb, P= CIDevice *dev, =20 spapr_phb_nvgpu_populate_pcidev_dt(dev, fdt, offset, sphb); =20 - if (!pc->is_bridge) { + if (!IS_PCI_BRIDGE(dev)) { /* Properties only for non-bridges */ uint32_t min_grant =3D pci_default_read_config(dev, PCI_MIN_GNT, 1= ); uint32_t max_latency =3D pci_default_read_config(dev, PCI_MAX_LAT,= 1); @@ -1544,7 +1543,6 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_h= andler, { SpaprPhbState *phb =3D SPAPR_PCI_HOST_BRIDGE(DEVICE(plug_handler)); PCIDevice *pdev =3D PCI_DEVICE(plugged_dev); - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(plugged_dev); SpaprDrc *drc =3D drc_from_dev(phb, pdev); PCIBus *bus =3D PCI_BUS(qdev_get_parent_bus(DEVICE(pdev))); uint32_t slotnr =3D PCI_SLOT(pdev->devfn); @@ -1560,7 +1558,7 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_h= andler, } } =20 - if (pc->is_bridge) { + if (IS_PCI_BRIDGE(plugged_dev)) { if (!bridge_has_valid_chassis_nr(OBJECT(plugged_dev), errp)) { return; } @@ -1589,7 +1587,6 @@ static void spapr_pci_plug(HotplugHandler *plug_handl= er, { SpaprPhbState *phb =3D SPAPR_PCI_HOST_BRIDGE(DEVICE(plug_handler)); PCIDevice *pdev =3D PCI_DEVICE(plugged_dev); - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(plugged_dev); SpaprDrc *drc =3D drc_from_dev(phb, pdev); uint32_t slotnr =3D PCI_SLOT(pdev->devfn); =20 @@ -1603,7 +1600,7 @@ static void spapr_pci_plug(HotplugHandler *plug_handl= er, =20 g_assert(drc); =20 - if (pc->is_bridge) { + if (IS_PCI_BRIDGE(plugged_dev)) { spapr_pci_bridge_plug(phb, PCI_BRIDGE(plugged_dev)); } =20 @@ -1646,7 +1643,6 @@ static void spapr_pci_bridge_unplug(SpaprPhbState *ph= b, static void spapr_pci_unplug(HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(plugged_dev); SpaprPhbState *phb =3D SPAPR_PCI_HOST_BRIDGE(DEVICE(plug_handler)); =20 /* some version guests do not wait for completion of a device @@ -1661,7 +1657,7 @@ static void spapr_pci_unplug(HotplugHandler *plug_han= dler, */ pci_device_reset(PCI_DEVICE(plugged_dev)); =20 - if (pc->is_bridge) { + if (IS_PCI_BRIDGE(plugged_dev)) { spapr_pci_bridge_unplug(phb, PCI_BRIDGE(plugged_dev)); return; } @@ -1686,7 +1682,6 @@ static void spapr_pci_unplug_request(HotplugHandler *= plug_handler, g_assert(drc->dev =3D=3D plugged_dev); =20 if (!spapr_drc_unplug_requested(drc)) { - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(plugged_dev); uint32_t slotnr =3D PCI_SLOT(pdev->devfn); SpaprDrc *func_drc; SpaprDrcClass *func_drck; @@ -1694,7 +1689,7 @@ static void spapr_pci_unplug_request(HotplugHandler *= plug_handler, int i; uint8_t chassis =3D chassis_from_bus(pci_get_bus(pdev)); =20 - if (pc->is_bridge) { + if (IS_PCI_BRIDGE(plugged_dev)) { error_setg(errp, "PCI: Hot unplug of PCI bridges not supported= "); return; } --=20 2.31.1