From nobody Sat Apr 20 01:17:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550502682967174.98603870025886; Mon, 18 Feb 2019 07:11:22 -0800 (PST) Received: from localhost ([127.0.0.1]:60220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkZj-0004fc-Ri for importer@patchew.org; Mon, 18 Feb 2019 10:11:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjx1-0005hE-D7 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:31:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjws-0002fc-8j for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:31:17 -0500 Received: from ozlabs.org ([203.11.71.1]:38403) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjwq-0002bT-2E; Mon, 18 Feb 2019 09:31:09 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435rg0XD9z9sPl; Tue, 19 Feb 2019 01:30:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500259; bh=1Xqt9DETDgVcXdwGihEWE1Wj68O8RHJ0OJs8t12nO3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQ3eyCKPfN19kFJbi5eEVUMAM8C7xZMf0BupEg+ReAsUszYJw1UVATQT7XPp6y2yV ntzDB0s55fCmsJArp4vEmNVZ9rgumK7Y2HhsTD8u9jtLKPKXXLcwPtnKDHy9glLXn/ yfoJkjNOMUDXJoRIZ2eW9WdcAzni90+F6FqXSOYY= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:17 +1100 Message-Id: <20190218143049.17142-12-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-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] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 11/43] xive: Only set source type for LSIs 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: clg@kaod.org, David Gibson , qemu-ppc@nongnu.org, groug@kaod.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Greg Kurz MSI is the default and LSI specific code is guarded by the xive_source_irq_is_lsi() helper. The xive_source_irq_set() helper is a nop for MSIs. Simplify the code by turning xive_source_irq_set() into xive_source_irq_set_lsi() and only call it for LSIs. The call to xive_source_irq_set(false) in spapr_xive_irq_free() is also a nop. Just drop it. Signed-off-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater Message-Id: <154999584656.690774.18352404495120358613.stgit@bahia.lan> Signed-off-by: David Gibson --- hw/intc/spapr_xive.c | 7 +++---- include/hw/ppc/xive.h | 7 ++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index a0f5ff9294..290a290e43 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -489,20 +489,19 @@ bool spapr_xive_irq_claim(sPAPRXive *xive, uint32_t l= isn, bool lsi) } =20 xive->eat[lisn].w |=3D cpu_to_be64(EAS_VALID); - xive_source_irq_set(xsrc, lisn, lsi); + if (lsi) { + xive_source_irq_set_lsi(xsrc, lisn); + } return true; } =20 bool spapr_xive_irq_free(sPAPRXive *xive, uint32_t lisn) { - XiveSource *xsrc =3D &xive->source; - if (lisn >=3D xive->nr_irqs) { return false; } =20 xive->eat[lisn].w &=3D cpu_to_be64(~EAS_VALID); - xive_source_irq_set(xsrc, lisn, false); return true; } =20 diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index ec3bb2aae4..13a487527b 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -283,13 +283,10 @@ static inline bool xive_source_irq_is_lsi(XiveSource = *xsrc, uint32_t srcno) return test_bit(srcno, xsrc->lsi_map); } =20 -static inline void xive_source_irq_set(XiveSource *xsrc, uint32_t srcno, - bool lsi) +static inline void xive_source_irq_set_lsi(XiveSource *xsrc, uint32_t srcn= o) { assert(srcno < xsrc->nr_irqs); - if (lsi) { - bitmap_set(xsrc->lsi_map, srcno, 1); - } + bitmap_set(xsrc->lsi_map, srcno, 1); } =20 void xive_source_set_irq(void *opaque, int srcno, int val); --=20 2.20.1