From nobody Sat Nov 15 07:41:32 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1754069092; cv=none; d=zohomail.com; s=zohoarc; b=g2V6fS3LVRLFYpMqxYNbpL0qdRSWHM7FTw+FQLbO9r39Y6ROsD+jOEswKKFR1vVH4cCMhGVwDuYUmfuDH3BzVi6sf5JvNv4sa9NNszaENanW6HmwdVfBYfLiSyhp8WTSanZFIUFy9N8kCgX4A4kcSfOo33J4bmHo2o19IkYN4E0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754069092; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=MFU7cdermEBfIRmFJJXvXqdeDCykmx7B9ltL/jtSxbA=; b=A0JvMOv3IiX8Yfa9Gig4K6Cgpv2g4CL3pV2mbvJwgMk/ATNAjN8lN/VKlJjwwbILYTv7r0zQDyPQvD1Np0B0pa091fQcoCn9bDv0wheYnULJQttmpD1XYvc7nvWr3HlWviluJjnxYqzqFczqZRNVOgBvITVn7LU2Mwg6GPDHRbs= 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 1754069092116922.891444695301; Fri, 1 Aug 2025 10:24:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uhtSq-0005bO-7j; Fri, 01 Aug 2025 13:22:40 -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 1uhs3G-0002fh-IN for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:11 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uhs3D-0000yF-Gs for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:10 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3b7961cf660so945536f8f.1 for ; Fri, 01 Aug 2025 08:52:06 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c4a2f03sm6176670f8f.72.2025.08.01.08.52.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 08:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1754063525; x=1754668325; 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; bh=MFU7cdermEBfIRmFJJXvXqdeDCykmx7B9ltL/jtSxbA=; b=Dn8Uz44xfOIag/zdF51esOD8GPY2uHznBMA7N3VZxSXzG/oaZJaBRW5rXIEBt272jf mAa3Y8oFto0Tps5dusiMYQHNSnnDcnrpXlc9a4Gm08YIBEb8c8TFca8mnU6+uKP3mVTY qolSAMIrr1NkS68tCSdpq/DMdg3iSQhG0GH81/ES6UYwr3bKNpHmsjF9kH6ismG/YevI ByTxWWey4qcTtBRxwgf+302dChglRHtvYqTynKQEM0/OPmlNXMx7Mf7YlWlEppe9d3pt XS8Rrm3mmbU8z75xc1DrI+itEK4c8QSljndKbIUChZ/GwIPkDGDNQoSKtqq7yxtIaR2N QVmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754063525; x=1754668325; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MFU7cdermEBfIRmFJJXvXqdeDCykmx7B9ltL/jtSxbA=; b=I5XuVZ2Ow8ta/0sBlPEW91MbbHuQ673OnJo8RbgRYi2xKJIDHRlkvUnVJT2Ep0Twnt z17mCE+iGIK/ig+eLPD05V+4jOcfI+NrRQQQZenXBJjLaLjNTAXlPqE8YQUnq6B4HGKd KJxk7tCxo75gzC4eFTc7FDK0WkS4PoRTm+MEG34SJ2zd+a4WCeTnojH2J+9GKrr8nsUL cln/KzqHEpuSR5cNAeGe3BApVqkZLPdxF7DAtpx8g2E5ORF7/mQQEHiXZQ80gWdRITjD 4o38QmvA/FCvFiRe/MiW9Y5WRX58b9lS3owFzgfiJZ2R/1nlvuQJmuxRyaHQzJQZuyH8 v8Ug== X-Gm-Message-State: AOJu0YxCXP24Y/huFfYjIp8UVqccmog+oaS7gDO3GJ16MG2tHhbP/JG/ 3M55eKWAf1bDns4PK3Nw98q+i/x5SQxb7B3wXlapQBPspiVvN/TXlUry16Y7dXVGw+0mIte9LwS eNcfr X-Gm-Gg: ASbGnctkgCJRlfm2fyZvLj+A3N1YmMwzej+eKy0levywncVw7jFe4n2ioss/e26+DK1 JRwzAzWDofmHoqUpJvOWEXU0WkY+z4rgrPkT+szfVfxV3unaQyGMM+44GdtL2ngANfBdnPr9s/H TtFpYk024Cpos6gjA6wWAWmcl//z4g4EydSpTiJk9wqvqrCN8dB0jfz5hztvNhMvZUvajvdF69W LU2WFkRfKg6E8r9aXqZn4D9j+SX4vaoY0DlWwYqU1UbeMFOvHh8XP+NO0gpWIIelOzamGpl6vuX 8rzktc+ZS/MFnkAIWwtaJdGoN+wYOYIPbKXASmxDB7n4d60TxNoB+hUBq25LAfCNW7JnrSIdM2j 2/TcLkIO/SanMK7CWd+d1TAHhTdNEW0jHZ2j379k= X-Google-Smtp-Source: AGHT+IE06JguCyTKTyKVaW5yE0VjvWfMOvfZ8F4AR9cwKd1ZrLGsjqDXEumtQqaUquLK2gfS5Y6LIQ== X-Received: by 2002:a5d:5850:0:b0:3b8:d79a:6a53 with SMTP id ffacd0b85a97d-3b8d94708dfmr251589f8f.23.1754063525343; Fri, 01 Aug 2025 08:52:05 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 1/8] target/arm: add support for 64-bit PMCCNTR in AArch32 mode Date: Fri, 1 Aug 2025 16:51:52 +0100 Message-ID: <20250801155159.400947-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250801155159.400947-1-peter.maydell@linaro.org> References: <20250801155159.400947-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.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: 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: 1754069092956116600 Content-Type: text/plain; charset="utf-8" From: Alex Richardson In the PMUv3, a new AArch32 64-bit (MCRR/MRRC) accessor for the PMCCNTR was added. In QEMU we forgot to implement this, so only provide the 32-bit accessor. Since we have a 64-bit PMCCNTR sysreg for AArch64, adding the 64-bit AArch32 version is easy. We add the PMCCNTR to the v8_cp_reginfo because PMUv3 was added in the ARMv8 architecture. This is consistent with how we handle the existing PMCCNTR support, where we always implement it for all v7 CPUs. This is arguably something we should clean up so it is gated on ARM_FEATURE_PMU and/or an ID register check for the relevant PMU version, but we should do that as its own tidyup rather than being inconsistent between this PMCCNTR accessor and the others. Since the register name is the same as the 32-bit PMCCNTR, we set ARM_CP_NO_GDB on the 32-bit one to avoid generating an invalid GDB XML. See https://developer.arm.com/documentation/ddi0601/2024-06/AArch32-Registe= rs/PMCCNTR--Performance-Monitors-Cycle-Count-Register?lang=3Den Note for potential backporting: * this code in cpregs-pmu.c will be in helper.c on stable branches that don't have commit ae2086426d37 Cc: qemu-stable@nongnu.org Signed-off-by: Alex Richardson Message-id: 20250725170136.145116-1-alexrichardson@google.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/cpregs-pmu.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/target/arm/cpregs-pmu.c b/target/arm/cpregs-pmu.c index 0f295b1376c..9c4431c18ba 100644 --- a/target/arm/cpregs-pmu.c +++ b/target/arm/cpregs-pmu.c @@ -1067,11 +1067,6 @@ static const ARMCPRegInfo v7_pm_reginfo[] =3D { .fgt =3D FGT_PMSELR_EL0, .fieldoffset =3D offsetof(CPUARMState, cp15.c9_pmselr), .writefn =3D pmselr_write, .raw_writefn =3D raw_write, }, - { .name =3D "PMCCNTR", .cp =3D 15, .crn =3D 9, .crm =3D 13, .opc1 =3D = 0, .opc2 =3D 0, - .access =3D PL0_RW, .resetvalue =3D 0, .type =3D ARM_CP_ALIAS | ARM_= CP_IO, - .fgt =3D FGT_PMCCNTR_EL0, - .readfn =3D pmccntr_read, .writefn =3D pmccntr_write32, - .accessfn =3D pmreg_access_ccntr }, { .name =3D "PMCCNTR_EL0", .state =3D ARM_CP_STATE_AA64, .opc0 =3D 3, .opc1 =3D 3, .crn =3D 9, .crm =3D 13, .opc2 =3D 0, .access =3D PL0_RW, .accessfn =3D pmreg_access_ccntr, @@ -1211,6 +1206,23 @@ void define_pm_cpregs(ARMCPU *cpu) define_one_arm_cp_reg(cpu, &pmcr); define_one_arm_cp_reg(cpu, &pmcr64); define_arm_cp_regs(cpu, v7_pm_reginfo); + /* + * 32-bit AArch32 PMCCNTR. We don't expose this to GDB if the + * new-in-v8 PMUv3 64-bit AArch32 PMCCNTR register is implemented + * (as that will provide the GDB user's view of "PMCCNTR"). + */ + ARMCPRegInfo pmccntr =3D { + .name =3D "PMCCNTR", + .cp =3D 15, .crn =3D 9, .crm =3D 13, .opc1 =3D 0, .opc2 =3D 0, + .access =3D PL0_RW, .accessfn =3D pmreg_access_ccntr, + .resetvalue =3D 0, .type =3D ARM_CP_ALIAS | ARM_CP_IO, + .fgt =3D FGT_PMCCNTR_EL0, + .readfn =3D pmccntr_read, .writefn =3D pmccntr_write32, + }; + if (arm_feature(env, ARM_FEATURE_V8)) { + pmccntr.type |=3D ARM_CP_NO_GDB; + } + define_one_arm_cp_reg(cpu, &pmccntr); =20 for (unsigned i =3D 0, pmcrn =3D pmu_num_counters(env); i < pmcrn;= i++) { g_autofree char *pmevcntr_name =3D g_strdup_printf("PMEVCNTR%d= ", i); @@ -1276,6 +1288,13 @@ void define_pm_cpregs(ARMCPU *cpu) .access =3D PL0_R, .accessfn =3D pmreg_access, .type =3D ARM= _CP_CONST, .fgt =3D FGT_PMCEIDN_EL0, .resetvalue =3D cpu->pmceid1 }, + /* AArch32 64-bit PMCCNTR view: added in PMUv3 with Armv8 */ + { .name =3D "PMCCNTR", .state =3D ARM_CP_STATE_AA32, + .cp =3D 15, .crm =3D 9, .opc1 =3D 0, + .access =3D PL0_RW, .accessfn =3D pmreg_access_ccntr, .reset= value =3D 0, + .type =3D ARM_CP_ALIAS | ARM_CP_IO | ARM_CP_64BIT, + .fgt =3D FGT_PMCCNTR_EL0, .readfn =3D pmccntr_read, + .writefn =3D pmccntr_write, }, }; define_arm_cp_regs(cpu, v8_pm_reginfo); } --=20 2.43.0 From nobody Sat Nov 15 07:41:32 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1754068964; cv=none; d=zohomail.com; s=zohoarc; b=jQn4zyNYbOWEHw4uqyE3WMUo5sESTlF+Wfg/yPGNdcITckEl/NUB2KGswYexA5WoQ4umHEUFo8ZuFv8f7hDa4eG5Y5vwI0n380y2s2NMdy1x0jD3n5L5SidN0zHec9oir0yOWya0H4Wp8TufOUAP2zWle3pax14ta63UDUJMffc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754068964; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=qJIK23UyAslwl363cABUZ9a0g5viH1x6Yzu8I+xd/oI=; b=NnJXUVL+rwc8Ol3aL7Yvw87NOYUEFqCS3Xh14c0T/Ha//paEUbNf5syRhm160dvnlfByqWw73dauw+P3MyIUZIgHFuWXaEUILR9DlMfUZKH0nzBiPwUQaD4Ou4GWjfOsHRBQsrpO7Zhs8cIXaHsSd4CHePtTEqv9GxcsqwYR4Io= 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 1754068963616420.46126039606213; Fri, 1 Aug 2025 10:22:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uhtSS-0003RI-HO; Fri, 01 Aug 2025 13:22:16 -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 1uhs3G-0002fg-H1 for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:11 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uhs3E-0000yM-Bn for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:09 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3b7834f2e72so1518156f8f.2 for ; Fri, 01 Aug 2025 08:52:07 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c4a2f03sm6176670f8f.72.2025.08.01.08.52.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 08:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1754063526; x=1754668326; 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; bh=qJIK23UyAslwl363cABUZ9a0g5viH1x6Yzu8I+xd/oI=; b=RmTozoFBthS1UQZY6b1mi1hv8hxswGUxWr64cfG0ef7IrPXlBiNZBcG+SDl+54F0cM Svfl5GlAMmDdD4AUpsZMxPUMNZ3JxEFPfXfRKevKPg7wp0Yr48mkaWOFdBPWEJfOkGfa 0auivpZnmLbhkbPancUjwZJaWU/dszr7V+PQ+uQSU4BFxfggBJ1xmtNMBpL/CQdSXsAL dJBbY2OigFfeC3ipTVGqhvt4GU1QR8jYgcF6NrgD4xBRuqt5ehfAlbxvDPe9I3Vk8gmi hlCZsr8cATuOxINZHLiPn1fk0rxfRkHHEzwzy2anJjFOkvwxyF1YFwtJtXlPZJoza3Lh 0qvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754063526; x=1754668326; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qJIK23UyAslwl363cABUZ9a0g5viH1x6Yzu8I+xd/oI=; b=YMhbcFNCfq5n1wSgBzy/j7uGyS2pEtrlYc/HKOT0Q43jPLKBc4f4tpJ2B3zLWxsw4M zoT4an563qFSuxux2hOrISK2UdIGDQxKxdMd+MJizYszE/dYE9o11vF+zBQyGDCo6S4P HcMMhbebhTDTjnhFX8dqJzRoZog4sitDgHt3CZpiO1UmLe3AoJzUW4JgXdCKewT/8Ymc eSCYH6rS5JGbsxJxTc6XjGSnbDZo6vnncbn2LoPMSE/GU0zd6kfe8lJfglSx94PQS8RO iqbiUKhSzFlD3wEGLU1ibuZgAP2Va5TS2Ar7ElcMuq5tgVvyAttmQZTPioRu1UuZvNJq YRDQ== X-Gm-Message-State: AOJu0Yy/K6NZDsjBrfh+4Mnw7VVU17zqzvOEfUnN01bmVZUU9mPau3pq 9dW80WymPpiS5AyyZptM7NhFnKGyIA4rGHBLP427AFQWTkjnGKHRi7stBtMHkV//1tOupxFbWi1 yXR+5 X-Gm-Gg: ASbGnct960/Fr/xdasaXW7Roe21m3n4zqJ2tbC9htT25Oa9wxm/CmFt8bpml/vQJyKr Jroa+FwW8GZsaK+jKyTksv/eymls3Y9SHglrB/2A13qSeviT6581zdXCApWNwiIBZHAKEKkxDoS VtmjHK7RtiLYhMR6Nflm5jN893hIj5t8uy8NQ9GqtHd8B+5CDLlfq0z4bFFRHwJsKM7mgxx2GNv /VU/p1ygrec/QaIZr/JS1XDUXWGlv7XwGGF+wglrVuLONU930j69vAq0wOCVtwXwAY7McJ5zQ5O Jsag1XRwrSiV3TyB4DUZGDMNX9MkEW/05OcC7geyu3B6Z4sQzlbVmG+9YQQYOWG07YV1JejE+mb kfE2/gd6OIw6pGh13E5Pwfu0/NTd4 X-Google-Smtp-Source: AGHT+IE9WJkfGLuKzSwUs7GEoGGcxBSukD8rND1tTuXsnr3iMXPOWiVEoqqzft1J1OCf1Gn/64Iazg== X-Received: by 2002:a5d:64cb:0:b0:3b7:761a:95d9 with SMTP id ffacd0b85a97d-3b8d94ce478mr211244f8f.59.1754063526483; Fri, 01 Aug 2025 08:52:06 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 2/8] hw/intc/arm_gicv3_kvm: Remove writes to ICPENDR registers Date: Fri, 1 Aug 2025 16:51:53 +0100 Message-ID: <20250801155159.400947-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250801155159.400947-1-peter.maydell@linaro.org> References: <20250801155159.400947-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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: 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: 1754068968397124100 Content-Type: text/plain; charset="utf-8" From: Zenghui Yu As per the arm-vgic-v3 kernel doc [1]: Accesses to GICD_ICPENDR register region and GICR_ICPENDR0 registers have RAZ/WI semantics, meaning that reads always return 0 and writes are always ignored. The state behind these registers (both 0 and 1 bits) is written by writing to the GICD_ISPENDR and GICR_ISPENDR0 registers, unlike some of the other set/clear register pairs. Remove the useless writes to ICPENDR registers in kvm_arm_gicv3_put(). [1] https://docs.kernel.org/virt/kvm/devices/arm-vgic-v3.html Signed-off-by: Zenghui Yu Message-id: 20250729161650.43758-2-zenghui.yu@linux.dev Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_kvm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index 8ed88e74299..f798a6e28ca 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -387,8 +387,6 @@ static void kvm_arm_gicv3_put(GICv3State *s) reg =3D c->level; kvm_gic_line_level_access(s, 0, ncpu, ®, true); =20 - reg =3D ~0; - kvm_gicr_access(s, GICR_ICPENDR0, ncpu, ®, true); reg =3D c->gicr_ipendr0; kvm_gicr_access(s, GICR_ISPENDR0, ncpu, ®, true); =20 @@ -445,7 +443,7 @@ static void kvm_arm_gicv3_put(GICv3State *s) kvm_gic_put_line_level_bmp(s, s->level); =20 /* s->pending bitmap -> GICD_ISPENDRn */ - kvm_dist_putbmp(s, GICD_ISPENDR, GICD_ICPENDR, s->pending); + kvm_dist_putbmp(s, GICD_ISPENDR, 0, s->pending); =20 /* s->active bitmap -> GICD_ISACTIVERn */ kvm_dist_putbmp(s, GICD_ISACTIVER, GICD_ICACTIVER, s->active); --=20 2.43.0 From nobody Sat Nov 15 07:41:32 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1754069092; cv=none; d=zohomail.com; s=zohoarc; b=FE2ehX8W2kQawwC2nWuIEe7wJRXMxDEgKli9LknyTyoMxvpHirlKgnjtlK3AqCKDV0YjmUcICTRfkQ31R7X04ltcRqu/1NK7+BLsm4M18muUl0SL7SufBHIE+VDrofa+X3Y3WfVdiqbYYhoQsqzrRWNqVQHKetydQ9aLnYUeNvA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754069092; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=oirmS+SjrCLZzQhC+0iWfATmWhPBgexkPGpM/2V1o2c=; b=Or4luh/Pwgj16II7y3WNPV2x1awf2UBcbikLpkO9v7M/AvfOLY8mIsiuQRW9L1TLk/MjCtDCywE/t65KWcp7fPX2HnWT59OXv8fsPiz2ohM2DPbsgegI28xB7ztCrva5byiFLkKf0j8P6C+Fz5gXZnmb2X0Mt40JY2F29mwOY/Q= 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 1754069092118393.5325955441009; Fri, 1 Aug 2025 10:24:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uhtSv-0006QL-9J; Fri, 01 Aug 2025 13:22:45 -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 1uhs3M-00037b-CY for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:16 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uhs3G-0000yX-0r for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:16 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3b7823559a5so1335117f8f.0 for ; Fri, 01 Aug 2025 08:52:08 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c4a2f03sm6176670f8f.72.2025.08.01.08.52.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 08:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1754063527; x=1754668327; 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; bh=oirmS+SjrCLZzQhC+0iWfATmWhPBgexkPGpM/2V1o2c=; b=J6GSg2E6hpmAFIHuqS17d1eilb3THXxgYSNkT/N0jUUkhKAwHgFkhuGwmHbUb2MGyn GFer1Fi1vhTTuJBaUUVjKGxXkTmgzXORmeQgQ1xo+46Q6VNVZMlGD6/YvvMcIVGHS7w5 G+BMLE9MbciWR/01vVPWyg4Csv+VKWDT0UqZpLwHLmIkLqmPmj1nU8SJb32ByjNWgDO8 uGoBjut0FUAGsvijsZy8pLtwkv5t3agvRii1zp8VggAsNSEp5XQvFAWHqY/342kh+Vt8 NPmZB6si2oDA1wn63FNcRKp1FjF9L0LmliVxrARH4oG9AagNUHJx09LwLsiOAazWnYoa 09OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754063527; x=1754668327; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oirmS+SjrCLZzQhC+0iWfATmWhPBgexkPGpM/2V1o2c=; b=kFWOYhBRLZ+8jhqHCuKs+OlwwCc/Q7fSkDWL45ZcMKaEqM5P2Kyv2AkdXkGJxkA3zl 7xBU/UwoHzPYKvJ6PGNv0NBUOXcw0GDhpmeHpO1kSw7UKBjUDKmuxRWDqKfuCNE6e5QO JYBAWXTdH7bgR47vhqX+mIEJ/UF4hDrrQc+7itlFuY2RDgZDl+omnNPtm9hqimAh3vNh l+yE4Sqzvv552ugFR42QtM0HmaPbJfWIKwhxUZifUKnZufIqzre4aJvrSYEeQ35huptC 2ItWKUBFrQr8YAceNqbBjlejp7xV5GcmZ5gl6km6HTyGo1MIvVCjNXUQNHsbxUD+n1Am CCjg== X-Gm-Message-State: AOJu0YyMEcFn41da8DmshkbKJHJJgNHUTcoiGM9A5JM7odoYi8ndvWFc U6vXEYSErRtL4lKeTcXlq4AhtU7VtYpzfVDhRWTmiXgshxI+AFNti3jlCk4AP1hhNewzKZsZ2+8 2SN0N X-Gm-Gg: ASbGnctjuHEVuG1Bp2O1Tyeefo9D3PKDRYDgtvuKC5gyXNMrbeM6sePMscfKYIHTfVI 2eeWTNXhDBPuBXTmTjPug00WgzIHPiJCWOUlnRWOslO+HOuA9oSQj7daAfc0JkfYzAbRRfRlRK1 UTC80DyH1pbTzYWh2kv3ZapksYMSM1JQunGx+05mmoBPg1NGxxkXjy5wazdonGN1QF0f5taLmdF jyBTEButKXZ6hjVCpnJpEdIvFRHI8GoTPueqjdFWqTWuA1v+OQVcHhUhtLaJH7olEkICOb3+rsC J+OFg7MAYAhKi5vM0WbOSPvNM8dz3yRALjYnbiznNA8VSDZe7cBohQ2tgF1czYMnx5Jag+eYsG5 U+caob8Tv163In3ZYoPCPHNCj/3J+vCTYCGw+tpg= X-Google-Smtp-Source: AGHT+IHW0vOblllVcKa68jQyOFI0cWRD1HmFFx/yH7oYznBv22D84R7ZXbC5UXHLoXzELcANtSUfow== X-Received: by 2002:a05:6000:2584:b0:3b8:893f:a17d with SMTP id ffacd0b85a97d-3b8d94d35d6mr178504f8f.49.1754063527452; Fri, 01 Aug 2025 08:52:07 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 3/8] hw/intc/arm_gicv3_kvm: Write all 1's to clear enable/active Date: Fri, 1 Aug 2025 16:51:54 +0100 Message-ID: <20250801155159.400947-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250801155159.400947-1-peter.maydell@linaro.org> References: <20250801155159.400947-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x433.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: 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: 1754069092951116600 Content-Type: text/plain; charset="utf-8" From: Zenghui Yu KVM's userspace access interface to the GICD enable and active bits is via set/clear register pairs which implement the hardware's "write 1s to the clear register to clear the 0 bits, and write 1s to the set register to set the 1 bits" semantics. We didn't get this right, because we were writing 0 to the clear register. Writing 0 to GICD_IC{ENABLE,ACTIVE}R architecturally has no effect on interrupt status (all writes are simply ignored by KVM) and doesn't comply with the intention of "first write to the clear-reg to clear all bits". Write all 1's to actually clear the enable/active status. This didn't have any adverse effects on migration because there we start with a clean VM state; it would be guest-visible when doing a system reset, but since Linux always cleans up the register state of the GIC during bootup before it enables it most users won't have run into a problem here. Cc: qemu-stable@nongnu.org Fixes: 367b9f527bec ("hw/intc/arm_gicv3_kvm: Implement get/put functions") Signed-off-by: Zenghui Yu Message-id: 20250729161650.43758-3-zenghui.yu@linux.dev Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/intc/arm_gicv3_kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c index f798a6e28ca..6166283cd1a 100644 --- a/hw/intc/arm_gicv3_kvm.c +++ b/hw/intc/arm_gicv3_kvm.c @@ -295,7 +295,7 @@ static void kvm_dist_putbmp(GICv3State *s, uint32_t off= set, * the 1 bits. */ if (clroffset !=3D 0) { - reg =3D 0; + reg =3D ~0; kvm_gicd_access(s, clroffset, ®, true); clroffset +=3D 4; } --=20 2.43.0 From nobody Sat Nov 15 07:41:32 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1754069212; cv=none; d=zohomail.com; s=zohoarc; b=cAbC/jWN77PYPddDeJXgxDCoOHerotTZfkHL2F3NyZQyivNaZ+3PsEk2dr2P2FHdU63p9Bny8U23r/4+AEU9wSGOTQbbASK5lNu73zt8GpbnblE+R1mDMEbGhlY+zRGb3zw89/SjTRKW8jw6/s8PwSnPlvTY+TzaXFqZicJHL8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754069212; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=VA9zLG3hIwrKZfYHg8vSBI/hR1razhF0Nu/W6W/sq9U=; b=Xr2GvD88Azf6ZV0+0UMNZ8yu+boKxstbYZP1ON1bp/esAfQhSqUcae1F/CW/OJJk6ETpZvmE4uBMvK3Tx4QiZkymgcMLb23ue5mCwomic2OpALF8bAizS/5vujfwDJ3MxIFD53IXtvLUMN2l1ziW89NHyC6A2hGfSkH8DTai5iY= 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 1754069212613946.2977481785218; Fri, 1 Aug 2025 10:26:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uhtWd-0005ft-G3; Fri, 01 Aug 2025 13:26:35 -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 1uhs3H-0002ha-W3 for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:12 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uhs3G-0000yf-9W for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:11 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-45629702e52so4359035e9.2 for ; Fri, 01 Aug 2025 08:52:09 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c4a2f03sm6176670f8f.72.2025.08.01.08.52.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 08:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1754063528; x=1754668328; 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; bh=VA9zLG3hIwrKZfYHg8vSBI/hR1razhF0Nu/W6W/sq9U=; b=OKpm7Dezbi8Ey8zWiGRnfASzz+lap2Az7cgkDfvtCZc1Cr9w7x8kvoMnddxIUCpwHP tiGcSQrLNGKpBm1TXNEfEiBMPETvsj3yja+GXoNp5mNnOPkZMgRIMGNUlIr8fgWwXTiL GCFgAYEdr8kUKbvR17j4KopQNAsEck7K1YXL4GhhHDVoY3L0nNO2jvKdtYIqEMm2Cxie 9gBry/hrJEWeVDrRjSbDr2ZEfNxJOUBzH+V1uR5x2aZbzRvAXYE+LPyO1iKlh995O664 H+l787JjKqUcJgqsWLyl+S1uEF8u+c6ZrP07YhvI9Tx/uJrZDglwutg0wIcTXGK0UnYv 35pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754063528; x=1754668328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VA9zLG3hIwrKZfYHg8vSBI/hR1razhF0Nu/W6W/sq9U=; b=mwH4gW9KP+Q2sKriENVhhW/uri/t64iTJ5a+2JbYUJABrzDGnyEuuRwPS8BUqOd/f9 Q0mWEB2iF0WD4jITPVIMg7OiF3KV+o4Xu9B4qUw0tOPWshk+DwQ3zKrAyQ8jMLhi3U83 HpDnbD76U1xEbcrjpAAJkXNKM84AQWciTU7K6AdTOOrIp0A9wsEidXrFPtTvcW5EFQzM g5qMgDe8wfVXdeyP67x5QA0+cVeJCWn/crNfm7XZzfGH1+mBBMD80PZSd9F8FQo2WbTL pQf5fwoah68wI4u4AD1yaHGaj3iHzvNt43z/7Vw7+GgPUPN/NMrgWkeShuiomR18ysGL 8znA== X-Gm-Message-State: AOJu0Yxhd9+tl8qJZl5I8EhaDq7N8VepvUqaZH9p2FQRSIbrjo+Ql5FY +XVh92WSVgRvuvanELrY+ED7VOSPvkRubVPDN8lSMV66C6j5fIusIIf7Y2Su37sHOyH36XTzje4 BqNwp X-Gm-Gg: ASbGncvouQXcWfGK/MNPTNdaJc9pFnvj0qxLq9Wki5itpcz8+uVIKt6QSUdE4YZjD4J b0kmBwOnzhyjm//WtRFnQl9/56VTPmIhbRq2pKrVdW/tHqZeRUHGSzc3j3+px+T1vFsWANWBooW 4zo5nCfLRFfCE9bS6VWk+sYVSIvgDnY1aekWEgii3ib5kmfAVHaK16VZpO321PDRYISbELae9Vy A5ySLSFYsaecW5TOKGA/yMM2NAj+juKSvGJxbGD0w3cPDGNjHiulWSWTLjENS02Xd1AKN5U+jFN vryfg/S5whsvO6+PvWXp4iRsO0LF6Jgt51QzAZIKKkTuqx2+xW2ZMkufvrUS1Yx9GLVsTX3Qj76 b8ev6RjuTLjgKfcBhkI/rxnRNNthUXJr4WbBKvHw= X-Google-Smtp-Source: AGHT+IE2aMGX0ZZVL2udJYMuwCPwJC29lrNO+BJWY0e33zLCxbyA95h5aNcLqaZ28oLmfNkTthzE8w== X-Received: by 2002:a05:6000:40c9:b0:3b8:d138:41d3 with SMTP id ffacd0b85a97d-3b8d94d01c0mr241931f8f.56.1754063528459; Fri, 01 Aug 2025 08:52:08 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 4/8] hw/display/framebuffer: Add cast to force 64x64 multiply Date: Fri, 1 Aug 2025 16:51:55 +0100 Message-ID: <20250801155159.400947-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250801155159.400947-1-peter.maydell@linaro.org> References: <20250801155159.400947-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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: 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: 1754069215188124100 Content-Type: text/plain; charset="utf-8" In framebuffer_update_display(), Coverity complains because we multiply two values of type 'int' (which will be done as a 32x32 multiply and so in theory might overflow) and then add the result to a ram_addr_t, which can be 64 bits. 4GB framebuffers are not plausible anyway, but keep Coverity happy by adding casts which force these multiplies to be done as 64x64. Coverity: CID 1487248 Signed-off-by: Peter Maydell Reviewed-by: Manos Pitsidianakis Message-id: 20250710174312.1313177-1-peter.maydell@linaro.org --- hw/display/framebuffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/display/framebuffer.c b/hw/display/framebuffer.c index 4485aa335bb..b4296e8a33e 100644 --- a/hw/display/framebuffer.c +++ b/hw/display/framebuffer.c @@ -95,9 +95,9 @@ void framebuffer_update_display( } first =3D -1; =20 - addr +=3D i * src_width; - src +=3D i * src_width; - dest +=3D i * dest_row_pitch; + addr +=3D (uint64_t)i * src_width; + src +=3D (uint64_t)i * src_width; + dest +=3D (uint64_t)i * dest_row_pitch; =20 snap =3D memory_region_snapshot_and_clear_dirty(mem, addr, src_width *= rows, DIRTY_MEMORY_VGA); --=20 2.43.0 From nobody Sat Nov 15 07:41:33 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1754069228; cv=none; d=zohomail.com; s=zohoarc; b=bR8NWlFiywSJrhb+vv7bpvs9VO5QiHWRXYTxphaTw8mV7aUfYpSw06oeUfYLoras8oI0B6MsD8XLWwXAnnHsU7ZZKf4Ftk6C5a9738/3lUV8VZzcSDUrzWOgr+jCKoQqljdDDVu/qhbksmh0I76BJww3XhO4a/m5sNkr4JhebEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754069228; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=6tqNlDZhDFhmievpTc6TWIWJKAXo6zzMJoX/FphxVJA=; b=PGbLskitE75vzz45v2RBzclFtx033XsIi/qFhaznr8A5zSrEYIjzsrL0DrS1cWNi2hM50Js+ZjHOh+FDUDR/tqh3joGzulWwzxrEsAYVA7oblLVUxTAif9O5CgORHMNxPBC0Pef3n399t1Mm3mpNmwXIBf/qGsmWCtg1NGxOaz4= 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 1754069228883495.29777990792786; Fri, 1 Aug 2025 10:27:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uhtWy-0006oh-3l; Fri, 01 Aug 2025 13:26:56 -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 1uhs3J-0002q6-N7 for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:14 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uhs3H-0000yo-4Y for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:13 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4560cdf235cso12351755e9.1 for ; Fri, 01 Aug 2025 08:52:10 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c4a2f03sm6176670f8f.72.2025.08.01.08.52.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 08:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1754063529; x=1754668329; 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; bh=6tqNlDZhDFhmievpTc6TWIWJKAXo6zzMJoX/FphxVJA=; b=jAwzITqjjCMCUzIItli3rZUn+d5MJJz+5FA4CGsY9twaSakA9nHhun3f9O0Rfm2Lo7 HeQWDcwDyUAPq20RUFF5oUdV6z3NC3HUMkP4KAWp3EMac5jjeBCkoqKgXOZJfsEcIHAm s42lHl6z6wCUE+wS5FSCjYYrflfRrE8AS1kDSqLXBh/HmlwGCW31F4yHLb5A1byFGx3D CF9i2WCV9/1Bfq8vEySlhTzZxN9fs6i0rVEXvJaoiTS7RDPoWPssSDczXePBdvRvUPGM 64KengY51KpJqjgkOGrxqM5in3tltU2qM0YSBspvOHhAtOBjPe33aGx7DaAX+lOYF5/a YjTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754063529; x=1754668329; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6tqNlDZhDFhmievpTc6TWIWJKAXo6zzMJoX/FphxVJA=; b=LahFELU0bHRKKyKDv48OSDpDMSM7KBw3ydzrfL5a1FSuDZaiFOPSTNd2SOU2YrQ+v9 GVExCwvnpPWXqUMM8vxd3Y7IGysFeBwiOVLkxFQsKTEUhil0Ub3iKuFv2rpb2gv5Fohd +71uHNG1LOsXGewQrJHydGJZz2BilMJVBtMn1ZSMmOPNGZwNDxqgf2G9oxVeqNg1mkXL hAxh20IH13FHgwpMSTmg8767C74iE4ijoJ/BnKJnAXB1vvPyLs1vLyLZB5yDClTJe3o3 Y8xcxhV5FagO4A8aNu1iQ7HIVudf+uOCFCCd1mWul64arzqLviUgHen66YpWIt/4IopI cPWA== X-Gm-Message-State: AOJu0YzExXrK4oCttRsRClDTGQD7ToLdyKuqzcZNds4jIi5eb0GLsM0K tL09fPqKG30MQt0PSCr5c5JvS4dLvWGIz0FYj49++bXaqvw7cEIoY7SHewxIGDNMoyiE7XSMHBN BjwPg X-Gm-Gg: ASbGncsLaT6LncPh+1JBLOAtr/08QrEWnNTc6tGto7/qEt4UXESEPilpjoOYQaMyfx9 7PrjcM7JgJcpX/2nFgxI21KSFLOfYh7ursOtLF6kvUmkPbtnZNHbJL4H3HXqBwNMvqmTX5aru76 fWb61Qltw6alOpzkjlsCCaroH/vVbklyRZ572tpjaCaUj0QLQmxk9mS5d32/T4eGSz5ZgxowNYP eBIWp0AZWafJQBIoY7YYkJtAO8Dh/NuvBivz+qBMrPXFmz6NhxIYL+wlJogcTraEeUMir/FBPJk uLlBEYyWgaxHfjLzi0GjHOKEsGRPV8VecMpsi43xV1eXG2THCRla5F6U+NGrVV7VM2B2NRkO2Sz IhjUFguNBMF8PMvEuR56BN/XVURb6IbzmG8ltx1g= X-Google-Smtp-Source: AGHT+IEAtSNjDNbiSAZaz6HYQWuGaunl8lIBuaOjDsM0rSdRc2tZxJL/DeV6yyd0YAOaa3+vUNKgjQ== X-Received: by 2002:a05:600c:4fd0:b0:456:1608:c807 with SMTP id 5b1f17b1804b1-458a29cad45mr64489065e9.26.1754063529394; Fri, 01 Aug 2025 08:52:09 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 5/8] target/arm: Reinstate bogus AArch32 DBGDTRTX register for migration compat Date: Fri, 1 Aug 2025 16:51:56 +0100 Message-ID: <20250801155159.400947-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250801155159.400947-1-peter.maydell@linaro.org> References: <20250801155159.400947-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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: 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: 1754069230140116600 Content-Type: text/plain; charset="utf-8" In commit 655659a74a we fixed some bugs in the encoding of the Debug Communications Channel registers, including that we were incorrectly exposing an AArch32 register at p14, 3, c0, c5, 0. Unfortunately removing a register is a break of forwards migration compatibility for TCG, because we will fail the migration if the source QEMU passes us a cpreg which the destination QEMU does not have. We don't have a mechanism for saying "it's OK to ignore this sysreg in the inbound data", so for the 10.1 release reinstate the incorrect AArch32 register. (We probably have had other cases in the past of breaking migration compatibility like this, but we didn't notice because we didn't test and in any case not that many people care about TCG migration compatibility. KVM migration compat is not affected because for KVM we treat the kernel as the source of truth for what system registers are present.) Fixes: 655659a74a36b ("target/arm: Correct encoding of Debug Communications= Channel registers") Reported-by: Fabiano Rosas Signed-off-by: Peter Maydell Reviewed-by: Fabiano Rosas Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-id: 20250731134338.250203-1-peter.maydell@linaro.org --- target/arm/debug_helper.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/target/arm/debug_helper.c b/target/arm/debug_helper.c index aee06d4d426..579516e1541 100644 --- a/target/arm/debug_helper.c +++ b/target/arm/debug_helper.c @@ -940,6 +940,13 @@ static void dbgclaimclr_write(CPUARMState *env, const = ARMCPRegInfo *ri, env->cp15.dbgclaim &=3D ~(value & 0xFF); } =20 +static CPAccessResult access_bogus(CPUARMState *env, const ARMCPRegInfo *r= i, + bool isread) +{ + /* Always UNDEF, as if this cpreg didn't exist */ + return CP_ACCESS_UNDEFINED; +} + static const ARMCPRegInfo debug_cp_reginfo[] =3D { /* * DBGDRAR, DBGDSAR: always RAZ since we don't implement memory mapped @@ -1002,6 +1009,28 @@ static const ARMCPRegInfo debug_cp_reginfo[] =3D { .opc0 =3D 2, .opc1 =3D 3, .crn =3D 0, .crm =3D 4, .opc2 =3D 0, .access =3D PL0_RW, .accessfn =3D access_tdcc, .type =3D ARM_CP_CONST, .resetvalue =3D 0 }, + /* + * This is not a real AArch32 register. We used to incorrectly expose + * this due to a QEMU bug; to avoid breaking migration compatibility we + * need to continue to provide it so that we don't fail the inbound + * migration when it tells us about a sysreg that we don't have. + * We set an always-fails .accessfn, which means that the guest doesn't + * actually see this register (it will always UNDEF, identically to if + * there were no cpreg definition for it other than that we won't print + * a LOG_UNIMP message about it), and we set the ARM_CP_NO_GDB flag so= the + * gdbstub won't see it either. + * (We can't just set .access =3D 0, because add_cpreg_to_hashtable() + * helpfully ignores cpregs which aren't accessible to the highest + * implemented EL.) + * + * TODO: implement a system for being able to describe "this register + * can be ignored if it appears in the inbound stream"; then we can + * remove this temporary hack. + */ + { .name =3D "BOGUS_DBGDTR_EL0", .state =3D ARM_CP_STATE_AA32, + .cp =3D 14, .opc1 =3D 3, .crn =3D 0, .crm =3D 5, .opc2 =3D 0, + .access =3D PL0_RW, .accessfn =3D access_bogus, + .type =3D ARM_CP_CONST | ARM_CP_NO_GDB, .resetvalue =3D 0 }, /* * OSECCR_EL1 provides a mechanism for an operating system * to access the contents of EDECCR. EDECCR is not implemented though, --=20 2.43.0 From nobody Sat Nov 15 07:41:33 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1754068977; cv=none; d=zohomail.com; s=zohoarc; b=ePOkMHhK9hU0W6SYMrMzfkuH4YnLZIm7nJvaYWvnv+Go5rBWaoTEzD7kaVFfEUz26QLpbUXqm6oMjX/0kb8jcDIu3xn7q+FGTy0+0uzrn9rCC2NPTVTHt6qKJ/5Z6vSjgfiBBEmXFQo9zbtZ46ysS9Z68hjLg+bGdjTsS3RFxRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754068977; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=LcTTleyGohrqHXwUOe5A/ufrJLHVqKxLROdZ++CPg0A=; b=AREfE5kU43eG7DN7gLwJvgfdDRXZNBFCAEY4cnq/ISG+tl9FRZTxwdJO4QjP8or7f/3tVYA7GEcEVNLJuM7AVbiNKpAAX/fXxCe2zVIgG6ocCyBstqfPqbaVk4qsJMfsI+XXfJ9i2i3WmC4VyHEKPnX2Pg+tsU7ceG0QdIUpKAo= 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 1754068977504529.6480962969812; Fri, 1 Aug 2025 10:22:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uhtSV-0003jD-Np; Fri, 01 Aug 2025 13:22:19 -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 1uhs3K-0002ve-Ef for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:14 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uhs3I-0000z6-Ix for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:14 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3b7892609a5so1668709f8f.1 for ; Fri, 01 Aug 2025 08:52:12 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c4a2f03sm6176670f8f.72.2025.08.01.08.52.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 08:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1754063531; x=1754668331; 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; bh=LcTTleyGohrqHXwUOe5A/ufrJLHVqKxLROdZ++CPg0A=; b=iXaCI2Tu6xOww/HzOsInGS7/nvIKX8l/lKkFYXNgQZnPJiFZvduMR+M5eMPjukzrsa U/iC7zPgco1u8wMe7c3ikfqlRZOajkcKkXWqwYBtLwarYj/kZM5mu+w7mzgQbAPLhK6T i/RbNxSkkRBo+j0pi8bA0+gYZ+5ORb34aDPx2dvm5Nm///nClM9zyJ/FgRiu46CFMJ5D ynSoYm/LZVpKYWim/u0HR/y+ATz947ycY9tWsFAg8e85bucCIZVW7CpJAfazl8gNqIDl LuIg+Gzmmeg26kKx9sj7waKJa/mrJhWzjwxZIal0FuRvgMpVFxqGD6709GRkZfZVj9Pd RMuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754063531; x=1754668331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LcTTleyGohrqHXwUOe5A/ufrJLHVqKxLROdZ++CPg0A=; b=K5pCuPCthRoQNao/7JQd50EIlYpXo5FcIPApZbvUDwFOOGVQzCu7bDq5g8/KGKiudp bs160+BKXpnhrBqjR0Yh1dZTyYYksQfUriub5Vk7WAKCxa2Q7sgiUudB8FVgec0CS51s 2lmD/MCxOpuT6js0xx5F9DCNzn3WR064kRLQbE7qQfPdX6cdVLshulvfzy/CWTAZDGO4 g22yrN+h2EyzYdbXcITJ649hJajUGlkoqvJbRi0NrJ6uquWeHv6Li+xbT8XTWyjBdOKI qjC6r1EgTpNug6D/09kSaU5r8IGOCsifedrdR3hRp1H+jVyr4PmjyBVIeQoU4Ye+O0vT ux3A== X-Gm-Message-State: AOJu0Yyt3X2zsXBYewjAnSjS7V6IANdl9S/Pj+Kj9mjHyHpQ1XWxpcEq 0hIcv4d9Sx3Ma9uKFn/LzXv9lARP/CS0GsfbKW+9bROjCSoehN2/XEB0jeGFXiHl8v0RDkW7wn5 tuBZV X-Gm-Gg: ASbGncsDjKuucop04s//1jXecUZ+3AE0pbEct4Mao2PsuDYFyV2T6URp0AOBGv5hUDQ fyfNenS3lSLraYI4Fks5bNBf1Bv4QHDbXlBii1QuIJJ1UvDzTZjSadd/9yLL60t1z88FEeOMEcb h11kz5rpKE7nd8iZcl0gnGslhkcoOoRNxheW7IKpoy2Oczc28IT+vmMkgs9W3hdMGG6RqCHkBoR 6o+G01kDHb09Wm+fzG7M84PZAoY8m5/+iUIOsIlYHUo2ucGg6mgaVJQL34OXhW2EIspJAQ40O7/ deqC3QR0yJpm269A8ElumbiZhawus04fqdm1o47GXXQngD5BLOgpbCOHUNl9N6h0IgNUC/ksxKR g7G3WsS3IKnfs3l7eJc9cQEit3FbL X-Google-Smtp-Source: AGHT+IHOAbGxTjN3WxTi9B9e2fJovcAvSEF9ZMhVjP8rURqD/X7Q6F1p1qLJpz9t0HIiDscT3t3TUA== X-Received: by 2002:a5d:584e:0:b0:3b7:8410:22b6 with SMTP id ffacd0b85a97d-3b8d9468fb3mr236063f8f.6.1754063530692; Fri, 01 Aug 2025 08:52:10 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 6/8] target/arm: Fix big-endian handling of NEON gdb remote debugging Date: Fri, 1 Aug 2025 16:51:57 +0100 Message-ID: <20250801155159.400947-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250801155159.400947-1-peter.maydell@linaro.org> References: <20250801155159.400947-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42b.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: 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: 1754068980524124100 Content-Type: text/plain; charset="utf-8" From: Vacha Bhavsar In the code for allowing the gdbstub to set the value of an AArch64 FP/SIMD register, we weren't accounting for target_big_endian() being true. This meant that for aarch64_be-linux-user we would set the two halves of the FP register the wrong way around. The much more common case of a little-endian guest is not affected; nor are big-endian hosts. Correct the handling of this case. Cc: qemu-stable@nongnu.org Signed-off-by: Vacha Bhavsar Message-id: 20250722173736.2332529-2-vacha.bhavsar@oss.qualcomm.com [PMM: added comment, expanded commit message, fixed missing space] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/gdbstub64.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c index 64ee9b3b567..4fce58d895e 100644 --- a/target/arm/gdbstub64.c +++ b/target/arm/gdbstub64.c @@ -115,8 +115,22 @@ int aarch64_gdb_set_fpu_reg(CPUState *cs, uint8_t *buf= , int reg) /* 128 bit FP register */ { uint64_t *q =3D aa64_vfp_qreg(env, reg); - q[0] =3D ldq_le_p(buf); - q[1] =3D ldq_le_p(buf + 8); + + /* + * On the wire these are target-endian 128 bit values. + * In the CPU state these are host-order uint64_t values + * with the least-significant one first. This means they're + * the other way around for target_big_endian() (which is + * only true for us for aarch64_be-linux-user). + */ + if (target_big_endian()) { + q[1] =3D ldq_p(buf); + q[0] =3D ldq_p(buf + 8); + } else{ + q[0] =3D ldq_p(buf); + q[1] =3D ldq_p(buf + 8); + } + return 16; } case 32: --=20 2.43.0 From nobody Sat Nov 15 07:41:33 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1754069155; cv=none; d=zohomail.com; s=zohoarc; b=i+/1bOFqVfNkCuFmaM8ZOO9kmwAEvdtr68GXH2C8B819J7ZOJtNaM7xR+rJD3P5Okk27MBDvMjSKn0PgMrqbTiAPAsDnIMxQiB3U9WyAtQC2zfDN4uKgVC3Dm1nyEQ6aB1We375JFwkouapCmRihLa6lrgcRDMvZ+fyVXeHL9tQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754069155; 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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=pWii0yPY0huQAno9LKhz1KUD4m589jyklRR5CQS9UWE=; b=T6ErUTy7x/IQeNSVNwMOIawgm+qbMd4rLAIJj+bUeYKruYTHduu4LnZvntWNCDShOsez52LGvmwftOm9qeolBYwoLLPbwt3bhW9pCRG1Xgpl9iVzrLSasZfhL8oJl+gV/UuW/bxPcxSqpk62fKzlBqNP7ZwWmQyEwq6NsfBlqa4= 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 1754069155019601.2852547608423; Fri, 1 Aug 2025 10:25:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uhtSs-00064j-Sh; Fri, 01 Aug 2025 13:22:42 -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 1uhs3L-00032F-GT for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:16 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uhs3J-0000zI-Ik for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:15 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-454f428038eso16240295e9.2 for ; Fri, 01 Aug 2025 08:52:13 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c4a2f03sm6176670f8f.72.2025.08.01.08.52.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 08:52:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1754063532; x=1754668332; 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; bh=pWii0yPY0huQAno9LKhz1KUD4m589jyklRR5CQS9UWE=; b=MG48ncrhyDBdAa0E4jyYilWv0Kyou769ZzNa1cKHa4M76UXGyZ+bgdRSMwLHX8w/UN KYQ+YWvtPv2o60HwDc9bfxSv00Ix/TyKvQ+F4XeUtSlPjig2gUJprKzZNkqj4Zg9ehQ+ PcsC65gd02cY8cfHXr9K9SWXvBbHzCn7TNJIOeQmezWGnka5IkxOd8NoSzmQRXfinxXv dEh66rd9P7jg9koFAYSoPDE/PNn0dSzflck1OBB28drjQcOK/D+DcTVzqoW4whMt9t1E GjgG+9sfPxKsxENVKxv4V7GL5GvU2pS+iNdLVK+m4qHd0YnQhFY4h0F4lwflasDDJ8qu t8Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754063532; x=1754668332; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pWii0yPY0huQAno9LKhz1KUD4m589jyklRR5CQS9UWE=; b=WJiwG3RaOD6XHvQ2v8lElEnmtF0zp6u3bZ/YDsGuC+957Su5OG7I3qefzyMcIBUr1S ao7v6H/ljFlucCcghFl5FYbMNuKging0njMJYEVSVH08ok8YCm/2755qNwX42U69SAxw Cn3bUE8Vp7LkrKow585bqSqTDZUQUKIvWlLXYr0evv/P3jwPplHuHSyrV6q7oKU/HuRB qxuJmzu60iQUsGLeNwbjDEkWrJSKRsOZcqa5P23olW0y/4bMhAHJcswd/2+x95of048/ pvQnM5bKQnSyKzP+LzcMbBpKbOsHyvMoJRC/Q4cW/lQxG3aiLKIr+V/YG+/wESmAaWS0 8Ofw== X-Gm-Message-State: AOJu0YxgThgvxUObQK3ZTti4KxrRhHAcjUqXwlI6hRSI8w3AI+bRMXcu XEdVr2LwTpnEmGkTzGs3P2hU6BkPMq5mQUpPb5lnEOPV/X5WaqERX2PXV/aXMNjwV0ywO5T9oZQ URJab X-Gm-Gg: ASbGncuZeaJRwYs9mczmyZWjLzAQQhdCwfnj0azmEHhUP2zhlV3cCeihadbgZckIOj8 x1lUoWpfGnTXtVZBLOztRrnt9FIIjdzE6yYB9asZX+Hf2FgcJHopsV808mcWGcZg6Gf3YicMLU1 EUbkQFEoUE8D69CaGxQFCuz0whPYpoZJwFizCnNoI5MOzU3Le7wzH7NWIpq4x8TW7kv2c3MjIWf G3V0zE6oOC6/cVd21N7fUziwfs8vsSMTHW1rAhDS9aMgEhzUk6tlr9n4ekfBPZ/jtzbOaJruUIl O0zDDIyU4viiN8zFoQ7eRPz23GpANwwLSBwX94aIYV1rH43w4Zu05tCAijf562XQ0s/mUmXHvyx JmQGUdK1Sdq8ojwNHvyxH2teUwhz0 X-Google-Smtp-Source: AGHT+IFNFjYx4BQXPe0yiDVfPUqgQVuxHNBB9Po8++yPvyPWJJ0qteUYenm3j3l3tsLol/ejnsRIxg== X-Received: by 2002:a05:600c:35c8:b0:456:1dd9:943 with SMTP id 5b1f17b1804b1-458aa31a884mr32099905e9.3.1754063531786; Fri, 01 Aug 2025 08:52:11 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 7/8] target/arm: Fix handling of setting SVE registers from gdb Date: Fri, 1 Aug 2025 16:51:58 +0100 Message-ID: <20250801155159.400947-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250801155159.400947-1-peter.maydell@linaro.org> References: <20250801155159.400947-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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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: 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: 1754069157640116600 Content-Type: text/plain; charset="utf-8" From: Vacha Bhavsar The code to handle setting SVE registers via the gdbstub is broken: * it sets each pair of elements in the zregs[].d[] array in the wrong order for the most common (little endian) case: the least significant 64-bit value comes first * it makes no attempt to handle target_endian() * it does a simple copy out of the (target endian) gdbstub buffer into the (host endan) zregs data structure, which is wrong on big endian hosts Fix all these problems: * use ldq_p() to read from the gdbstub buffer * check target_big_endian() to see if we need to handle the 128-bit values the opposite way around Cc: qemu-stable@nongnu.org Signed-off-by: Vacha Bhavsar Message-id: 20250722173736.2332529-3-vacha.bhavsar@oss.qualcomm.com [PMM: adjusted commit message, fixed spacing] Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/gdbstub64.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c index 4fce58d895e..08e28585396 100644 --- a/target/arm/gdbstub64.c +++ b/target/arm/gdbstub64.c @@ -206,10 +206,17 @@ int aarch64_gdb_set_sve_reg(CPUState *cs, uint8_t *bu= f, int reg) case 0 ... 31: { int vq, len =3D 0; - uint64_t *p =3D (uint64_t *) buf; for (vq =3D 0; vq < cpu->sve_max_vq; vq++) { - env->vfp.zregs[reg].d[vq * 2 + 1] =3D *p++; - env->vfp.zregs[reg].d[vq * 2] =3D *p++; + if (target_big_endian()) { + env->vfp.zregs[reg].d[vq * 2 + 1] =3D ldq_p(buf); + buf +=3D 8; + env->vfp.zregs[reg].d[vq * 2] =3D ldq_p(buf); + } else{ + env->vfp.zregs[reg].d[vq * 2] =3D ldq_p(buf); + buf +=3D 8; + env->vfp.zregs[reg].d[vq * 2 + 1] =3D ldq_p(buf); + } + buf +=3D 8; len +=3D 16; } return len; @@ -224,9 +231,9 @@ int aarch64_gdb_set_sve_reg(CPUState *cs, uint8_t *buf,= int reg) { int preg =3D reg - 34; int vq, len =3D 0; - uint64_t *p =3D (uint64_t *) buf; for (vq =3D 0; vq < cpu->sve_max_vq; vq =3D vq + 4) { - env->vfp.pregs[preg].p[vq / 4] =3D *p++; + env->vfp.pregs[preg].p[vq / 4] =3D ldq_p(buf); + buf +=3D 8; len +=3D 8; } return len; --=20 2.43.0 From nobody Sat Nov 15 07:41:33 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1754069234; cv=none; d=zohomail.com; s=zohoarc; b=LfgCJP2xu/6V7NgiyENPw309Fl6I9pl4S8xNA6leflp0hqHgwyRS6GRxtmBRprXRVCEOoP3eBHWG6PZSJlyfYBvV0PC0AlMrxJQU4WWCsN48zyknPscz8pui+yVk6ve6DiJwXkZ/f/2ukik9AT6iiN5NSVRJd8dtP4zvBepRiJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754069234; h=Content-Type: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:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=QTe4QCluDBY66ITB8Ceh5te2MGHPGvOu4G1EJ1VCMyQ=; b=G8cjESBwR9GpU0EbLEEKpI8q3QUAh+FIh4QjkFcBXcQK7oTKsn9DYp/+yyTaT72ywB77K+65iR2q8UXMF596Kr8NHIdgE51pVBJ9IDhXWQmEvc3ZzGUqPCWMeZ9JwZ/8AdlWy8+FsxbH9yKUMOmgp1A+Cn1Qb/fZlUC3JqsRKpo= 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 1754069234224908.6398154342684; Fri, 1 Aug 2025 10:27:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uhtX3-0007XJ-FQ; Fri, 01 Aug 2025 13:27:01 -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 1uhs3M-0003AN-Rd for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:17 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uhs3K-0000zW-Da for qemu-devel@nongnu.org; Fri, 01 Aug 2025 11:52:16 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3b78d337dd9so677790f8f.3 for ; Fri, 01 Aug 2025 08:52:14 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b79c4a2f03sm6176670f8f.72.2025.08.01.08.52.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 08:52:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1754063533; x=1754668333; 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; bh=QTe4QCluDBY66ITB8Ceh5te2MGHPGvOu4G1EJ1VCMyQ=; b=zu+WCGsw9dJyr1BUcfundb8h69jGTDoRrJ0Bh2x9LOmX6w68ww9FNpMw9GtJaVmeWA PMzq0B7h1mdTNa2AJGWCh7JISJ6ELVqyJBJj65A/lTiZ5Zylqf5iREjjIyyZm+vkjWw6 9cELgXYi6Fu9CX+02ZSevQoxZXxUN8rxXJhnTWZ05QtxeSilYzJnruZduUxk7Vl47BBA vnUXJaSf1qMaYntlhsHf3tqOPwuYAdSKDoRX2M7a6hm0My1kA2+cb3ZKEKGcqU7LBrAX zvByA9OhDlUgvH4Np6zoqsNdPAwIKZhY3JG25g32AxQxzMDU3SDemL5ZGC5odTHtq6n6 hAUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754063533; x=1754668333; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QTe4QCluDBY66ITB8Ceh5te2MGHPGvOu4G1EJ1VCMyQ=; b=HkaUSkpjz+L8NqWefzzLRKLUBjDsffyJ5Ls640fVitrYKUvSFqrYRU4+GlOqns4Lvn M7+0Lb/WGdEu3FCTj4gpWBOs79JP4Ay1OM7dTx++MxSrzmUcaHu/M3tJn1pxg23peqUk QA6ughLbEDpQ1IhYydz9CzWtXK0BoPcO0+BLXv9sWmgx2a8WGKriXhY3MWJ4E9JqRzf5 xurt6S4N9hMSkZfGBASWebpIReB6v3Y87/W2eQ89PEaPfovwgv/bKZWrjzpjo1J4Z1p1 BcVPXlnwJMvizWksxDuQ/uANRV+EbAXidQoOlAFb9o8Lacspb0m1lHao/93be7xTQmBM mJ6Q== X-Gm-Message-State: AOJu0YxGY1t61K8cKG8Mg+Dthssm+p8PZR01WM2/bFGJPSYScHm1tsq4 hNh/w/86M1tYzJorrl4NuPQe6YRDABrK/600mnf/R/EKyHVoKJ1D+Tjmd/FQQglswliOZNLQRjS 4Qaxp X-Gm-Gg: ASbGncsF3Wp1auNqy7cJiue3mkXY0hV+byFJENSotmbQ/Xzudcp+jynObKtQJ5pD/IW rjXgrfeUA1dwc5jKQpgNSiFpqj1SlA6CAyddLnbntUmYJ8+8vJ17rVK3JvjHS2PhUiTA9liVRtU HGigbnri7t3O1+XCpeVyPvoPutWHIjghfM68tDg6yAxm82JaQWAttfHn8mO7+KEP7y7FngAUnGQ SEEuDEo2d9WnBMBYajCwM3Zdvx2znQ9k3UD9U3CUmFn6HbD2gSl+g5frqvO8lWtTvX1u9lBoGmc sQ2TMyuhx6GYkAN1HPmQCNEpzGbIPSNJmFXk/sujVask+uRI0vLQogbgTP9gxEQQISiVwR+dysX ST3WmQm1jvVBlUvW5DJWg7j9BVbxA X-Google-Smtp-Source: AGHT+IE78s51t+IF69k2YwEn2RBc3Giz5wEvJ2Fnn55VR8fEaas5wSbkiCTjRm9YAlK36HF9c7iYFA== X-Received: by 2002:a05:6000:1a86:b0:3b7:c703:ce4 with SMTP id ffacd0b85a97d-3b8d94c4d87mr235462f8f.59.1754063532686; Fri, 01 Aug 2025 08:52:12 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 8/8] tests/tcg: Fix run for tests with specific plugin Date: Fri, 1 Aug 2025 16:51:59 +0100 Message-ID: <20250801155159.400947-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250801155159.400947-1-peter.maydell@linaro.org> References: <20250801155159.400947-1-peter.maydell@linaro.org> 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=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.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: 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: 1754069236325116600 From: Gustavo Romero Commit 25aaf0cb7f (=E2=80=9Ctests/tcg: reduce the number of plugin test combinations=E2=80=9D) added support for running tests with specific plugins passed via the EXTRA_RUNS variable. However, due to the optimization, the rules generated as a shuffled combination of tests and plugins might not cover the rules required to run the tests with a specific plugin passed via EXTRA_RUNS. This commit fixes it by correctly generating the rules for the tests that require a specific plugin to run, which are now passed via the EXTRA_RUNS_WITH_PLUGIN instead of via the EXTRA_RUNS variable. The fix essentially excludes the tests passed via EXTRA_RUNS_WITH_PLUGIN from the rules created by the shuffled combination of tests and plugins, to avoid running the tests twice, and generates the rules for the test/plugin combinations listed in the EXTRA_RUNS_WITH_PLUGIN variable. Signed-off-by: Gustavo Romero Reviewed-by: Pierrick Bouvier Tested-by: Pierrick Bouvier Message-id: 20250801001305.2352554-1-gustavo.romero@linaro.org Signed-off-by: Peter Maydell --- tests/tcg/Makefile.target | 20 ++++++++++++++++--- tests/tcg/multiarch/Makefile.target | 2 +- .../multiarch/system/Makefile.softmmu-target | 2 +- tests/tcg/x86_64/Makefile.softmmu-target | 2 +- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 18afd5be194..af72903f898 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -170,6 +170,10 @@ endif PLUGINS=3D$(filter-out $(DISABLE_PLUGINS), \ $(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c)))) =20 +strip-plugin =3D $(wordlist 1, 1, $(subst -with-, ,$1)) +extract-plugin =3D $(wordlist 2, 2, $(subst -with-, ,$1)) +extract-test =3D $(subst run-plugin-,,$(wordlist 1, 1, $(subst -with-, ,$1= ))) + # We need to ensure expand the run-plugin-TEST-with-PLUGIN # pre-requistes manually here as we can't use stems to handle it. We # only expand MULTIARCH_TESTS which are common on most of our targets @@ -179,6 +183,13 @@ PLUGINS=3D$(filter-out $(DISABLE_PLUGINS), \ =20 ifneq ($(MULTIARCH_TESTS),) =20 +# Extract extra tests from the extra test+plugin combination. +EXTRA_TESTS_WITH_PLUGIN=3D$(foreach test, \ + $(EXTRA_RUNS_WITH_PLUGIN),$(call extract-test,$(te= st))) +# Exclude tests that were specified to run with specific plugins from the = tests +# which can run with any plugin combination, so we don't run it twice. +MULTIARCH_TESTS:=3D$(filter-out $(EXTRA_TESTS_WITH_PLUGIN), $(MULTIARCH_TE= STS)) + NUM_PLUGINS :=3D $(words $(PLUGINS)) NUM_TESTS :=3D $(words $(MULTIARCH_TESTS)) =20 @@ -186,19 +197,22 @@ define mod_plus_one $(shell $(PYTHON) -c "print( ($(1) % $(2)) + 1 )") endef =20 +# Rules for running tests with any plugin combination, i.e., no specific p= lugin. $(foreach _idx, $(shell seq 1 $(NUM_TESTS)), \ $(eval _test :=3D $(word $(_idx), $(MULTIARCH_TESTS))) \ $(eval _plugin :=3D $(word $(call mod_plus_one, $(_idx), $(NUM_PLUGINS)),= $(PLUGINS))) \ $(eval run-plugin-$(_test)-with-$(_plugin): $(_test) $(_plugin)) \ $(eval RUN_TESTS+=3Drun-plugin-$(_test)-with-$(_plugin))) =20 +# Rules for running extra tests with specific plugins. +$(foreach f,$(EXTRA_RUNS_WITH_PLUGIN), \ + $(eval $(f): $(call extract-test,$(f)) $(call extract-plugin,$(f)))) + endif # MULTIARCH_TESTS endif # CONFIG_PLUGIN =20 -strip-plugin =3D $(wordlist 1, 1, $(subst -with-, ,$1)) -extract-plugin =3D $(wordlist 2, 2, $(subst -with-, ,$1)) - RUN_TESTS+=3D$(EXTRA_RUNS) +RUN_TESTS+=3D$(EXTRA_RUNS_WITH_PLUGIN) =20 # Some plugins need additional arguments above the default to fully # exercise things. We can define them on a per-test basis here. diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Make= file.target index 38345ff8805..8dc65d7a064 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -201,7 +201,7 @@ run-plugin-test-plugin-mem-access-with-libmem.so: \ $(SRC_PATH)/tests/tcg/multiarch/check-plugin-output.sh \ $(QEMU) $< =20 -EXTRA_RUNS +=3D run-plugin-test-plugin-mem-access-with-libmem.so +EXTRA_RUNS_WITH_PLUGIN +=3D run-plugin-test-plugin-mem-access-with-libmem.= so endif =20 # Update TESTS diff --git a/tests/tcg/multiarch/system/Makefile.softmmu-target b/tests/tcg= /multiarch/system/Makefile.softmmu-target index 4171b4e6aa0..98c4eda5e00 100644 --- a/tests/tcg/multiarch/system/Makefile.softmmu-target +++ b/tests/tcg/multiarch/system/Makefile.softmmu-target @@ -77,5 +77,5 @@ run-plugin-memory-with-libmem.so: memory libmem.so run-plugin-memory-with-libmem.so: PLUGIN_ARGS=3D$(COMMA)region-summary=3Dt= rue run-plugin-memory-with-libmem.so: CHECK_PLUGIN_OUTPUT_COMMAND=3D$(MULTIARC= H_SYSTEM_SRC)/validate-memory-counts.py $@.out =20 -EXTRA_RUNS +=3D run-plugin-memory-with-libmem.so +EXTRA_RUNS_WITH_PLUGIN +=3D run-plugin-memory-with-libmem.so endif diff --git a/tests/tcg/x86_64/Makefile.softmmu-target b/tests/tcg/x86_64/Ma= kefile.softmmu-target index 3e30ca93074..4e65f58b570 100644 --- a/tests/tcg/x86_64/Makefile.softmmu-target +++ b/tests/tcg/x86_64/Makefile.softmmu-target @@ -40,5 +40,5 @@ run-plugin-patch-target-with-libpatch.so: \ run-plugin-patch-target-with-libpatch.so: \ CHECK_PLUGIN_OUTPUT_COMMAND=3D$(X64_SYSTEM_SRC)/validate-patch.py $@.out run-plugin-patch-target-with-libpatch.so: patch-target libpatch.so -EXTRA_RUNS+=3Drun-plugin-patch-target-with-libpatch.so +EXTRA_RUNS_WITH_PLUGIN+=3Drun-plugin-patch-target-with-libpatch.so endif --=20 2.43.0