From nobody Sun Feb 8 12:38:12 2026 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=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1655135543; cv=none; d=zohomail.com; s=zohoarc; b=deS0PUDlH+ZSaJtvp4Zb+oc5YRwdSu+MfqdoofgziQH06FqjMFRNHJOv9s2wT0L8JofgWN5+z07UCttxZ/8BNmQic515OLpI3XqAOPxvpOSalLOEeGl+K6bvXfzlOH9cD1F+T1yAMV34rdyIn6jVPhu0BV3dAfdzT/FrLSTcEys= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655135543; h=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=hX10O00sgZSa+/DLHphttqNXQEss5mkyCdzClRd7uRo=; b=TkJj+gJxHU1UuXEqNf8tHmiU/8nOX7hzKKuZ5Itj6Tiohlq2mTcfGBAi1ndYb7Xln4DRjiGwKggoiXwmSsclLRkxbVAr35lQvdFK//L+r7E38OqzX1TL/wiHWZq72peCJQkOeB4TbOandS9B+aI+9BlKspaHaBeyG+WQnbbjjYA= 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 1655135543031739.3100227604033; Mon, 13 Jun 2022 08:52:23 -0700 (PDT) Received: from localhost ([::1]:49188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0mMY-00037k-1o for importer@patchew.org; Mon, 13 Jun 2022 11:52:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0mFl-0000DR-HC; Mon, 13 Jun 2022 11:45:21 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:14610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0mFj-00022e-SX; Mon, 13 Jun 2022 11:45:21 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25DDV4TE001633; Mon, 13 Jun 2022 15:45:10 GMT Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3gp66db217-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jun 2022 15:45:10 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 25DFhoh0010233; Mon, 13 Jun 2022 15:45:09 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma04wdc.us.ibm.com with ESMTP id 3gmjp9eebj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jun 2022 15:45:09 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 25DFj8A910617178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Jun 2022 15:45:08 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A753CAC059; Mon, 13 Jun 2022 15:45:08 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6955AAC05E; Mon, 13 Jun 2022 15:45:07 +0000 (GMT) Received: from balboa.COMFAST (unknown [9.77.153.150]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 13 Jun 2022 15:45:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=hX10O00sgZSa+/DLHphttqNXQEss5mkyCdzClRd7uRo=; b=R5qvPAd3rZuRZbDjog1m/6xF39UEXq4ZSjwRWfM2HrZVVyTNbuzf47sYqOcoFRh5wPkT akNKxal2Dqhq04eXevCRii5eYf6J3oqKm1uZHsWNl5500hR3zmy1czhMDVobonnLt8Lt 5Vd3krBHjNl3GaA7i0lTywpzA9VfW/oxF9OoEZ/DD2ZzCQ6w7N+8LDk8VTnaifdyslIV heHDpQvNgEEzCdm5cX6lARv0iNCUaD+lCAvQHgjQq12thuYSzN2zImlM3QtnocsRvnSw lPPyAbffZRr1PZ5mwMPPxxtAhQRE5JTrJ28TKGDaJFTGJhjpX4PMp9mvJJFk4VOkLcjy Xw== From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, clg@kaod.org, fbarrat@linux.ibm.com, mark.cave-ayland@ilande.co.uk Subject: [PATCH 05/11] ppc/pnv: make pnv_ics_get() use the chip8->phbs[] array Date: Mon, 13 Jun 2022 12:44:50 -0300 Message-Id: <20220613154456.359674-6-danielhb@linux.ibm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613154456.359674-1-danielhb@linux.ibm.com> References: <20220613154456.359674-1-danielhb@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: N-AgAdHUySseyZkdR1DmJfAiq1st0iNo X-Proofpoint-ORIG-GUID: N-AgAdHUySseyZkdR1DmJfAiq1st0iNo X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-13_06,2022-06-13_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 mlxscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 clxscore=1015 priorityscore=1501 suspectscore=0 mlxlogscore=613 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206130068 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=148.163.156.1; envelope-from=danielhb@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1655135543297100001 Content-Type: text/plain; charset="utf-8" The function is working today by getting all the child objects of the chip, interacting with each of them to check whether the child is a PHB, and then doing what needs to be done. We have all the chip PHBs in the phbs[] array so interacting with all child objects is unneeded. Signed-off-by: Daniel Henrique Barboza --- hw/ppc/pnv.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 40e0cbd84d..05a8d5034f 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -1944,41 +1944,39 @@ typedef struct ForeachPhb3Args { ICSState *ics; } ForeachPhb3Args; =20 -static int pnv_ics_get_child(Object *child, void *opaque) +static void pnv_ics_get_phb_ics(PnvPHB3 *phb3, ForeachPhb3Args *args) { - ForeachPhb3Args *args =3D opaque; - PnvPHB3 *phb3 =3D (PnvPHB3 *) object_dynamic_cast(child, TYPE_PNV_PHB3= ); + if (ics_valid_irq(&phb3->lsis, args->irq)) { + args->ics =3D &phb3->lsis; + } =20 - if (phb3) { - if (ics_valid_irq(&phb3->lsis, args->irq)) { - args->ics =3D &phb3->lsis; - } - if (ics_valid_irq(ICS(&phb3->msis), args->irq)) { - args->ics =3D ICS(&phb3->msis); - } + if (ics_valid_irq(ICS(&phb3->msis), args->irq)) { + args->ics =3D ICS(&phb3->msis); } - return args->ics ? 1 : 0; } =20 static ICSState *pnv_ics_get(XICSFabric *xi, int irq) { PnvMachineState *pnv =3D PNV_MACHINE(xi); ForeachPhb3Args args =3D { irq, NULL }; - int i; + int i, j; =20 for (i =3D 0; i < pnv->num_chips; i++) { - PnvChip *chip =3D pnv->chips[i]; Pnv8Chip *chip8 =3D PNV8_CHIP(pnv->chips[i]); =20 if (ics_valid_irq(&chip8->psi.ics, irq)) { return &chip8->psi.ics; } =20 - object_child_foreach(OBJECT(chip), pnv_ics_get_child, &args); - if (args.ics) { - return args.ics; + for (j =3D 0; j < chip8->num_phbs; j++) { + pnv_ics_get_phb_ics(&chip8->phbs[j], &args); + + if (args.ics) { + return args.ics; + } } } + return NULL; } =20 --=20 2.36.1