|
| 1 | +From 0d89d9811f25f757952ce098dcdf14c9465d2b65 Mon Sep 17 00:00:00 2001 |
| 2 | +Message-ID: <0d89d9811f25f757952ce098dcdf14c9465d2b65.1747663373.git.michal.simek@amd.com> |
| 3 | +From: Michal Simek <michal.simek@amd.com> |
| 4 | +Date: Mon, 19 May 2025 15:17:52 +0200 |
| 5 | +Subject: [PATCH] Revert "target/arm: Enforce alignment for LDM/STM" |
| 6 | + |
| 7 | +This reverts commit 9d7eb4183a17f129478adbdc314468d84573d83c. |
| 8 | + |
| 9 | +An alignment fault is generated if a data access is performed to an address |
| 10 | +that is not aligned for the size of the access, and strict alignment is |
| 11 | +required for the access. |
| 12 | +https://developer.arm.com/documentation/ddi0460/d/Memory-Protection-Unit/MPU-faults/Alignment-fault?lang=en |
| 13 | + |
| 14 | +The Qemu patch is likely correct and Zephyr test should be fixed but in the |
| 15 | +meantime revert this patch to pass tests in CI to give a time to find out |
| 16 | +what's wrong with Zephyr test. |
| 17 | + |
| 18 | +When this patch is revert issue is visible by this test: |
| 19 | +west twister -v -p qemu_cortex_r5 -O /tmp/twister -T tests/misc/llext-edk/ |
| 20 | + |
| 21 | +Signed-off-by: Michal Simek <michal.simek@amd.com> |
| 22 | +--- |
| 23 | + target/arm/tcg/translate.c | 4 ++-- |
| 24 | + 1 file changed, 2 insertions(+), 2 deletions(-) |
| 25 | + |
| 26 | +diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c |
| 27 | +index e555e885a13e..2b3ac25c71cd 100644 |
| 28 | +--- a/target/arm/tcg/translate.c |
| 29 | ++++ b/target/arm/tcg/translate.c |
| 30 | +@@ -7927,7 +7927,7 @@ static bool op_stm(DisasContext *s, arg_ldst_block *a) |
| 31 | + } else { |
| 32 | + tmp = load_reg(s, i); |
| 33 | + } |
| 34 | +- gen_aa32_st_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN); |
| 35 | ++ gen_aa32_st32(s, tmp, addr, mem_idx); |
| 36 | + |
| 37 | + /* No need to add after the last transfer. */ |
| 38 | + if (++j != n) { |
| 39 | +@@ -8009,7 +8009,7 @@ static bool do_ldm(DisasContext *s, arg_ldst_block *a) |
| 40 | + } |
| 41 | + |
| 42 | + tmp = tcg_temp_new_i32(); |
| 43 | +- gen_aa32_ld_i32(s, tmp, addr, mem_idx, MO_UL | MO_ALIGN); |
| 44 | ++ gen_aa32_ld32u(s, tmp, addr, mem_idx); |
| 45 | + if (user) { |
| 46 | + gen_helper_set_user_reg(tcg_env, tcg_constant_i32(i), tmp); |
| 47 | + } else if (i == a->rn) { |
| 48 | +-- |
| 49 | +2.43.0 |
| 50 | + |
0 commit comments