From nobody Tue Feb 10 16:18:38 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) 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 1512148867934162.6295058263854; Fri, 1 Dec 2017 09:21:07 -0800 (PST) Received: from localhost ([::1]:58922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKozg-0001zL-7A for importer@patchew.org; Fri, 01 Dec 2017 12:20:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKnpr-0001OD-RL for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:06:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKnpl-0002Hh-1E for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:06:43 -0500 Received: from 11.mo3.mail-out.ovh.net ([87.98.184.158]:54103) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKnpk-0002Fo-QP for qemu-devel@nongnu.org; Fri, 01 Dec 2017 11:06:36 -0500 Received: from player771.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo3.mail-out.ovh.net (Postfix) with ESMTP id 8E9B4177DAB for ; Fri, 1 Dec 2017 17:06:35 +0100 (CET) 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 player771.ha.ovh.net (Postfix) with ESMTPSA id 61E5384009D; Fri, 1 Dec 2017 17:06:30 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson , Greg Kurz Date: Fri, 1 Dec 2017 17:06:03 +0100 Message-Id: <20171201160604.15265-5-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201160604.15265-1-clg@kaod.org> References: <20171201160604.15265-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 9082353075815615315 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtuddrtdeigdekudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd 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.184.158 Subject: [Qemu-devel] [PATCH 4/5] spapr: introduce a spapr_irq_set_lsi() helper 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_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It will make synchronisation easier with the XIVE interrupt mode when available. The 'irq' parameter refers to the global IRQ number space. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: David Gibson --- Changes since initial XIVE patchset: =20 - s/spapr_irq_set/spapr_irq_set_lsi/ hw/ppc/spapr.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f6e72f686c34..5e4192aee8fe 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3579,6 +3579,14 @@ static int ics_find_free_block(ICSState *ics, int nu= m, int alignnum) return -1; } =20 +/* + * Allocate the IRQ number and set the IRQ type, LSI or MSI + */ +static void spapr_irq_set_lsi(sPAPRMachineState *spapr, int irq, bool lsi) +{ + ics_set_irq_type(spapr->ics, irq - spapr->ics->offset, lsi); +} + int spapr_irq_alloc(sPAPRMachineState *spapr, int irq_hint, bool lsi, Error **errp) { @@ -3603,7 +3611,7 @@ int spapr_irq_alloc(sPAPRMachineState *spapr, int irq= _hint, bool lsi, irq +=3D ics->offset; } =20 - ics_set_irq_type(ics, irq - ics->offset, lsi); + spapr_irq_set_lsi(spapr, irq, lsi); trace_spapr_irq_alloc(irq); =20 return irq; @@ -3642,10 +3650,10 @@ int spapr_irq_alloc_block(sPAPRMachineState *spapr,= int num, bool lsi, return -1; } =20 + first +=3D ics->offset; for (i =3D first; i < first + num; ++i) { - ics_set_irq_type(ics, i, lsi); + spapr_irq_set_lsi(spapr, i, lsi); } - first +=3D ics->offset; =20 trace_spapr_irq_alloc_block(first, num, lsi, align); =20 --=20 2.13.6