From nobody Tue Feb 10 10:55:20 2026 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; 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 ARC-Seal: i=1; a=rsa-sha256; t=1562050669; cv=none; d=zoho.com; s=zohoarc; b=CUOvC6744WQu5N7+w1oZfxh8Y3zR0czPn4XjNEHHnNPXTD0HzF180y63T9dragRnhkxBxL0LH8j2+EHnKLeL62vwrPARt8ElCdikL3QkL0gLOl4plbd/QhZtDmdPjuqnNQiSeVbT9UeiEE2eN/Bc7Y+PHIHdnUP2kYZ9Mg1AoPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562050669; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=mwPt5P2VK4SrNnIjlnEi0+5qrtDr8dYe3Hshfth54M4=; b=FI01SMSDzhTk9mqM2vBOrpNSxcboYeTyEdu6U8wkNNREamHAJKEZ3LaEeBk3t8FqpqyUASGtEbeBAG/sr4vNwo8Rvshmn16ojS9gAJUai1eww4YA1wqsxi5B/+uaLRvrXg+wCutY9CEl7U2WOENytWHjkPLC2pbvx8AOh9wMX1w= ARC-Authentication-Results: i=1; mx.zoho.com; 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 156205065374591.291383386593; Mon, 1 Jul 2019 23:57:33 -0700 (PDT) Received: from localhost ([::1]:49680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiCjK-0002RG-Le for importer@patchew.org; Tue, 02 Jul 2019 02:57:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59018) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiBzk-0005mN-IB for qemu-devel@nongnu.org; Tue, 02 Jul 2019 02:10:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiBzi-0003RB-Cj for qemu-devel@nongnu.org; Tue, 02 Jul 2019 02:10:24 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:54353 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiBze-0003Ge-MY; Tue, 02 Jul 2019 02:10:20 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 45dDMn47LLz9sR0; Tue, 2 Jul 2019 16:09:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1562047749; bh=L8RTgpO7LVRVvS97dvoPx+3IeaI/B7AJ/BHfgV0BYv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GZ0dLL3GtuH4Ys4iH/V9Moa1/U14bauUO0P3WfgxoJy5GoWiSi1o5PasNcCZRyXKL FaUawGKkzL0/8pD8pePbIgIXQ5/qi+64JLGDHws+ogQ0CXkzzkA0/9MSXrNF23Q+pj 2LEgi32czC0aZlYwv0SWhv+UhGHGqKmYDD9ftBao= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 2 Jul 2019 16:08:53 +1000 Message-Id: <20190702060857.3926-46-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190702060857.3926-1-david@gibson.dropbear.id.au> References: <20190702060857.3926-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 45/49] ppc/xive: Force the Physical CAM line value to group mode 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: lvivier@redhat.com, aik@ozlabs.ru, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater When an interrupt needs to be delivered, the XIVE interrupt controller presenter scans the CAM lines of the thread interrupt contexts of the HW threads of the chip to find a matching vCPU. The interrupt context is composed of 4 different sets of registers: Physical, HV, OS and User. The encoding of the Physical CAM line depends on the mode in which the interrupt controller is operating: CAM mode or block group mode. Block group mode being the default configuration today on POWER9 and the only one available on the next POWER10 generation, enforce this encoding in the Physical CAM line : chip << 19 | 0000000 0 0001 thread (7Bit) It fits the overall encoding of the NVT ids and simplifies the matching algorithm in the presenter. Fixes: d514c48d41fb ("ppc/xive: hardwire the Physical CAM line of the threa= d context") Signed-off-by: C=C3=A9dric Le Goater Message-Id: <20190630204601.30574-2-clg@kaod.org> Signed-off-by: David Gibson --- hw/intc/xive.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 6250c0414d..3b1f9520ae 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -1229,27 +1229,16 @@ XiveTCTX *xive_router_get_tctx(XiveRouter *xrtr, CP= UState *cs) } =20 /* - * By default on P9, the HW CAM line (23bits) is hardwired to : + * Encode the HW CAM line in the block group mode format : * - * 0x000||0b1||4Bit chip number||7Bit Thread number. - * - * When the block grouping is enabled, the CAM line is changed to : - * - * 4Bit chip number||0x001||7Bit Thread number. + * chip << 19 | 0000000 0 0001 thread (7Bit) */ -static uint32_t hw_cam_line(uint8_t chip_id, uint8_t tid) -{ - return 1 << 11 | (chip_id & 0xf) << 7 | (tid & 0x7f); -} - -static bool xive_presenter_tctx_match_hw(XiveTCTX *tctx, - uint8_t nvt_blk, uint32_t nvt_idx) +static uint32_t xive_tctx_hw_cam_line(XiveTCTX *tctx) { CPUPPCState *env =3D &POWERPC_CPU(tctx->cs)->env; uint32_t pir =3D env->spr_cb[SPR_PIR].default_value; =20 - return hw_cam_line((pir >> 8) & 0xf, pir & 0x7f) =3D=3D - hw_cam_line(nvt_blk, nvt_idx); + return xive_nvt_cam_line((pir >> 8) & 0xf, 1 << 7 | (pir & 0x7f)); } =20 /* @@ -1285,7 +1274,7 @@ static int xive_presenter_tctx_match(XiveTCTX *tctx, = uint8_t format, =20 /* PHYS ring */ if ((be32_to_cpu(qw3w2) & TM_QW3W2_VT) && - xive_presenter_tctx_match_hw(tctx, nvt_blk, nvt_idx)) { + cam =3D=3D xive_tctx_hw_cam_line(tctx)) { return TM_QW3_HV_PHYS; } =20 --=20 2.21.0