From nobody Fri Apr 4 03:43:58 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1741699563; cv=none; d=zohomail.com; s=zohoarc; b=ftoc+th1cH+d97v4l/qFeg8GJDGvm8bDJ9O5UdxlpdYj809sgCvDUdoS0RCRIernvQ3MZ/0WPEEL0HH3iL3aPi445fuf88mcwTDTLD1o5kWJO5O1QHZa5GvZdhVKDM5MvKZs75xqGNQKkmXbFfMZBuQ98kZILwFT9u54pf9jNjg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741699563; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s/XBvKPmghhbKFfzwm85aRAZZaLgzLWVK0EV9GNbOE4=; b=BRRVE82MLbAts0stKC4vTzU4TMbyT+DKUjGQGZrEiXKhnYtA/7WRv3Z6zObwsY0/GO8EecFKMzqdFskujQd4YphdQL6vQIKNgj+M6sdGx9XiSZ7tWrltpg6wQKDcdGTc4SUZIGQPnx/xXM3o89M/hPShs6uG575iey/fxfT9ZwI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741699563592633.8984484774074; Tue, 11 Mar 2025 06:26:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1trzKG-000741-Dm; Tue, 11 Mar 2025 09:07:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1trzDW-0004aS-H6; Tue, 11 Mar 2025 09:00:23 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1trzDS-0008IS-9b; Tue, 11 Mar 2025 09:00:18 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-224341bbc1dso67975095ad.3; Tue, 11 Mar 2025 06:00:11 -0700 (PDT) Received: from wheely.local0.net ([118.208.151.101]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ff4e773dddsm11822318a91.12.2025.03.11.06.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Mar 2025 06:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741698009; x=1742302809; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s/XBvKPmghhbKFfzwm85aRAZZaLgzLWVK0EV9GNbOE4=; b=A4yTrPFCvwtbO/SEY6UeeeKqTYgJRD0oP3aNJIMWaXyhxJ94/5Rc2V/TA8LFzfpI9L gEeOgS+OnpbmaQ8LI76paYJs1aH7ogMvGjpKWWkKmjBVbEukuIGpjenjANAC5ixDc5CM xsdPFwyHDJWM0B97kyUPWDRsm1itnFZOLMLZJIbcEPfF/qGHm36ky3Wk/RIzX790TKuf auYvfwy4GAjoIIkj/oofI4MAnp4ntOnSbcaPKvYsK+BnwcX8kZaF/Y14u6TDCcsBpvKQ 41/nor1Wd4VhZjJ79kSuN1alEN6UZitydDgNUAPbCxcxRw+2NTh9SoYQx4hkMr9Z/edt 4PUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741698009; x=1742302809; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s/XBvKPmghhbKFfzwm85aRAZZaLgzLWVK0EV9GNbOE4=; b=HAkr3Xz9/Hg+FmNW+P5vRQ+8F1nyhZpM5xDkIPYvxLzvBkPffAzHsNH7To/HGu5aBX 08aXzcebvO460OrPeEVFpfEvrn60/oHw387S9xILb42N3emcWDUNQOxfxUe10Lx6PiCV VqKKXZucjWxaIFlRlod8krqfNTHQxeCa/wpU861v93OyMU6cdOLHv/MvEO3q7KUeUcw4 xGaqIoj1LrPkiSfeSMkuM0c5KJybgkRpAKEk3QLfU48rHQvo0PKhFMQPGhPxHz2ns3Gg Ov0biT+hsvZZ3n62vdj+TORhiEhLwcJbsARW65nqMxEObrvON/FpZxWm5mWBFpFfKiuH 8isg== X-Forwarded-Encrypted: i=1; AJvYcCWhRU4PHEWFynbcTilie8T/+BK95hYccZNR9Mc8YgilhLt/L8phirT6sgnSX82xbgz4jqVMoOJ9HA==@nongnu.org X-Gm-Message-State: AOJu0YzekYfY+WwnbhfAZWVY2wch9D1ZGMhMll3k5TJe8U0md2CP4RE9 bQj4PWVIL045vLDXVBI/EBbxnPd8tfTDl+u5gxabVOpAqOMdsxGVwkqa9g== X-Gm-Gg: ASbGncubJFjaHH3BDfu/pdgtM25sB7VhwpaeU4kIVNxLRaM69uo3li5Kcc0kVwdayes nnPSWDoV9Aa7WrAQc81hvpmhhvmYJnzSYFEpWR4yoWFTH0wLZiKxvrIFiXW4R9VDahl8TcMd6ZM aO85yS8GDoUqAjJvM01HeXzHDagT5LFJ16pqAx5K9Jq9a07GAGQVNHFM/JTM2XVySM5fxdxR0Pw RfftX3PiptKYDc0M6yuSRRJMhSs1kuxso89CwtT5l4eDBRdFUctwRaMdQHFy11yNBTpWB8dG25m SiX9neP6IQ4ANYMD377rmOLyZIZj7ODXI2z0Sy3o2po9jIVDXXM= X-Google-Smtp-Source: AGHT+IF1qSFvQdY4aQMYNsKVRb3BvJiV+sYcoOGgGY4PNlhMGzMIka3DoYXRPPzXncEghUctBhYk2A== X-Received: by 2002:a17:902:c949:b0:224:78e:4ebe with SMTP id d9443c01a7336-22593183ec4mr45122475ad.33.1741698009287; Tue, 11 Mar 2025 06:00:09 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, Glenn Miles , Glenn Miles Subject: [PULL 33/72] pnv/xive2: Rename nvp_ to nvx_ if they can refer to NVP or NVGC Date: Tue, 11 Mar 2025 22:57:27 +1000 Message-ID: <20250311125815.903177-34-npiggin@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250311125815.903177-1-npiggin@gmail.com> References: <20250311125815.903177-1-npiggin@gmail.com> MIME-Version: 1.0 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=2607:f8b0:4864:20::62b; envelope-from=npiggin@gmail.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1741699564426019000 Content-Type: text/plain; charset="utf-8" From: Glenn Miles The blk/index in some paths may refer to an NVP or an NVGC. When it is not known ahead of time, use the nvx_ prefix to prevent confusion. [npiggin: split out of larger fix patch and reworded] Signed-off-by: Glenn Miles Reviewed-by: Nicholas Piggin Signed-off-by: Nicholas Piggin --- hw/intc/xive2.c | 56 ++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index 5fa8e1b3fb..e925307d0f 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -226,8 +226,8 @@ void xive2_end_pic_print_info(Xive2End *end, uint32_t e= nd_idx, GString *buf) uint32_t qsize =3D xive_get_field32(END2_W3_QSIZE, end->w3); uint32_t qentries =3D 1 << (qsize + 10); =20 - uint32_t nvp_blk =3D xive_get_field32(END2_W6_VP_BLOCK, end->w6); - uint32_t nvp_idx =3D xive_get_field32(END2_W6_VP_OFFSET, end->w6); + uint32_t nvx_blk =3D xive_get_field32(END2_W6_VP_BLOCK, end->w6); + uint32_t nvx_idx =3D xive_get_field32(END2_W6_VP_OFFSET, end->w6); uint8_t priority =3D xive_get_field32(END2_W7_F0_PRIORITY, end->w7); uint8_t pq; =20 @@ -256,7 +256,7 @@ void xive2_end_pic_print_info(Xive2End *end, uint32_t e= nd_idx, GString *buf) xive2_end_is_firmware2(end) ? 'F' : '-', xive2_end_is_ignore(end) ? 'i' : '-', xive2_end_is_crowd(end) ? 'c' : '-', - priority, nvp_blk, nvp_idx); + priority, nvx_blk, nvx_idx); =20 if (qaddr_base) { g_string_append_printf(buf, " eq:@%08"PRIx64"% 6d/%5d ^%d", @@ -372,7 +372,7 @@ static void xive2_end_enqueue(Xive2End *end, uint32_t d= ata) * level of pending group interrupts. */ static uint8_t xive2_presenter_backlog_scan(XivePresenter *xptr, - uint8_t nvp_blk, uint32_t nvp_= idx, + uint8_t nvx_blk, uint32_t nvx_= idx, uint8_t first_group, uint8_t *out_level) { @@ -387,19 +387,19 @@ static uint8_t xive2_presenter_backlog_scan(XivePrese= nter *xptr, =20 while (current_level) { mask =3D (1 << current_level) - 1; - nvgc_idx =3D nvp_idx & ~mask; + nvgc_idx =3D nvx_idx & ~mask; nvgc_idx |=3D mask >> 1; qemu_log("fxb %s checking backlog for prio %d group idx %x\n", __func__, prio, nvgc_idx); =20 - if (xive2_router_get_nvgc(xrtr, false, nvp_blk, nvgc_idx, &nvg= c)) { + if (xive2_router_get_nvgc(xrtr, false, nvx_blk, nvgc_idx, &nvg= c)) { qemu_log_mask(LOG_GUEST_ERROR, "XIVE: No NVG %x/%x\n", - nvp_blk, nvgc_idx); + nvx_blk, nvgc_idx); return 0xFF; } if (!xive2_nvgc_is_valid(&nvgc)) { qemu_log_mask(LOG_GUEST_ERROR, "XIVE: Invalid NVG %x/%x\n", - nvp_blk, nvgc_idx); + nvx_blk, nvgc_idx); return 0xFF; } =20 @@ -415,7 +415,7 @@ static uint8_t xive2_presenter_backlog_scan(XivePresent= er *xptr, } =20 static void xive2_presenter_backlog_decr(XivePresenter *xptr, - uint8_t nvp_blk, uint32_t nvp_idx, + uint8_t nvx_blk, uint32_t nvx_idx, uint8_t group_prio, uint8_t group_level) { @@ -425,17 +425,17 @@ static void xive2_presenter_backlog_decr(XivePresente= r *xptr, =20 group_level &=3D 0xF; mask =3D (1 << group_level) - 1; - nvgc_idx =3D nvp_idx & ~mask; + nvgc_idx =3D nvx_idx & ~mask; nvgc_idx |=3D mask >> 1; =20 - if (xive2_router_get_nvgc(xrtr, false, nvp_blk, nvgc_idx, &nvgc)) { + if (xive2_router_get_nvgc(xrtr, false, nvx_blk, nvgc_idx, &nvgc)) { qemu_log_mask(LOG_GUEST_ERROR, "XIVE: No NVG %x/%x\n", - nvp_blk, nvgc_idx); + nvx_blk, nvgc_idx); return; } if (!xive2_nvgc_is_valid(&nvgc)) { qemu_log_mask(LOG_GUEST_ERROR, "XIVE: Invalid NVG %x/%x\n", - nvp_blk, nvgc_idx); + nvx_blk, nvgc_idx); return; } count =3D xive2_nvgc_get_backlog(&nvgc, group_prio); @@ -443,7 +443,7 @@ static void xive2_presenter_backlog_decr(XivePresenter = *xptr, return; } xive2_nvgc_set_backlog(&nvgc, group_prio, count - 1); - xive2_router_write_nvgc(xrtr, false, nvp_blk, nvgc_idx, &nvgc); + xive2_router_write_nvgc(xrtr, false, nvx_blk, nvgc_idx, &nvgc); } =20 /* @@ -1289,8 +1289,8 @@ static void xive2_router_end_notify(Xive2Router *xrtr= , uint8_t end_blk, uint8_t priority; uint8_t format; bool found, precluded; - uint8_t nvp_blk; - uint32_t nvp_idx; + uint8_t nvx_blk; + uint32_t nvx_idx; =20 /* END cache lookup */ if (xive2_router_get_end(xrtr, end_blk, end_idx, &end)) { @@ -1355,10 +1355,10 @@ static void xive2_router_end_notify(Xive2Router *xr= tr, uint8_t end_blk, /* * Follows IVPE notification */ - nvp_blk =3D xive_get_field32(END2_W6_VP_BLOCK, end.w6); - nvp_idx =3D xive_get_field32(END2_W6_VP_OFFSET, end.w6); + nvx_blk =3D xive_get_field32(END2_W6_VP_BLOCK, end.w6); + nvx_idx =3D xive_get_field32(END2_W6_VP_OFFSET, end.w6); =20 - found =3D xive_presenter_notify(xrtr->xfb, format, nvp_blk, nvp_idx, + found =3D xive_presenter_notify(xrtr->xfb, format, nvx_blk, nvx_idx, xive2_end_is_crowd(&end), xive2_end_is_ignore(&e= nd), priority, xive_get_field32(END2_W7_F1_LOG_SERVER_ID, end.w= 7), @@ -1389,15 +1389,15 @@ static void xive2_router_end_notify(Xive2Router *xr= tr, uint8_t end_blk, Xive2Nvp nvp; =20 /* NVP cache lookup */ - if (xive2_router_get_nvp(xrtr, nvp_blk, nvp_idx, &nvp)) { + if (xive2_router_get_nvp(xrtr, nvx_blk, nvx_idx, &nvp)) { qemu_log_mask(LOG_GUEST_ERROR, "XIVE: no NVP %x/%x\n", - nvp_blk, nvp_idx); + nvx_blk, nvx_idx); return; } =20 if (!xive2_nvp_is_valid(&nvp)) { qemu_log_mask(LOG_GUEST_ERROR, "XIVE: NVP %x/%x is invalid= \n", - nvp_blk, nvp_idx); + nvx_blk, nvx_idx); return; } =20 @@ -1409,7 +1409,7 @@ static void xive2_router_end_notify(Xive2Router *xrtr= , uint8_t end_blk, ipb =3D xive_get_field32(NVP2_W2_IPB, nvp.w2) | xive_priority_to_ipb(priority); nvp.w2 =3D xive_set_field32(NVP2_W2_IPB, nvp.w2, ipb); - xive2_router_write_nvp(xrtr, nvp_blk, nvp_idx, &nvp, 2); + xive2_router_write_nvp(xrtr, nvx_blk, nvx_idx, &nvp, 2); } else { Xive2Nvgc nvgc; uint32_t backlog; @@ -1422,15 +1422,15 @@ static void xive2_router_end_notify(Xive2Router *xr= tr, uint8_t end_blk, * counters are stored in the NVG/NVC structures */ if (xive2_router_get_nvgc(xrtr, crowd, - nvp_blk, nvp_idx, &nvgc)) { + nvx_blk, nvx_idx, &nvgc)) { qemu_log_mask(LOG_GUEST_ERROR, "XIVE: no %s %x/%x\n", - crowd ? "NVC" : "NVG", nvp_blk, nvp_idx); + crowd ? "NVC" : "NVG", nvx_blk, nvx_idx); return; } =20 if (!xive2_nvgc_is_valid(&nvgc)) { qemu_log_mask(LOG_GUEST_ERROR, "XIVE: NVG %x/%x is invalid= \n", - nvp_blk, nvp_idx); + nvx_blk, nvx_idx); return; } =20 @@ -1442,11 +1442,11 @@ static void xive2_router_end_notify(Xive2Router *xr= tr, uint8_t end_blk, */ backlog =3D xive2_nvgc_get_backlog(&nvgc, priority) + 1; xive2_nvgc_set_backlog(&nvgc, priority, backlog); - xive2_router_write_nvgc(xrtr, crowd, nvp_blk, nvp_idx, &nvgc); + xive2_router_write_nvgc(xrtr, crowd, nvx_blk, nvx_idx, &nvgc); =20 if (backlog =3D=3D 1) { XiveFabricClass *xfc =3D XIVE_FABRIC_GET_CLASS(xrtr->xfb); - xfc->broadcast(xrtr->xfb, nvp_blk, nvp_idx, + xfc->broadcast(xrtr->xfb, nvx_blk, nvx_idx, xive2_end_is_crowd(&end), xive2_end_is_ignore(&end), priority); --=20 2.47.1