From nobody Tue Feb 10 04:30:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1630048741557297.5003584129696; Fri, 27 Aug 2021 00:19:01 -0700 (PDT) Received: from localhost ([::1]:42590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJW8i-0003rF-Fi for importer@patchew.org; Fri, 27 Aug 2021 03:19:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJW08-00012n-SN; Fri, 27 Aug 2021 03:10:08 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:52479 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJW06-0007Vs-9R; Fri, 27 Aug 2021 03:10:07 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4GwrSZ5fjWz9t0T; Fri, 27 Aug 2021 17:09:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1630048190; bh=7P/sBElL80z3oJauXgiZrDIdIXtbiRtKVxOhL7XdaQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fNN32zOJdQJOMRzs3gqxsdSWPCYftzuObUI6Qpuc0azNYhR6FkkDtxjjsMc7Dl06z rskD+W6FCpbu0HHznxlNywVhHrUgiMwtEPEk4279BW01bCQMarfdDPns7as6TAWH5Q a2zJp36YhsPrkOhKAjtTS8IYzpdz906bQO4jFmhs= From: David Gibson To: peter.maydell@linaro.org, groug@kaod.org Subject: [PULL 13/18] ppc/xive: Export PQ get/set routines Date: Fri, 27 Aug 2021 17:09:41 +1000 Message-Id: <20210827070946.219970-14-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210827070946.219970-1-david@gibson.dropbear.id.au> References: <20210827070946.219970-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=203.11.71.1; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Gibson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630048742274100001 From: C=C3=A9dric Le Goater These will be shared with the XIVE2 router. Reviewed-by: Greg Kurz Signed-off-by: C=C3=A9dric Le Goater Message-Id: <20210809134547.689560-8-clg@kaod.org> Signed-off-by: David Gibson --- hw/intc/spapr_xive_kvm.c | 8 ++++---- hw/intc/xive.c | 6 +++--- include/hw/ppc/xive.h | 4 ++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/hw/intc/spapr_xive_kvm.c b/hw/intc/spapr_xive_kvm.c index c008331160..3e534b9685 100644 --- a/hw/intc/spapr_xive_kvm.c +++ b/hw/intc/spapr_xive_kvm.c @@ -297,7 +297,7 @@ static uint8_t xive_esb_read(XiveSource *xsrc, int srcn= o, uint32_t offset) return xive_esb_rw(xsrc, srcno, offset, 0, 0) & 0x3; } =20 -static void xive_esb_trigger(XiveSource *xsrc, int srcno) +static void kvmppc_xive_esb_trigger(XiveSource *xsrc, int srcno) { uint64_t *addr =3D xsrc->esb_mmap + xive_source_esb_page(xsrc, srcno); =20 @@ -322,7 +322,7 @@ uint64_t kvmppc_xive_esb_rw(XiveSource *xsrc, int srcno= , uint32_t offset, offset =3D=3D XIVE_ESB_LOAD_EOI) { xive_esb_read(xsrc, srcno, XIVE_ESB_SET_PQ_00); if (xsrc->status[srcno] & XIVE_STATUS_ASSERTED) { - xive_esb_trigger(xsrc, srcno); + kvmppc_xive_esb_trigger(xsrc, srcno); } return 0; } else { @@ -366,7 +366,7 @@ void kvmppc_xive_source_set_irq(void *opaque, int srcno= , int val) } } =20 - xive_esb_trigger(xsrc, srcno); + kvmppc_xive_esb_trigger(xsrc, srcno); } =20 /* @@ -533,7 +533,7 @@ static void kvmppc_xive_change_state_handler(void *opaq= ue, bool running, * generate a trigger. */ if (pq =3D=3D XIVE_ESB_RESET && old_pq =3D=3D XIVE_ESB_QUEUED)= { - xive_esb_trigger(xsrc, i); + kvmppc_xive_esb_trigger(xsrc, i); } } =20 diff --git a/hw/intc/xive.c b/hw/intc/xive.c index eeb4e62ba9..5ec61ec14e 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -816,7 +816,7 @@ void xive_tctx_destroy(XiveTCTX *tctx) * XIVE ESB helpers */ =20 -static uint8_t xive_esb_set(uint8_t *pq, uint8_t value) +uint8_t xive_esb_set(uint8_t *pq, uint8_t value) { uint8_t old_pq =3D *pq & 0x3; =20 @@ -826,7 +826,7 @@ static uint8_t xive_esb_set(uint8_t *pq, uint8_t value) return old_pq; } =20 -static bool xive_esb_trigger(uint8_t *pq) +bool xive_esb_trigger(uint8_t *pq) { uint8_t old_pq =3D *pq & 0x3; =20 @@ -846,7 +846,7 @@ static bool xive_esb_trigger(uint8_t *pq) } } =20 -static bool xive_esb_eoi(uint8_t *pq) +bool xive_esb_eoi(uint8_t *pq) { uint8_t old_pq =3D *pq & 0x3; =20 diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index 445eccfe6b..7e25c25bfd 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -261,6 +261,10 @@ static inline hwaddr xive_source_esb_mgmt(XiveSource *= xsrc, int srcno) #define XIVE_ESB_QUEUED (XIVE_ESB_VAL_P | XIVE_ESB_VAL_Q) #define XIVE_ESB_OFF XIVE_ESB_VAL_Q =20 +bool xive_esb_trigger(uint8_t *pq); +bool xive_esb_eoi(uint8_t *pq); +uint8_t xive_esb_set(uint8_t *pq, uint8_t value); + /* * "magic" Event State Buffer (ESB) MMIO offsets. * --=20 2.31.1