[PATCH] ARM: entry: word-align the syscall table
Yenchia Chen
yenchia.chen at mediatek.com
Tue Sep 22 01:07:38 PDT 2026
On ARM, ENTRY is .align 0 and nothing else aligns the table.
It is layout-dependent and left to chance that unrelated code
(e.g. CONFIG_TRACE_IRQFLAGS fast path in entry-common.S) can shift
the table on or off a word boundary since Thumb-2 has 2-byte instructions.
The syscall dispatch loads the handler with
ldr pc, [tbl, scno, lsl #2]
which requires the table base to be word-aligned. Observed on our
platform, the first syscall loads pc from an unaligned address
and takes a fatal alignment exception:
Alignment trap: not handling instruction f858f02a at [<c0100208>]
Unhandled fault: alignment exception (0x001) at 0xc01002ba
Internal error: : 1 [#1] PREEMPT SMP THUMB2
Align the table in syscall_table_start so it is always word-aligned
regardless of THUMB2 layout.
Signed-off-by: Yenchia Chen <yenchia.chen at mediatek.com>
Signed-off-by: Huang-Sen Lin <eddy.lin at mediatek.com>
---
arch/arm/kernel/entry-common.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 88336a1292bb..831a40461cdf 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -321,6 +321,7 @@ __sys_trace_return:
.macro syscall_table_start, sym
.equ __sys_nr, 0
.type \sym, #object
+ .align 2
ENTRY(\sym)
.endm
--
2.45.2
More information about the linux-arm-kernel
mailing list