From nobody Thu Nov 6 19:12:09 2025 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 1488344164011793.5260778261431; Tue, 28 Feb 2017 20:56:04 -0800 (PST) Received: from localhost ([::1]:38389 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciwJ0-0000tF-Mq for importer@patchew.org; Tue, 28 Feb 2017 23:56:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciw7q-00085t-EV for qemu-devel@nongnu.org; Tue, 28 Feb 2017 23:44:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciw7n-00008V-Sp for qemu-devel@nongnu.org; Tue, 28 Feb 2017 23:44:30 -0500 Received: from ozlabs.org ([103.22.144.67]:46749) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciw7n-00006Y-Di; Tue, 28 Feb 2017 23:44:27 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3vY2sT3TZKz9sP8; Wed, 1 Mar 2017 15:44:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1488343453; bh=QqSlvSuM8V3AMywkMQB6IiSgiKc1fYY64vFie2vTgWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X26xy5xhWWcV0GwR6KaNq7/lzWi4tRwbC/7h5g8UdTjapdo7WHEZvkkar1mCcZXLz cMu/n1MpvfXC1S0qIwF+1Je0mWIWPb4OGiffQnMU2Z58a8UIEyzUu3g2TlgeWNkDwk XF/OXSyXXo+3vx7ze4djQFfbrOE8zxn17wbNgFT4= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 1 Mar 2017 15:43:47 +1100 Message-Id: <20170301044405.1792-33-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170301044405.1792-1-david@gibson.dropbear.id.au> References: <20170301044405.1792-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 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: 103.22.144.67 Subject: [Qemu-devel] [PULL 32/50] ppc/xics: use the QOM interface to get 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: lvivier@redhat.com, thuth@redhat.com, qemu-devel@nongnu.org, aik@ozlabs.ru, mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson 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" From: C=C3=A9dric Le Goater Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: David Gibson Signed-off-by: David Gibson --- hw/intc/xics.c | 5 +++-- hw/ppc/spapr_events.c | 6 +++--- hw/ppc/spapr_pci.c | 2 +- include/hw/pci-host/spapr.h | 2 +- include/hw/ppc/spapr_vio.h | 2 +- include/hw/ppc/xics.h | 3 ++- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index c6bfb61..e3dbe63 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -766,9 +766,10 @@ ICSState *xics_find_source(XICSState *xics, int irq) return NULL; } =20 -qemu_irq xics_get_qirq(XICSState *xics, int irq) +qemu_irq xics_get_qirq(XICSFabric *xi, int irq) { - ICSState *ics =3D xics_find_source(xics, irq); + XICSFabricClass *xic =3D XICS_FABRIC_GET_CLASS(xi); + ICSState *ics =3D xic->ics_get(xi, irq); =20 if (ics) { return ics->qirqs[irq - ics->offset]; diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c index 38b4258..24a5758 100644 --- a/hw/ppc/spapr_events.c +++ b/hw/ppc/spapr_events.c @@ -481,7 +481,7 @@ static void spapr_powerdown_req(Notifier *n, void *opaq= ue) =20 rtas_event_log_queue(RTAS_LOG_TYPE_EPOW, new_epow, true); =20 - qemu_irq_pulse(xics_get_qirq(spapr->xics, + qemu_irq_pulse(xics_get_qirq(XICS_FABRIC(spapr), rtas_event_log_to_irq(spapr, RTAS_LOG_TYPE_EPOW)= )); } @@ -574,7 +574,7 @@ static void spapr_hotplug_req_event(uint8_t hp_id, uint= 8_t hp_action, =20 rtas_event_log_queue(RTAS_LOG_TYPE_HOTPLUG, new_hp, true); =20 - qemu_irq_pulse(xics_get_qirq(spapr->xics, + qemu_irq_pulse(xics_get_qirq(XICS_FABRIC(spapr), rtas_event_log_to_irq(spapr, RTAS_LOG_TYPE_HOTPL= UG))); } @@ -695,7 +695,7 @@ static void check_exception(PowerPCCPU *cpu, sPAPRMachi= neState *spapr, spapr_event_sources_get_source(spapr->event_sources, i); =20 g_assert(source->enabled); - qemu_irq_pulse(xics_get_qirq(spapr->xics, source->irq)); + qemu_irq_pulse(xics_get_qirq(XICS_FABRIC(spapr), source->irq)); } } =20 diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index f371f4e..2a3499e 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -737,7 +737,7 @@ static void spapr_msi_write(void *opaque, hwaddr addr, =20 trace_spapr_pci_msi_write(addr, data, irq); =20 - qemu_irq_pulse(xics_get_qirq(spapr->xics, irq)); + qemu_irq_pulse(xics_get_qirq(XICS_FABRIC(spapr), irq)); } =20 static const MemoryRegionOps spapr_msi_ops =3D { diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 092294e..dfa7614 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -106,7 +106,7 @@ static inline qemu_irq spapr_phb_lsi_qirq(struct sPAPRP= HBState *phb, int pin) { sPAPRMachineState *spapr =3D SPAPR_MACHINE(qdev_get_machine()); =20 - return xics_get_qirq(spapr->xics, phb->lsi_table[pin].irq); + return xics_get_qirq(XICS_FABRIC(spapr), phb->lsi_table[pin].irq); } =20 PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index); diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index fc6f673..2e9685a 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -87,7 +87,7 @@ static inline qemu_irq spapr_vio_qirq(VIOsPAPRDevice *dev) { sPAPRMachineState *spapr =3D SPAPR_MACHINE(qdev_get_machine()); =20 - return xics_get_qirq(spapr->xics, dev->irq); + return xics_get_qirq(XICS_FABRIC(spapr), dev->irq); } =20 static inline bool spapr_vio_dma_valid(VIOsPAPRDevice *dev, uint64_t taddr, diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 1161d54..094756d 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -198,7 +198,8 @@ typedef struct XICSFabricClass { =20 #define XICS_IRQS_SPAPR 1024 =20 -qemu_irq xics_get_qirq(XICSState *icp, int irq); +qemu_irq xics_get_qirq(XICSFabric *xi, int irq); + int spapr_ics_alloc(ICSState *ics, int irq_hint, bool lsi, Error **errp); int spapr_ics_alloc_block(ICSState *ics, int num, bool lsi, bool align, Error **errp); --=20 2.9.3