From nobody Tue Nov 4 07:16:44 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.zohomail.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 1505150445709141.7589236368617; Mon, 11 Sep 2017 10:20:45 -0700 (PDT) Received: from localhost ([::1]:59306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drSO4-0006bJ-Vv for importer@patchew.org; Mon, 11 Sep 2017 13:20:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drSIl-0002LR-8G for qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:15:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drSIk-00051m-0g for qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:15:15 -0400 Received: from 4.mo2.mail-out.ovh.net ([87.98.172.75]:33886) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1drSIj-00051I-Qj for qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:15:13 -0400 Received: from player770.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo2.mail-out.ovh.net (Postfix) with ESMTP id D81CAAB1FE for ; Mon, 11 Sep 2017 19:15:12 +0200 (CEST) Received: from zorba.kaod.org.com (LFbn-1-2231-173.w90-76.abo.wanadoo.fr [90.76.52.173]) (Authenticated sender: clg@kaod.org) by player770.ha.ovh.net (Postfix) with ESMTPSA id AA8863C0073; Mon, 11 Sep 2017 19:15:05 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson , Benjamin Herrenschmidt , Alexey Kardashevskiy , Alexander Graf Date: Mon, 11 Sep 2017 19:12:34 +0200 Message-Id: <20170911171235.29331-21-clg@kaod.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170911171235.29331-1-clg@kaod.org> References: <20170911171235.29331-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 14168324429764070227 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelledrgedtgdduudeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm 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.172.75 Subject: [Qemu-devel] [RFC PATCH v2 20/21] ppc/xics: introduce a qirq_get() helper in the XICSFabric 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: =?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" It will be used to choose the appropriate set of qirqs when XIVE is activated. Signed-off-by: C=C3=A9dric Le Goater --- hw/intc/xics.c | 7 +------ hw/ppc/spapr.c | 12 ++++++++++++ include/hw/ppc/xics.h | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 927d4fec966a..7691492aa17b 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -685,13 +685,8 @@ static const TypeInfo xics_fabric_info =3D { qemu_irq xics_get_qirq(XICSFabric *xi, int 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]; - } - - return NULL; + return xic->qirq_get(xi, irq); } =20 ICPState *xics_icp_get(XICSFabric *xi, int server) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c2011cb2dc72..d8b25be70cd8 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3455,6 +3455,17 @@ static void spapr_phb_placement(sPAPRMachineState *s= papr, uint32_t index, *mmio64 =3D SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM64_WIN_SIZE; } =20 +static qemu_irq spapr_qirq_get(XICSFabric *dev, int irq) +{ + sPAPRMachineState *spapr =3D SPAPR_MACHINE(dev); + + if (!ics_valid_irq(spapr->ics, irq)) { + return NULL; + } + + return spapr->ics->qirqs[irq - spapr->ics->offset]; +} + static ICSState *spapr_ics_get(XICSFabric *dev, int irq) { sPAPRMachineState *spapr =3D SPAPR_MACHINE(dev); @@ -3539,6 +3550,7 @@ static void spapr_machine_class_init(ObjectClass *oc,= void *data) vhc->unmap_hptes =3D spapr_unmap_hptes; vhc->store_hpte =3D spapr_store_hpte; vhc->get_patbe =3D spapr_get_patbe; + xic->qirq_get =3D spapr_qirq_get; xic->ics_get =3D spapr_ics_get; xic->ics_resend =3D spapr_ics_resend; xic->icp_get =3D spapr_icp_get; diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index c835997303c4..46d2fc1ef2c1 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -178,6 +178,7 @@ struct XICSFabric { =20 typedef struct XICSFabricClass { InterfaceClass parent; + qemu_irq (*qirq_get)(XICSFabric *xi, int irq); ICSState *(*ics_get)(XICSFabric *xi, int irq); void (*ics_resend)(XICSFabric *xi); ICPState *(*icp_get)(XICSFabric *xi, int server); --=20 2.13.5