[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.1.2 26/58] target/arm: Fix arithmetic underflow in SETM instru
From: |
Michael Tokarev |
Subject: |
[Stable-9.1.2 26/58] target/arm: Fix arithmetic underflow in SETM instruction |
Date: |
Sat, 9 Nov 2024 15:08:27 +0300 |
From: Ido Plat <ido.plat1@ibm.com>
Pass the stage size to step function callback, otherwise do_setm
would hang when size is larger then page size because stage size
would underflow. This fix changes do_setm to be more inline with
do_setp.
Cc: qemu-stable@nongnu.org
Fixes: 0e92818887dee ("target/arm: Implement the SET* instructions")
Signed-off-by: Ido Plat <ido.plat1@ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20241025024909.799989-1-ido.plat1@ibm.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit bab209af35037b33f7eb1b8a3737085935bec3a3)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c
index 21a9abd90a..0cd9006e40 100644
--- a/target/arm/tcg/helper-a64.c
+++ b/target/arm/tcg/helper-a64.c
@@ -1348,7 +1348,7 @@ static void do_setm(CPUARMState *env, uint32_t syndrome,
uint32_t mtedesc,
/* Do the actual memset: we leave the last partial page to SETE */
stagesetsize = setsize & TARGET_PAGE_MASK;
while (stagesetsize > 0) {
- step = stepfn(env, toaddr, setsize, data, memidx, &mtedesc, ra);
+ step = stepfn(env, toaddr, stagesetsize, data, memidx, &mtedesc, ra);
toaddr += step;
setsize -= step;
stagesetsize -= step;
--
2.39.5
- [Stable-9.1.2 31/58] hw/intc: Don't clear pending bits on IRQ lowering, (continued)
- [Stable-9.1.2 31/58] hw/intc: Don't clear pending bits on IRQ lowering, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 30/58] target/riscv: Correct SXL return value for RV32 in RV64 QEMU, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 19/58] plugins: fix qemu_plugin_reset, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 21/58] Fix calculation of minimum in colo_compare_tcp, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 20/58] net: Check if nc is NULL in qemu_get_vnet_hdr_len(), Michael Tokarev, 2024/11/09
- [Stable-9.1.2 23/58] net/tap-win32: Fix gcc 14 format truncation errors, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 22/58] net: fix build when libbpf is disabled, but libxdp is enabled, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 33/58] hw/intc/riscv_aplic: Check and update pending when write sourcecfg, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 35/58] target/riscv/kvm: clarify how 'riscv-aia' default works, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 25/58] hw/sd/omap_mmc: Don't use sd_cmd_type_t, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 26/58] target/arm: Fix arithmetic underflow in SETM instruction,
Michael Tokarev <=
- [Stable-9.1.2 27/58] target/arm: Store FPSR cumulative exception bits in env->vfp.fpsr, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 28/58] stubs: avoid duplicate symbols in libqemuutil.a, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 36/58] target/riscv: Fix vcompress with rvv_ta_all_1s, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 37/58] target/ppc: Set ctx->opcode for decode_insn32(), Michael Tokarev, 2024/11/09
- [Stable-9.1.2 29/58] target/riscv/csr.c: Fix an access to VXSAT, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 32/58] target/riscv: Set vtype.vill on CPU reset, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 34/58] target/riscv/kvm: set 'aia_mode' to default in error path, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 38/58] target/ppc: Make divd[u] handler method decodetree compatible, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 40/58] ppc/pnv: Fix LPC POWER8 register sanity check, Michael Tokarev, 2024/11/09
- [Stable-9.1.2 42/58] target/ppc: Fix HFSCR facility checks, Michael Tokarev, 2024/11/09