From nobody Mon Feb 9 17:38:09 2026 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.zoho.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 1488207563060500.5176090484272; Mon, 27 Feb 2017 06:59:23 -0800 (PST) Received: from localhost ([::1]:53416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciMll-0000Im-Uc for importer@patchew.org; Mon, 27 Feb 2017 09:59:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciMK1-00019u-BG for qemu-devel@nongnu.org; Mon, 27 Feb 2017 09:30:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciMJx-0007fk-CH for qemu-devel@nongnu.org; Mon, 27 Feb 2017 09:30:41 -0500 Received: from 6.mo6.mail-out.ovh.net ([87.98.177.69]:59315) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciMJx-0007el-6I for qemu-devel@nongnu.org; Mon, 27 Feb 2017 09:30:37 -0500 Received: from player761.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id 2FB6BB3AAD for ; Mon, 27 Feb 2017 15:30:36 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-1-10647-27.w90-89.abo.wanadoo.fr [90.89.233.27]) (Authenticated sender: clg@kaod.org) by player761.ha.ovh.net (Postfix) with ESMTPSA id 595EE4800AB; Mon, 27 Feb 2017 15:30:26 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Date: Mon, 27 Feb 2017 15:29:17 +0100 Message-Id: <1488205773-30436-11-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488205773-30436-1-git-send-email-clg@kaod.org> References: <1488205773-30436-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 4036914116099410918 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelhedrvdeigdeihecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 87.98.177.69 Subject: [Qemu-devel] [PATCH v4 10/26] ppc/xics: use the QOM interface to resend irqs 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: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Also change the ICPState 'xics' backlink to be a XICSFabric, this removes the need of using qdev_get_machine() to get the QOM interface in some of the routines. Signed-off-by: C=C3=A9dric Le Goater --- Changes since v3: - changed ICPState 'xics' backlink to be a XICSFabric. hw/intc/xics.c | 20 +++++++++++--------- hw/ppc/spapr.c | 3 ++- include/hw/ppc/xics.h | 3 ++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index e3dbe63fc021..23e45a87d47a 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -231,14 +231,14 @@ static void icp_check_ipi(ICPState *ss) =20 static void icp_resend(ICPState *ss) { - ICSState *ics; + XICSFabric *xi =3D ss->xics; + XICSFabricClass *xic =3D XICS_FABRIC_GET_CLASS(xi); =20 if (ss->mfrr < CPPR(ss)) { icp_check_ipi(ss); } - QLIST_FOREACH(ics, &ss->xics->ics, list) { - ics_resend(ics); - } + + xic->ics_resend(xi); } =20 void icp_set_cppr(ICPState *ss, uint8_t cppr) @@ -299,6 +299,8 @@ uint32_t icp_ipoll(ICPState *ss, uint32_t *mfrr) =20 void icp_eoi(ICPState *ss, uint32_t xirr) { + XICSFabric *xi =3D ss->xics; + XICSFabricClass *xic =3D XICS_FABRIC_GET_CLASS(xi); ICSState *ics; uint32_t irq; =20 @@ -306,10 +308,10 @@ void icp_eoi(ICPState *ss, uint32_t xirr) ss->xirr =3D (ss->xirr & ~CPPR_MASK) | (xirr & CPPR_MASK); trace_xics_icp_eoi(ss->cs->cpu_index, xirr, ss->xirr); irq =3D xirr & XISR_MASK; - QLIST_FOREACH(ics, &ss->xics->ics, list) { - if (ics_valid_irq(ics, irq)) { - ics_eoi(ics, irq); - } + + ics =3D xic->ics_get(xi, irq); + if (ics) { + ics_eoi(ics, irq); } if (!XISR(ss)) { icp_resend(ss); @@ -401,7 +403,7 @@ static void icp_realize(DeviceState *dev, Error **errp) return; } =20 - icp->xics =3D XICS_COMMON(obj); + icp->xics =3D XICS_FABRIC(obj); } =20 =20 diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ad41aba44b49..669a3a621b56 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -100,6 +100,7 @@ static XICSState *try_create_xics(sPAPRMachineState *sp= apr, const char *type_icp, int nr_servers, int nr_irqs, Error **errp) { + XICSFabric *xi =3D XICS_FABRIC(spapr); Error *err =3D NULL, *local_err =3D NULL; XICSState *xics; ICSState *ics =3D NULL; @@ -131,7 +132,7 @@ static XICSState *try_create_xics(sPAPRMachineState *sp= apr, =20 object_initialize(icp, sizeof(*icp), type_icp); object_property_add_child(OBJECT(xics), "icp[*]", OBJECT(icp), NUL= L); - object_property_add_const_link(OBJECT(icp), "xics", OBJECT(xics), = NULL); + object_property_add_const_link(OBJECT(icp), "xics", OBJECT(xi), NU= LL); object_property_set_bool(OBJECT(icp), true, "realized", &err); if (err) { goto error; diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 094756dd75a0..b88071529d5b 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -69,6 +69,7 @@ typedef struct ICPState ICPState; typedef struct ICSStateClass ICSStateClass; typedef struct ICSState ICSState; typedef struct ICSIRQState ICSIRQState; +typedef struct XICSFabric XICSFabric; =20 struct XICSStateClass { DeviceClass parent_class; @@ -115,7 +116,7 @@ struct ICPState { qemu_irq output; bool cap_irq_xics_enabled; =20 - XICSState *xics; + XICSFabric *xics; }; =20 #define TYPE_ICS_BASE "ics-base" --=20 2.7.4