From nobody Tue May 7 15:30:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642422687323690.0712526526399; Mon, 17 Jan 2022 04:31:27 -0800 (PST) Received: from localhost ([::1]:56012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9RAT-0006CV-WB for importer@patchew.org; Mon, 17 Jan 2022 07:31:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9R7L-0003Ar-PU; Mon, 17 Jan 2022 07:28:11 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:4064) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9R7K-0007w5-6s; Mon, 17 Jan 2022 07:28:11 -0500 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20HCRfae024860; Mon, 17 Jan 2022 12:28:01 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dn8fw007u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 12:28:01 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20HCS0kP025814; Mon, 17 Jan 2022 12:28:00 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dn8fw006q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 12:28:00 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20HCD36c008138; Mon, 17 Jan 2022 12:27:58 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma06ams.nl.ibm.com with ESMTP id 3dknhj3w9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 12:27:58 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20HCRuN141812406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jan 2022 12:27:56 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 016A3A4040; Mon, 17 Jan 2022 12:27:56 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB89FA4057; Mon, 17 Jan 2022 12:27:55 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Mon, 17 Jan 2022 12:27:55 +0000 (GMT) Received: from yukon.ibmuc.com (unknown [9.171.52.153]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id 34F5C2201D5; Mon, 17 Jan 2022 13:27:55 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 1/3] ppc/pnv: Move root port allocation under pnv_pec_default_phb_realize() Date: Mon, 17 Jan 2022 13:27:51 +0100 Message-Id: <20220117122753.1655504-2-clg@kaod.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220117122753.1655504-1-clg@kaod.org> References: <20220117122753.1655504-1-clg@kaod.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: HkvDy5wPOrmoJXcYlPrMfCcZeQx9MZ0D X-Proofpoint-ORIG-GUID: xeCnm4I02gEfx5UIKY98AXbfLjXnfgpJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-17_05,2022-01-14_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 suspectscore=0 phishscore=0 priorityscore=1501 spamscore=0 clxscore=1034 mlxlogscore=999 impostorscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201170077 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: softfail client-ip=148.163.156.1; envelope-from=clg@kaod.org; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no 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: , Cc: Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1642422688139100001 Content-Type: text/plain; charset="utf-8" The root port device is currently created and attached to the PHB early in pnv_phb4_realize(). Do it under pnv_pec_default_phb_realize() after the PHB is fully realized. It's cleaner and avoids an extra test on defaults_enabled(). Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Daniel Henrique Barboza --- hw/pci-host/pnv_phb4.c | 7 ------- hw/pci-host/pnv_phb4_pec.c | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 1db815b1aba0..c688976caec9 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -22,7 +22,6 @@ #include "hw/irq.h" #include "hw/qdev-properties.h" #include "qom/object.h" -#include "sysemu/sysemu.h" #include "trace.h" =20 #define phb_error(phb, fmt, ...) \ @@ -1639,12 +1638,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error= **errp) pci_setup_iommu(pci->bus, pnv_phb4_dma_iommu, phb); pci->bus->flags |=3D PCI_BUS_EXTENDED_CONFIG_SPACE; =20 - /* Add a single Root port if running with defaults */ - if (defaults_enabled()) { - pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), - TYPE_PNV_PHB4_ROOT_PORT); - } - /* Setup XIVE Source */ if (phb->big_phb) { nr_irqs =3D PNV_PHB4_MAX_INTs; diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index 12aa4596282b..b19e89236a63 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -132,6 +132,9 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState= *pec, if (!sysbus_realize(SYS_BUS_DEVICE(phb), errp)) { return; } + + /* Add a single Root port if running with defaults */ + pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), TYPE_PNV_PHB4_ROOT_PORT= ); } =20 static void pnv_pec_realize(DeviceState *dev, Error **errp) --=20 2.31.1 From nobody Tue May 7 15:30:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164242374551314.972515346400542; Mon, 17 Jan 2022 04:49:05 -0800 (PST) Received: from localhost ([::1]:38486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9RRY-00061K-Ia for importer@patchew.org; Mon, 17 Jan 2022 07:49:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9R7H-0002wn-CJ; Mon, 17 Jan 2022 07:28:07 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:29034) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9R7F-0007vd-Mz; Mon, 17 Jan 2022 07:28:07 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20HBveq5023419; Mon, 17 Jan 2022 12:28:02 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dn81urh9c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 12:28:01 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20HCRp49004030; Mon, 17 Jan 2022 12:28:01 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dn81urh8h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 12:28:01 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20HCCjIA020499; Mon, 17 Jan 2022 12:27:59 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma02fra.de.ibm.com with ESMTP id 3dknw8u27c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 12:27:58 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20HCIgFU42008990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jan 2022 12:18:42 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8560E11C04C; Mon, 17 Jan 2022 12:27:56 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 52ADF11C04A; Mon, 17 Jan 2022 12:27:56 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av25.portsmouth.uk.ibm.com (Postfix) with SMTP; Mon, 17 Jan 2022 12:27:56 +0000 (GMT) Received: from yukon.ibmuc.com (unknown [9.171.52.153]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id B596B2201F1; Mon, 17 Jan 2022 13:27:55 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 2/3] ppc/pnv: Add a 'rp_model' class attribute for the PHB4 PEC Date: Mon, 17 Jan 2022 13:27:52 +0100 Message-Id: <20220117122753.1655504-3-clg@kaod.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220117122753.1655504-1-clg@kaod.org> References: <20220117122753.1655504-1-clg@kaod.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: qVG3WBT0Qv8evF3I8aaq4fA_WKReXJuE X-Proofpoint-GUID: cK96LW7J3T6nlZ3902zdjw5HD5C6OqqD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-17_04,2022-01-14_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 adultscore=0 spamscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 clxscore=1034 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201170077 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: softfail client-ip=148.163.156.1; envelope-from=clg@kaod.org; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no 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: , Cc: Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1642423746613100001 Content-Type: text/plain; charset="utf-8" PHB5 will introduce its own root port model. Prepare ground for it. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Daniel Henrique Barboza --- include/hw/pci-host/pnv_phb4.h | 1 + hw/pci-host/pnv_phb4_pec.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 74fdec2b478b..0c7635dec591 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -203,6 +203,7 @@ struct PnvPhb4PecClass { int stk_compat_size; uint64_t version; const uint32_t *num_phbs; + const char *rp_model; }; =20 #endif /* PCI_HOST_PNV_PHB4_H */ diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index b19e89236a63..a3c4b4ef850c 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -134,7 +134,9 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState= *pec, } =20 /* Add a single Root port if running with defaults */ - pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), TYPE_PNV_PHB4_ROOT_PORT= ); + pnv_phb_attach_root_port(PCI_HOST_BRIDGE(phb), + PNV_PHB4_PEC_GET_CLASS(pec)->rp_model); + } =20 static void pnv_pec_realize(DeviceState *dev, Error **errp) @@ -267,6 +269,7 @@ static void pnv_pec_class_init(ObjectClass *klass, void= *data) pecc->stk_compat_size =3D sizeof(stk_compat); pecc->version =3D PNV_PHB4_VERSION; pecc->num_phbs =3D pnv_pec_num_phbs; + pecc->rp_model =3D TYPE_PNV_PHB4_ROOT_PORT; } =20 static const TypeInfo pnv_pec_type_info =3D { --=20 2.31.1 From nobody Tue May 7 15:30:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1642422711001674.8288597858464; Mon, 17 Jan 2022 04:31:51 -0800 (PST) Received: from localhost ([::1]:56578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9RAr-0006Yw-St for importer@patchew.org; Mon, 17 Jan 2022 07:31:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9R7M-0003Cz-AM; Mon, 17 Jan 2022 07:28:12 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46212 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9R7K-0007wB-Pb; Mon, 17 Jan 2022 07:28:12 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20HAw1vG008715; Mon, 17 Jan 2022 12:28:02 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3dn75vstq8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 12:28:01 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20HBebaE005310; Mon, 17 Jan 2022 12:28:01 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com with ESMTP id 3dn75vstpp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 12:28:01 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20HCCmiD020533; Mon, 17 Jan 2022 12:27:59 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma02fra.de.ibm.com with ESMTP id 3dknw8u27f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 17 Jan 2022 12:27:59 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20HCRvga31195410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Jan 2022 12:27:57 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 131DC4C058; Mon, 17 Jan 2022 12:27:57 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D3AEF4C04A; Mon, 17 Jan 2022 12:27:56 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av22.portsmouth.uk.ibm.com (Postfix) with SMTP; Mon, 17 Jan 2022 12:27:56 +0000 (GMT) Received: from yukon.ibmuc.com (unknown [9.171.52.153]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id 4224A22010B; Mon, 17 Jan 2022 13:27:56 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 3/3] ppc/pnv: Remove PHB4 version property Date: Mon, 17 Jan 2022 13:27:53 +0100 Message-Id: <20220117122753.1655504-4-clg@kaod.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220117122753.1655504-1-clg@kaod.org> References: <20220117122753.1655504-1-clg@kaod.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: OBemvLndYGGg4dA2M6FMpiKNLIZnHr6a X-Proofpoint-GUID: 0Sszhqe9ptS9ZAW55AeeGP9VAlDHsXBE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-17_05,2022-01-14_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 phishscore=0 mlxscore=0 suspectscore=0 adultscore=0 clxscore=1034 mlxlogscore=999 impostorscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201170077 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: softfail client-ip=148.163.158.5; envelope-from=clg@kaod.org; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.32, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no 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: , Cc: Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1642422711687100001 Content-Type: text/plain; charset="utf-8" and grab the PHB version from the PEC class directly when needed. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Daniel Henrique Barboza --- hw/pci-host/pnv_phb4.c | 9 +-------- hw/pci-host/pnv_phb4_pec.c | 3 --- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index c688976caec9..a78add75b043 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -672,7 +672,7 @@ static uint64_t pnv_phb4_reg_read(void *opaque, hwaddr = off, unsigned size) =20 switch (off) { case PHB_VERSION: - return phb->version; + return PNV_PHB4_PEC_GET_CLASS(phb->pec)->version; =20 /* Read-only */ case PHB_PHB4_GEN_CAP: @@ -1575,7 +1575,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error = **errp) if (!phb->pec) { PnvMachineState *pnv =3D PNV_MACHINE(qdev_get_machine()); PnvChip *chip =3D pnv_get_chip(pnv, phb->chip_id); - PnvPhb4PecClass *pecc; BusState *s; =20 if (!chip) { @@ -1589,11 +1588,6 @@ static void pnv_phb4_realize(DeviceState *dev, Error= **errp) return; } =20 - /* All other phb properties are already set */ - pecc =3D PNV_PHB4_PEC_GET_CLASS(phb->pec); - object_property_set_int(OBJECT(phb), "version", pecc->version, - &error_fatal); - /* * Reparent user created devices to the chip to build * correctly the device tree. @@ -1688,7 +1682,6 @@ static void pnv_phb4_xive_notify(XiveNotifier *xf, ui= nt32_t srcno) static Property pnv_phb4_properties[] =3D { DEFINE_PROP_UINT32("index", PnvPHB4, phb_id, 0), DEFINE_PROP_UINT32("chip-id", PnvPHB4, chip_id, 0), - DEFINE_PROP_UINT64("version", PnvPHB4, version, 0), DEFINE_PROP_LINK("pec", PnvPHB4, pec, TYPE_PNV_PHB4_PEC, PnvPhb4PecState *), DEFINE_PROP_END_OF_LIST(), diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index a3c4b4ef850c..40d89fda56e5 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -117,7 +117,6 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState= *pec, Error **errp) { PnvPHB4 *phb =3D PNV_PHB4(qdev_new(TYPE_PNV_PHB4)); - PnvPhb4PecClass *pecc =3D PNV_PHB4_PEC_GET_CLASS(pec); int phb_id =3D pnv_phb4_pec_get_phb_id(pec, stack_no); =20 object_property_set_link(OBJECT(phb), "pec", OBJECT(pec), @@ -126,8 +125,6 @@ static void pnv_pec_default_phb_realize(PnvPhb4PecState= *pec, &error_fatal); object_property_set_int(OBJECT(phb), "index", phb_id, &error_fatal); - object_property_set_int(OBJECT(phb), "version", pecc->version, - &error_fatal); =20 if (!sysbus_realize(SYS_BUS_DEVICE(phb), errp)) { return; --=20 2.31.1