]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/arm: Fix function_return helper load alignment checks
authorWilliam Kosasih <kosasihwilliam4@gmail.com>
Thu, 3 Jul 2025 08:55:56 +0000 (18:25 +0930)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 4 Jul 2025 12:44:20 +0000 (13:44 +0100)
This patch adds alignment checks in the load operations (when unstacking the
return pc and psr) in the FunctionReturn pseudocode.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154
Signed-off-by: William Kosasih <kosasihwilliam4@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250703085604.154449-4-kosasihwilliam4@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/tcg/m_helper.c

index f342d934896b90dfb6ac0d53d4f1db0da46ec82a..28307b56151b94458e1d6e5529f8304d46823b81 100644 (file)
@@ -1946,7 +1946,7 @@ static bool do_v7m_function_return(ARMCPU *cpu)
          * do them as secure, so work out what MMU index that is.
          */
         mmu_idx = arm_v7m_mmu_idx_for_secstate(env, true);
-        oi = make_memop_idx(MO_LEUL, arm_to_core_mmu_idx(mmu_idx));
+        oi = make_memop_idx(MO_LEUL | MO_ALIGN, arm_to_core_mmu_idx(mmu_idx));
         newpc = cpu_ldl_mmu(env, frameptr, oi, 0);
         newpsr = cpu_ldl_mmu(env, frameptr + 4, oi, 0);