Skip to content

Commit 7d1520c

Browse files
michalsimeknashif
authored andcommitted
meta-zephyr-sdk: xilinx_qemu: Disable alignment for R5
Likely Qemu patch is correct and Zephyr tests/misc/llext-edk/ should be updated not to cause unaligned accesses. But for now it is better to update Qemu not to break CI to have time to update test. Signed-off-by: Michal Simek <michal.simek@amd.com>
1 parent ccd59a4 commit 7d1520c

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+

meta-zephyr-sdk/recipes-devtools/qemu_xilinx/qemu-xilinx_git.bb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ SRC_URI += "gitsm://github.com/Xilinx/qemu.git;protocol=https;nobranch=1;name=qe
1616
file://0002-Enable-WFI-CPU-halting-in-icount-mode.patch \
1717
file://0003-riscvXX-softmmu-Enable-emaclite-driver-for-MB-V.patch \
1818
file://0004-riscv-Wire-CPU-timers.patch \
19+
file://0001-Revert-target-arm-Enforce-alignment-for-LDM-STM.patch \
1920
file://0008-tests-meson.build-use-relative-path-to-refer-to-file.patch \
2021
file://fixedmeson.patch \
2122
file://no-pip.patch \

0 commit comments

Comments
 (0)