From nobody Mon Nov 23 04:28:06 2026 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793726801; cv=none; d=zohomail.com; s=zohoarc; b=VKlw9AVvNXrTc2gkIZU1X668ZwS2hvEDtwV505xD5joie33t8Z7YS71pqqXnANMYkUmP66cnJgR4aMTtplJAv7nsaBrFymfvG/hZokmihNyG/vZKPCpZY/ZCBdvIxC5mKcPVfaB9+z3PU2dHshzTNe92tABmnCQRPH6vXLm2bM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793726801; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=t7evk/PGY2aqSKb/cWcU+O9P2cepKPm4a8WtSjNhe3M=; b=lSFhe6VbkTYGD94vRXxF0Df7Eulp0oUcgzC4iXnOJbat0u6gcrNulKndyHit85jHuZmfLpQjgcrBE1OPATGzfO/MFI9DmRxpGWhgplqbxsRq2oIo6ai2XN4cDnTIK+u2ss+wfO49ass+mXPsM+hzr8rH4uhUYqmrlzudVI+5P20= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793726801373288.2449132434725; Tue, 3 Nov 2026 09:26:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOIHB-00007M-Bb; Tue, 03 Nov 2026 12:26:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOIH9-000068-6r for qemu-devel@nongnu.org; Tue, 03 Nov 2026 12:26:23 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xOIH6-0006Pz-TP for qemu-devel@nongnu.org; Tue, 03 Nov 2026 12:26:22 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4a2000d5fb1so30907565e9.1 for ; Tue, 03 Nov 2026 09:26:20 -0800 (PST) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ac0950d533sm211082605e9.3.2026.11.03.09.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2026 09:26:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793726779; x=1794331579; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=t7evk/PGY2aqSKb/cWcU+O9P2cepKPm4a8WtSjNhe3M=; b=BMfVCHDHBfzsYBaPF142daHbpW3/U9C2ixwwymmhrcDRI8A/jEPH/LZk6RiVRmDWEk MkTmn/8gm7J/MPZ7K/P5WWPkwqD8absx9S36kzubZ6GfSI2vNLDuR5yTZqoAOkg5Xp3d pu4QHy/jt4T6oOdmp+Ai4K0IA2oV0sNmCBwSCmE/cPU/q0ETKxVY7yVZZLzSefpl+rcW RIqEOByukU+FH4SO7pAFVohi7zDEPLc4E8L6p//XsGacbEYdfSl6UGYoL/y8WVgTI08N ejcZYP5glJJqIBuOVnSYIOz4e7mJLxng05QpLwwu0NZFw8RB2cyMw2ZCFD5z/3fc5HOk Cafg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793726779; x=1794331579; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=t7evk/PGY2aqSKb/cWcU+O9P2cepKPm4a8WtSjNhe3M=; b=ZGLuaTNgXTlkNQEC8/X9NRcYZq2vFEBx//GmxTgWEP9gu2wLnl27ifYX7rX29LH/CX 12v73Yu0eGVTLxcAonZoj8P1BL3TfVEBq3SJpR7aPtovR3mZRcmBN0Ddy8mOa1a1cNLn kddIoLzHqFWZCiCi1lUerCIKgr8o67CyIxKaZnFYV8QfRCiVLIyn2ouC6xiqY6Uz1qtW 6yGX4zp1qNggpzP3O1wmUmgKRSJaxHzeAnLuRR9WyVClzTqkZRpjO1xnQT57ttkqvrgx JwnD5pWqveLD9T0Zgajwwxplj396q6hhh794U9m1Q5x/B6ldCvjrbay4q5FRmjTQtwxa 2FTw== X-Forwarded-Encrypted: i=1; AKwUvBw8c+LOOU4uuBWEga/N+kG9yaaVRwsazelMG5V9qrOEps+Otnbl6NarsatEMlYEH4pXbxDjRLyZD7J0@nongnu.org X-Gm-Message-State: APuU4Z+CckR8/tKAiuvyllBHOeAixsD7jjidSsDnivQ+YxVDs7IZYyUR /mJOzwWj+/V5Jyz80jOQLQ+yIePqC3yTYpJC9wvSum71qt0WwPq/rw5Kq/nV6zwAsaM= X-Gm-Gg: AYBFou1s6PRzPfTGwV5S7xLG7qYvG/kH97FJHNI8Pp4j216jZPzhbqF+KsAEDW5AFdt WgiwYa9Cf0AWGjwfMP/IghTW0tq8ISbm5PBqpkbsq3c8/Hx3FBQ+Uqo7SsEZIuInK07rEnZ3cAK eC2k7mL947521ApwoxAwJfjAci8lY9BcnL5ESiCTfZi+QXnwcJWAW0LSKiU3S6JeoQHATXnGqH3 vSgJvP7yomBrYLsfbyp3/xv/SjjJ9B77qahZ0woDScC9X/rpsOmK+/w5D0Ai3KRi7BZyHzkAw3O AgqH7Qpo0jQTYJq3aLOzuqPMC7Vv96m+vVl3KqxkBHE2yOXQbwe6FDhHzKep1zO5JIvZTlwukcQ s/IO8pgOtmSh3MzIrZx8h5wJ7jsPSF2W5GQF8W3zAu7p5dv+iHixDcuF1YFBsPNtZpuiz8KLEaO 54qQ1Bb9dNw0DzUAYVwC36klwlms+/R3NVKt1bN9BJN7xjJfr/hwGeOWfqTREBq6c0hR4JE37aj YlqREXp2yoJXI9yJrM6A5LrRNtQFktSjVebVrLEqiLc6DbJ9xT6JLBveL+LJovQBnkDnqFV/wcf cPEhLU4uXavStOI4psm5kdIluCxWn2IVYSgmQydEGC6RMIBtvYyLs28Xlua2+2POtj8zOUIuVEE PSyJ+GjAiXzyGC+ybCte50D1ZJB3hM6MvtQ== X-Received: by 2002:a05:600c:a11b:b0:4b2:3c81:d1 with SMTP id 5b1f17b1804b1-4b23c810353mr76095235e9.5.1793726779360; Tue, 03 Nov 2026 09:26:19 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.2 1/4] hw/intc/arm_gicv5: Use cached IRS_IST_BASER.VALID state Date: Tue, 3 Nov 2026 17:26:13 +0000 Message-ID: <20261103172616.2400758-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261103172616.2400758-1-peter.maydell@linaro.org> References: <20261103172616.2400758-1-peter.maydell@linaro.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1793726802794158500 Content-Type: text/plain; charset="utf-8" When the guest writes to IRS_IST_BASER we effectively cache the value of the VALID bit in the GICv5ISTConfig valid field entry. In a few places we check whether the IST is valid by doing a bit extract on the register value; switch those to look at cfg->structure instead. Signed-off-by: Peter Maydell Reviewed-by: Jim MacArthur --- hw/intc/arm_gicv5.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/intc/arm_gicv5.c b/hw/intc/arm_gicv5.c index 5d0a50ab6aa..d0a8574916b 100644 --- a/hw/intc/arm_gicv5.c +++ b/hw/intc/arm_gicv5.c @@ -1222,8 +1222,7 @@ static void irs_map_l2_istr_write(GICv5 *s, GICv5Doma= in domain, uint64_t value) uint64_t l1_iste; MemTxResult res; =20 - if (!FIELD_EX64(cs->irs_ist_baser[domain], IRS_IST_BASER, VALID) || - !cfg->structure) { + if (!cfg->valid || !cfg->structure) { /* WI if no IST set up or it is not 2-level */ return; } @@ -1293,7 +1292,7 @@ static void irs_ist_baser_write(GICv5 *s, GICv5Domain= domain, uint64_t value) { GICv5Common *cs =3D ARM_GICV5_COMMON(s); =20 - if (FIELD_EX64(cs->irs_ist_baser[domain], IRS_IST_BASER, VALID)) { + if (s->phys_lpi_config[domain].valid) { /* If VALID is set, ADDR is RO and we can only update VALID */ bool valid =3D FIELD_EX64(value, IRS_IST_BASER, VALID); if (valid) { @@ -1604,7 +1603,7 @@ static bool config_writel(GICv5 *s, GICv5Domain domai= n, hwaddr offset, deposit64(cs->irs_ist_baser[domain], 32, 32, d= ata)); return true; case A_IRS_IST_CFGR: - if (FIELD_EX64(cs->irs_ist_baser[domain], IRS_IST_BASER, VALID)) { + if (s->phys_lpi_config[domain].valid) { qemu_log_mask(LOG_GUEST_ERROR, "guest tried to write IRS_IST_CFGR for %s config= frame " "while IST_BASER.VALID set\n", domain_name[domai= n]); --=20 2.43.0 From nobody Mon Nov 23 04:28:06 2026 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793726824; cv=none; d=zohomail.com; s=zohoarc; b=fAawl8VqJUUy0qDmgiwtiDC38JMK5f0YsQJ7wJY6FcCaPJIYQekL1gDkccR4/g8QXm0Hdk4Mw1JVtleAh9CMptTEykM6WYGU5j13Ou3lk1hQG9clCi8ewqhzVx3jR7fxJNKdbZ5xDr7k4kWTdVJEDpiS2Ds5n2eKuECUkuE/6e0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793726824; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=FJKfVYm6VIqMavFwLhCg7yl/Tg1YqwuMPiBUuINmP8s=; b=Wp8H14wT7/jgQKUZeOKHV1GwWelKPPnwlsDcgCFPeiyynqo2kzMtln8wQBacpHUvL7V07ZOuRRVFdyLYAu+3mJy03V3HyYKcblPZRw1xqYF/Aq9Uug7Uenv0kAkQHa91cdo0G+XVRxc2CCGOtDYd+FS0c29Hhk8PW41PfYohkME= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793726824833899.5799049997645; Tue, 3 Nov 2026 09:27:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOIHJ-00008t-1g; Tue, 03 Nov 2026 12:26:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOIHA-000075-Dq for qemu-devel@nongnu.org; Tue, 03 Nov 2026 12:26:24 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xOIH8-0006Q9-HO for qemu-devel@nongnu.org; Tue, 03 Nov 2026 12:26:24 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4a549cd7fd2so9719115e9.0 for ; Tue, 03 Nov 2026 09:26:22 -0800 (PST) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ac0950d533sm211082605e9.3.2026.11.03.09.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2026 09:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793726781; x=1794331581; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=FJKfVYm6VIqMavFwLhCg7yl/Tg1YqwuMPiBUuINmP8s=; b=aVv6hNdl/k6UMSq2E8XU1wIe3GvAjdC8Vwfyc94ff9J8CbCiql6Pv6lcAMuAIUjye0 ctC67Jgf/bYp6Wi6oYbwFk8JxwzWuVpaeOsrkhMS2QQrPbNAU5VAeduzZn8E+01x77fn n+oEncnXkBXd9/VYyf7+lCiXUyAb9db1aMENFoRHxzeshzVjbh3CQJj2z6Htuuoc2dZ1 tcQ6W/H30VUAEUeTGEtBZriLznVRPnTYj5SU4y4Mfh7mdc0f6G/Nd+X9N0j2VqcFYZeC juRcPa0B5SKM7T83L5Tp2dZIw/DweiFQ+9NQTX0IAGPdBduo5pvl2YmprIjcCqQBaBOE fQdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793726781; x=1794331581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=FJKfVYm6VIqMavFwLhCg7yl/Tg1YqwuMPiBUuINmP8s=; b=Rgd/j2YZ06AKGuaIpRj5II8zp0bPTQIS18GzmUPbi7TBXfuXpvx/XQQYzJPAUh/JGk hr36ms+2LFhrxZTzrmDNUEL/pbix7u1/2IbOkSiR6h9j88+rdC0VDSh5TUh4DAmWV+Q0 Mz21jU6Rj3CIBq+vQ+fdtIN5c8c2vJylP6ltG8Hc7qGLfLPT9SAFFbwrVzu9d2L56fFs pFmFc0KOfODuxuyXkcN2aO8Zc5mJ4v+mQfy4DU2KtKlrWQvHAF+1VgJnrQjopFe/oGuX sIlkxKJaMd/b9W8F9G+6aVtq/fDikOfkceYVm3Ta4nm1P15/F8aes42uz39v9GNc9sQE UOIg== X-Forwarded-Encrypted: i=1; AKwUvBwR1orld2KxF8aN0TN7PoJ7jarKpFZc3kCS5FJlAa4JaznSlvN1kRkplaDhdaRryMslm21i86RICMe4@nongnu.org X-Gm-Message-State: APuU4Z+sZa7sjrbZp7NjHRgrIL5XjhUbPEOG9S5D/ZFq8U48Qh9gHM+r 0UzyL4BvDlswljuhM56ieF+Lau60BDZn7uHfveLL64ZoYt+elnejH74CWXBjTaOo8FM= X-Gm-Gg: AYBFou1R+LFWLfVk95CmHUiHJtcN/tVvjq6I5GqkcDshqeJTTzgpe3TjIKi/qAgumH/ ks5SN++SD84W6MWDoxr3oOrEoZfK8IA5mxsSsLUkUMZSehM9Jjek2Mo59raOamdCP3iPSUHDplK BWjUs1ECrn6Vmi1Ny7mtHXz5iFW0MM19F2I1vkJT5PbbsTXw+Q5oCzN7vZnuaEyn6T112oR8t6Y /yawAsVOBVdgwm35hIdNZJUT3BDi6wK7/OQpYJz454Z676sOKq4C9mzRXRyeQ3m+T+Q2RycONcT 3eK6zsixe+9nEFkaPcrxXAZKoEFr1cD2B4C5MAl0vJp+d+AC30hkNrfcqE++ixQomXYmQsA7Evf 01KotUNDqYktYPq7Pi+kVKnAbuzj0BVNfcOFgwnwza1GnaO4eWSHy7tbnF1QzQLxqi8d8ZP23sR ca2366AleBk9Q20Li+EHAHkpb19r3jegnLSxZE6cepVud+z9HDiIM7oWBpCeqMeqFsDD7sFX/T+ qqao6V5cEIaVRGZheRg/CC1KM6h928xcIHThkbnCwu0FURdxaQsIxz2LeVx4W+k/IIgagsoI8/g cVbXCYe3Cp5M0UicFHTynRbDecNQqLrlR6W1CjO4VLQvNzTE/Yk+U+CH/aMeXgsIaAdJlZcQEv1 E8rYAjb/zgcRF8xAxvai4u7SIDNlz1in+Lw== X-Received: by 2002:a05:600c:64c9:b0:4a2:180a:3417 with SMTP id 5b1f17b1804b1-4ac14dd1debmr327086745e9.1.1793726781071; Tue, 03 Nov 2026 09:26:21 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.2 2/4] hw/intc/arm_gicv5: Free memory in finalize Date: Tue, 3 Nov 2026 17:26:14 +0000 Message-ID: <20261103172616.2400758-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261103172616.2400758-1-peter.maydell@linaro.org> References: <20261103172616.2400758-1-peter.maydell@linaro.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32e.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1793726826816158500 Content-Type: text/plain; charset="utf-8" The GICv5 allocates memory and creates hashtables during realize and as part of its operation. Free those resources in finalize. Since the GICv5 is created at QEMU startup and remains in existence for the lifetime of the process, this isn't an in-practice leak, only a theoretical one. Signed-off-by: Peter Maydell Reviewed-by: Jim MacArthur --- hw/intc/arm_gicv5.c | 11 +++++++++++ hw/intc/arm_gicv5_common.c | 3 +++ 2 files changed, 14 insertions(+) diff --git a/hw/intc/arm_gicv5.c b/hw/intc/arm_gicv5.c index d0a8574916b..fd6456cd8aa 100644 --- a/hw/intc/arm_gicv5.c +++ b/hw/intc/arm_gicv5.c @@ -1970,6 +1970,17 @@ static void gicv5_init(Object *obj) =20 static void gicv5_finalize(Object *obj) { + GICv5 *s =3D ARM_GICV5(obj); + + for (int i =3D 0; i < NUM_GICV5_DOMAINS; i++) { + GHashTable *ht =3D s->phys_lpi_config[i].lpi_cache; + + if (ht) { + g_hash_table_destroy(ht); + } + + g_free(s->hppi[i]); + } } =20 static void gicv5_class_init(ObjectClass *oc, const void *data) diff --git a/hw/intc/arm_gicv5_common.c b/hw/intc/arm_gicv5_common.c index 2920b11cc39..cfadfee4f05 100644 --- a/hw/intc/arm_gicv5_common.c +++ b/hw/intc/arm_gicv5_common.c @@ -112,6 +112,9 @@ static void gicv5_common_init(Object *obj) =20 static void gicv5_common_finalize(Object *obj) { + GICv5Common *cs =3D ARM_GICV5_COMMON(obj); + + g_free(cs->spi); } =20 static void gicv5_common_realize(DeviceState *dev, Error **errp) --=20 2.43.0 From nobody Mon Nov 23 04:28:06 2026 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793726824; cv=none; d=zohomail.com; s=zohoarc; b=mxxC4uXaqliCJTspO7Fh1fj/7RP/AtC4p776P7Yh2P+1Z9qeULpgn5FsdW3WWCf9zvRsMu0OSkEqbvMwCkM2MyMbXBPXEhT6hlgNxnwNc4p/zmGkAKgAWL7PS0TwyvyThxLqJgUFxBznKiESAOzAwn6YxNdpp+Z2d6KLcqGwlg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793726824; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=34KHtRevO4j1KwkNGPsiHWeCTNRp5jN9Be6wHWBz8uI=; b=e1DbGreJH2XpP+ydrRu3n42AHsPpbhybgl0Uz+xTzTnnbicFsmEpDapTg2q2Qb59Zpfl4E5jGrt5bAt/NO6gm+XFDdk5XB+szTHuWdAVZrXzdqJkZHF8i5MU+Q5v29d2PeR573Fg9q1KZ7Tr52NJ4KYTD2w2e+XZx1CJ4MCvgUM= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793726824480754.7931201040303; Tue, 3 Nov 2026 09:27:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOIHQ-0000CA-HW; Tue, 03 Nov 2026 12:26:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOIHB-00007p-SW for qemu-devel@nongnu.org; Tue, 03 Nov 2026 12:26:27 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xOIHA-0006QX-0p for qemu-devel@nongnu.org; Tue, 03 Nov 2026 12:26:25 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4a4dc547987so22663825e9.0 for ; Tue, 03 Nov 2026 09:26:23 -0800 (PST) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ac0950d533sm211082605e9.3.2026.11.03.09.26.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2026 09:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793726782; x=1794331582; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=34KHtRevO4j1KwkNGPsiHWeCTNRp5jN9Be6wHWBz8uI=; b=UfjfKAgca6rpLEwkaJGpsOhNmf62nh614jBF3a76FSH2Ql3XxpyyDBN/Mi1cBQpsLw fbezKnUFI1AEiPQfw9kFPqRA/KpgBYhceK/0wd+vjDPl6JafQgMQzWyCUFHDkeBZWn6v QIsTANCEmDqoWeypiKsYUGX1qpyiqTA8/unkrcCx0DO/XsgQcBi4t+rF01QvEQoBpKSB w+F+wqGGWtZNSsGbzkvhnm3zZ/f6BgkFbS02TOhwhThXjZg2lm2sTZJijMczead44sRt kauGuPQq4C56PGJ70jwnQZfi/vlPpppOwc2xm2mNBxqyoZW8us8c3xjlX4sA01oG/a8x oVIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793726782; x=1794331582; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=34KHtRevO4j1KwkNGPsiHWeCTNRp5jN9Be6wHWBz8uI=; b=aEKVG68+iXdbjCElVsLjNOhgzn5IDkxcIyVjgHaE/bSh1BYv8T5WIvWNvs9WLaJGRx t9Foe0zeZBJqG/otLlgt3gHhSTE1p8Uwd3l9LPlpJCB24IMW6Gu541XNJP5QmFp3BoeP HiEhoOCe2A8j/cEAwUWQNsV9DRg0MGsnKdWAAuDm6hu6yNIY42rf1bIm7b6GXjlNWTeh C1OeWIqjWs76p+YyPf01qGZ+x8VmHbPCFUhsCHDrr5WOD7h5ryTQWxmxbMrNG2WB9afh X9tG/8AmgExstosAESmPCVaEdu9RI64a3BaYvRExr80r4WtphyBJOa8UR0lPv0sQr2Z5 gOLQ== X-Forwarded-Encrypted: i=1; AKwUvByp7bMdcw7FvOzt+kmB9ju0r2RahDa/kK3KMplzRLu6+lvNN6t37km0RFvgYlhL9rIvv3boGx+FjGnG@nongnu.org X-Gm-Message-State: APuU4Z9Bb1hAP0/VtJWswCJ9bpQK76KXDC3K57J8fOTkqWJfuQiT2wE8 XOy9Zf1EmJB3rgGExFCDBAh/Bm8YvHwXJlRDlmX9rAOgFIhCDGs6lgujZ+faZEQGPA3KcPcxFvv +lC+rAJE= X-Gm-Gg: AYBFou1o5ThEn07exhE5gmY7666FVi9+OimnB/O04YMylt2Q7ygbcIAZzMmTpE+ueb/ 0MMONA4ZJvOwSx3uqdRo/TKzMkD9/y5baIKx/gPtYuNl9urOC7pqWBovb/ioAwIew2d33buUjVZ 47FGM+bk/hhZBeLPKgvVO2flgN5wATnLQyDnl7XMtgXhMZTxqNYCrVl+n59j31yujlzXf+IvpIa QyeDpwYlbacURy4Re4Va7j+KOSzEzeNRSLOBWIRrT0px8y/zmVLqMVnVHzDCHlkVTX5hkCstG6D UnC/Gd39w1bxmt/8vrm2rVZEqg/qL56jLs7nkLTAKLeYDDIIOute22ErGFeI3KTTlMLLraiQ46C jceLUYpngJCTQgjG63F8VxN3zDA7NHFy5K15k/eqEv5Vwce/+0THN0BxGScBJ4BZpUBQWKvDk9O 1vU6J91vMoQ2qXEK68kDngMb77X8jwvgrcd+Sk9kb7pBxfXmzaIujF83D0Xt5aAmeJwH+qfmwtP j9cv+CMx8aOdOWDVUyvGvDd69xW8bOM756s6RBkXwB3LNF8ldC99u+XdwIxoD0dhw5JA3RUlEnd xtoKhOUJl87cPbP9Zv3iMSmP5MSSZSBoqr061dJE24G1ZDa0YRoWeNCXb5G4DsUAyjaOnMPYFEe I2nwPmIsQ7cVgOrevAhMFG0HNQcoIprr43/c= X-Received: by 2002:a05:600c:468c:b0:4a3:59c9:a750 with SMTP id 5b1f17b1804b1-4ac17d168bcmr321244145e9.9.1793726782487; Tue, 03 Nov 2026 09:26:22 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.2 3/4] target/arm: Only allow GICv5 on CPUs without AArch32 at EL1..3 Date: Tue, 3 Nov 2026 17:26:15 +0000 Message-ID: <20261103172616.2400758-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261103172616.2400758-1-peter.maydell@linaro.org> References: <20261103172616.2400758-1-peter.maydell@linaro.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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, 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: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1793726826863158500 Content-Type: text/plain; charset="utf-8" We previously allowed the GICv5 on any 64-bit CPU, with a hack where enabling the GICv5 silently disabled AArch32 for EL1..3. Now that we have a separate 'max-v8' and 'max-v9' where max-v9 correctly doesn't implement AArch32 at EL1..3, we can fix the "when do we expose the has_gcie property" condition so that we only allow the GICv5 when AArch32 doesn't exist above EL0, and remove the hack disabling AArch32. We could instead have defined a new ARM_FEATURE_V9, but "allow the feature to be present on CPUs where it doesn't actively break anything" fits the way we've generally handled things in QEMU, and it avoids having a new V9 feature bit that we only use for this one thing and where it's not clear when we should be setting it for KVM, hvf, etc accelerators. In practice the only CPUs which will allow GICv5 now are max, max-v9 and a64fx. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/cpu-features.h | 8 ++++++++ target/arm/cpu.c | 37 +++++++------------------------------ 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/target/arm/cpu-features.h b/target/arm/cpu-features.h index 96ec12f64f4..b0edec28378 100644 --- a/target/arm/cpu-features.h +++ b/target/arm/cpu-features.h @@ -1130,6 +1130,14 @@ static inline bool isar_feature_aa64_aa32_el3(const = ARMISARegisters *id) return FIELD_EX64_IDREG(id, ID_AA64PFR0, EL3) >=3D 2; } =20 +static inline bool isar_feature_aa64_aa32_above_el0(const ARMISARegisters = *id) +{ + /* True if any EL above EL0 has AArch32 support */ + return isar_feature_aa64_aa32_el1(id) || + isar_feature_aa64_aa32_el2(id) || + isar_feature_aa64_aa32_el3(id); +} + static inline bool isar_feature_aa64_ras(const ARMISARegisters *id) { return FIELD_EX64_IDREG(id, ID_AA64PFR0, RAS) !=3D 0; diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 71681447b21..dde03ffdd6f 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1596,8 +1596,13 @@ static void arm_cpu_post_init(Object *obj) &cpu->rvbar_prop, OBJ_PROP_FLAG_READWRITE); =20 - /* We only allow GICv5 on a 64-bit v8 CPU */ - if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { + /* + * We only allow GICv5 on a CPU with no AArch32 support above EL0 + * (which is typically a v9 CPU), because GICv5 defines no AArch32 + * system registers to control it. + */ + if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64) && + !cpu_isar_feature(aa64_aa32_above_el0, cpu)) { qdev_property_add_static(DEVICE(obj), &arm_cpu_has_gcie_proper= ty); } } @@ -2274,34 +2279,6 @@ static void arm_cpu_realizefn(DeviceState *dev, Erro= r **errp) =20 /* Report FEAT_GCIE in our ID registers if property was set */ FIELD_DP64_IDREG(isar, ID_AA64PFR2, GCIE, cpu->has_gcie); - if (cpu_isar_feature(aa64_gcie, cpu)) { - if (!arm_feature(env, ARM_FEATURE_AARCH64)) { - /* - * We only create the have_gcie property for AArch64 CPUs, - * but the user might have tried aarch64=3Doff with has_gcie= =3Don. - */ - error_setg(errp, "Cannot both enable has_gcie and disable aarc= h64"); - return; - } - - /* - * FEAT_GCIE implies Armv9, which implies no AArch32 above EL0. - * Usually we don't strictly insist on this kind of feature - * dependency, but in this case we enforce it, because the - * GICv5 CPU interface has no AArch32 versions of its system - * registers, so interrupts wouldn't work if we allowed AArch32 - * in EL1 or above. Downgrade "AArch32 and AArch64" to "AArch64". - */ - if (cpu_isar_feature(aa64_aa32_el3, cpu)) { - FIELD_DP64_IDREG(isar, ID_AA64PFR0, EL3, 1); - } - if (cpu_isar_feature(aa64_aa32_el2, cpu)) { - FIELD_DP64_IDREG(isar, ID_AA64PFR0, EL2, 1); - } - if (cpu_isar_feature(aa64_aa32_el1, cpu)) { - FIELD_DP64_IDREG(isar, ID_AA64PFR0, EL1, 1); - } - } =20 if (cpu_isar_feature(aa64_mte, cpu)) { /* --=20 2.43.0 From nobody Mon Nov 23 04:28:06 2026 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1793726833; cv=none; d=zohomail.com; s=zohoarc; b=THo6dxp3GOLWXKf0OgpGzup9P7KrTVLA7OgxRlvfj/WbfjJt/z1sqtwmbFDHCPXKwmSDzAqkyTVbWXpi87vi3L6EiE2FHjMHHMCWMpjcIFxtYRiDokcGNnGDMcayomV6Wdb6b9lPphGjvupRtlYeMLCu5Lz/Kj7TdRtA9avYVNU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1793726833; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=hqqeZR9hh82Ok/85fIviXaUdYKynKCQ8FaCgEa2tPAY=; b=hPuGCzzSnqfZTVYHfVXBpro5EbNT2FV7kvurURqw4Ch7qnep6zosqPu4WbZvCWJ0KfxaRTbt8WN2e+SU0bIEg8gfrwXi7PZqwvh9BQ8AJBKqn8lA/nKSmXVoORZ8OD57sTTbXBpxWWXncIdXdZk6LnMJHNaMsYq3gkXaSC64eqs= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1793726833751862.6660573128873; Tue, 3 Nov 2026 09:27:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xOIHP-0000Bq-Ip; Tue, 03 Nov 2026 12:26:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xOIHD-00008B-Aj for qemu-devel@nongnu.org; Tue, 03 Nov 2026 12:26:28 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xOIHB-0006Qt-02 for qemu-devel@nongnu.org; Tue, 03 Nov 2026 12:26:27 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4afe2d546f9so29410995e9.3 for ; Tue, 03 Nov 2026 09:26:24 -0800 (PST) Received: from lanath.. (wildly.archaic.org.uk. [81.2.115.145]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ac0950d533sm211082605e9.3.2026.11.03.09.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2026 09:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1793726783; x=1794331583; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=hqqeZR9hh82Ok/85fIviXaUdYKynKCQ8FaCgEa2tPAY=; b=kAmRUkyJNzKKXQQJH2PU4t1TI1Bp82Yl9s58odVjx6+KQUTTkPLSuwXpyBTPEHErye /iR+sbBD9+gVDyFwQ7hBB62rO7Te78SCIZvXooaFrgEjsVnkGrrPTmXDGGqq6K/Ot3FU 9WjRfLUB8IyEirDda4rYmLry+yUnsC4cQGeGr0EBy0TWvDYQm+Tyo+zQ7UszrnrKr3D+ guSrKpJO1qakKrhTB3kWFYFhJAX/ojMlF60PumFL66DMD/7gqeSIINR98jVwTp4YC+RL i4fyAy3ESBHUsQBJ2ezpQ+uojJJqfrVCtMroZzqf41YmC8fn/1h/RXkBNERR6OVp9sLG s2oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793726783; x=1794331583; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=hqqeZR9hh82Ok/85fIviXaUdYKynKCQ8FaCgEa2tPAY=; b=Ur31wYxNLd5FHfjsmyKW30ZB5jtzdpQ2y0LVpff4qW6Gv76NLFfmhkTCm+nI4Wp6KR KudGF50hKVVIOn7RlHzHEPeFNp6VrlmMsVfPwhQt88OVcSExu+sRKTHdeh2so48Wia3D gvk87TM3JrcObJHqP4d1fl2jSaBlDeiKk0OQk8zjUK4j24YBIW0hEjqnaHSs23cAbO68 LUn3J05mzJg35UH3dfaHeKEC7dnYF9daBv3/nUi9sYHzayfkHRD25VMVWUxCqQQLx3cb x+1yMsy2VjdhC+H19bxXs58qtnAO9ZgK/Sb/55fgmJGNFjiHaYPC1KTffJi1OOwjr4IJ mslQ== X-Forwarded-Encrypted: i=1; AKwUvBx4CsV8TGisTcjGijvuBTYYIt8uR0wJKWJdlxHI6sPfyxoz45hKVwmlWGICJGJr865A3N+NJ+/pgjxz@nongnu.org X-Gm-Message-State: APuU4Z+iF2QDxpQs86Lec0EIHwzt2tbhqfZRoYCi4Bp/xaMaukfSdaxr 1xtf7/E8QMcMXw0dtzdWRv4Rce30ti/NweZ9aRysi+VQV15kaFE6edCDehsCXDHgh9Pmep1AuOT coox0RI0= X-Gm-Gg: AYBFou2JjSMTxjcPh5uO2GipAZrIqf8XH8E1a1lkOs8X2+FUS4QdeFDeQLFdiaH+Mal x+TJb5SCFnJwQpVC5HPa6cUEEbBtNP+tM1D0Cit6+cqXA7gWNZJB5nupkBIIkbVtfVpKja1oZeh PZDNv4NWbtQfynazaQ2hipP8f+JprLuoem2C3ZqBSyIt3wCcAwOPjj560PxBqxgAG+ILbBj9JJ8 2IJRKVNW7Stc7BFnkDz0wew5zS1Hw2sKmLxXseNuyzt3FnHVyUFXgqYFmant1neF4/K8DmtxWjI AVt8/LZVTb7ZRn4hds+/sX7JA/YXo1Mf2iRkoIRTB+IV+aQxbW/aTPQ+USXEKdDjJdAnmwjCv9b 857zq28hwsRDU2PHg1BDmB1OjzelvQTRDln8wdYy4Mvbuyc2nn9qfBpq9sDNKnCZwfwBblGoEzl TzyQx3VazgMrjdwEJmYbs9mg9R3CNdxgJryALCyHfOwRvpKiYUDni17ZrtusCSbRu6HyB5kXhLf laN6Yu0jUT08UTPNMkXTk1X7YXtyLuIC2PBlvykmsafIYqOu/N4ozd2R9zsd/uZjmeNlVFzumKr kuAkHlRgIRRz5leth2sc7cciWXLnP9BF5wvD7yk39m/pknnZlvn7jPNCeBpFsHWkcN/veorv+AD Om9x3BMejsIkoTQkmWfFbg1Rbv6jJflCL6zWtpkE8vJkft23ffOlJeog= X-Received: by 2002:a05:600c:c48e:b0:4a1:f7f4:7cf1 with SMTP id 5b1f17b1804b1-4ac16bc47f8mr316953545e9.11.1793726783525; Tue, 03 Nov 2026 09:26:23 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.2 4/4] hw/intc/arm_gicv5: Use correct type for value in lpi_cache_get_hppi() Date: Tue, 3 Nov 2026 17:26:16 +0000 Message-ID: <20261103172616.2400758-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261103172616.2400758-1-peter.maydell@linaro.org> References: <20261103172616.2400758-1-peter.maydell@linaro.org> 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=lists1p.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 @linaro.org) X-ZM-MESSAGEID: 1793726834887158500 Content-Type: text/plain; charset="utf-8" lpi_cache_get_hppi() is a function we pass to g_hash_table_foreach() to iterate over the LPI cache hashtable. This hash table has keys which are GINT_TO_POINTER(intid) and values which hold the L2 ISTE value, allocated as "hashvalue =3D g_new(uint32_t, 1)". The function is passed the key and value as type 'gpointer' and has to cast them to the real types itself, but it incorrectly casts the value pointer to a uint64_t*. This works on little-endian hosts (since we only read specific fields of the L2 ISTE using bitmasking), but won't work on big-endian, and trips the clang sanitizer. Fix the pointer type. Cc: qemu-stable@nongnu.org Fixes: a0562ada75e ("hw/intc/arm_gicv5: Calculate HPPI in the IRS") Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/arm_gicv5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/arm_gicv5.c b/hw/intc/arm_gicv5.c index fd6456cd8aa..a362349e5ed 100644 --- a/hw/intc/arm_gicv5.c +++ b/hw/intc/arm_gicv5.c @@ -390,7 +390,7 @@ typedef struct GetHPPIUserData { static void lpi_cache_get_hppi(gpointer key, gpointer value, gpointer user= _data) { uint64_t id =3D GPOINTER_TO_INT(key); - uint64_t l2_iste =3D *(uint64_t *)value; + uint64_t l2_iste =3D *(uint32_t *)value; uint32_t prio, iaffid; GetHPPIUserData *ud =3D user_data; =20 --=20 2.43.0