From nobody Wed Nov 5 10:18:24 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 1499276353947358.7387582269423; Wed, 5 Jul 2017 10:39:13 -0700 (PDT) Received: from localhost ([::1]:47401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSoGc-0008CP-VH for importer@patchew.org; Wed, 05 Jul 2017 13:39:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSnug-0005Co-Rx for qemu-devel@nongnu.org; Wed, 05 Jul 2017 13:16:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSnuc-0004Og-Or for qemu-devel@nongnu.org; Wed, 05 Jul 2017 13:16:30 -0400 Received: from 2.mo3.mail-out.ovh.net ([46.105.75.36]:34496) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dSnuc-0004NT-GJ for qemu-devel@nongnu.org; Wed, 05 Jul 2017 13:16:26 -0400 Received: from player158.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo3.mail-out.ovh.net (Postfix) with ESMTP id 50A4AFCD9C for ; Wed, 5 Jul 2017 19:16:25 +0200 (CEST) Received: from zorba.kaod.org.com (LFbn-1-10652-153.w90-89.abo.wanadoo.fr [90.89.238.153]) (Authenticated sender: clg@kaod.org) by player158.ha.ovh.net (Postfix) with ESMTPSA id 247BE62007C; Wed, 5 Jul 2017 19:16:19 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Date: Wed, 5 Jul 2017 19:13:37 +0200 Message-Id: <1499274819-15607-25-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1499274819-15607-1-git-send-email-clg@kaod.org> References: <1499274819-15607-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 2227311491243150310 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelkedrudeigdduuddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm 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: 46.105.75.36 Subject: [Qemu-devel] [RFC PATCH 24/26] spapr: include the XIVE interrupt source for IPIs 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?= , qemu-ppc@nongnu.org, Alexander Graf , qemu-devel@nongnu.org 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" Signed-off-by: C=C3=A9dric Le Goater --- hw/intc/xive_spapr.c | 10 ++++++++++ hw/ppc/spapr.c | 11 ++++++++++- include/hw/ppc/xive.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/hw/intc/xive_spapr.c b/hw/intc/xive_spapr.c index 64282cb4bfab..eb8a5c081e51 100644 --- a/hw/intc/xive_spapr.c +++ b/hw/intc/xive_spapr.c @@ -26,6 +26,16 @@ =20 #include "xive-internal.h" =20 +/* + * Used by the XICSFabric ics_get handler in sPAPR + */ +ICSState *xive_ics_get(XIVE *x, uint32_t lisn) +{ + ICSState *ics =3D ICS_BASE(&x->ipi_xs); + + return ics_valid_irq(ics, lisn) ? ics : NULL; +} + static XiveICSState *xive_ics_find(sPAPRMachineState *spapr, uint32_t lisn) { XICSFabricClass *xic =3D XICS_FABRIC_GET_CLASS(spapr); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 45527b4c5eca..816661f4c9ad 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3361,7 +3361,16 @@ static ICSState *spapr_ics_get(XICSFabric *dev, int = irq) { sPAPRMachineState *spapr =3D SPAPR_MACHINE(dev); =20 - return ics_valid_irq(spapr->ics, irq) ? spapr->ics : NULL; + if (ics_valid_irq(spapr->ics, irq)) { + return spapr->ics; + } + + /* If needed, check the XIVE IPI source also */ + if (spapr_ovec_test(spapr->ov5_cas, OV5_XIVE_EXPLOIT)) { + return xive_ics_get(spapr->xive, irq); + } + + return NULL; } =20 static void spapr_ics_resend(XICSFabric *dev) diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index 3c1cd96ea4d0..dc5309264422 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -74,5 +74,6 @@ uint32_t xive_alloc_hw_irqs(XIVE *x, uint32_t count, uint= 32_t align); void xive_ics_create(XiveICSState *xs, XIVE *x, uint32_t offset, uint32_t nr_irqs, uint32_t shift, uint32_t flags, Error **errp); +ICSState *xive_ics_get(XIVE *x, uint32_t lisn); =20 #endif /* PPC_XIVE_H */ --=20 2.7.5