Skip to content

Commit 8b5bd5a

Browse files
arndbRussell King (Oracle)
authored andcommitted
ARM: 9137/1: disallow CONFIG_THUMB with ARMv4
We can currently build a multi-cpu enabled kernel that allows both ARMv4 and ARMv5 CPUs, and also supports THUMB mode in user space. However, returning to user space in this configuration with the usr_ret macro requires the use of the 'bx' instruction, which is refused by the assembler: arch/arm/kernel/entry-armv.S: Assembler messages: arch/arm/kernel/entry-armv.S:937: Error: selected processor does not support `bx lr' in ARM mode arch/arm/kernel/entry-armv.S:960: Error: selected processor does not support `bx lr' in ARM mode arch/arm/kernel/entry-armv.S:1003: Error: selected processor does not support `bx lr' in ARM mode <instantiation>:2:2: note: instruction requires: armv4t bx lr While it would be possible to handle this correctly in principle, doing so seems to not be worth it, if we can simply avoid the problem by enforcing that a kernel supporting both ARMv4 and a later CPU architecture cannot run THUMB binaries. This turned up while build-testing with clang; for some reason, gcc never triggered the problem. Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: Ard Biesheuvel <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 345dac3 commit 8b5bd5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arm/mm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ config ARM_PV_FIXUP
675675

676676
config ARM_THUMB
677677
bool "Support Thumb user binaries" if !CPU_THUMBONLY && EXPERT
678-
depends on CPU_THUMB_CAPABLE
678+
depends on CPU_THUMB_CAPABLE && !CPU_32v4
679679
default y
680680
help
681681
Say Y if you want to include kernel support for running user space

0 commit comments

Comments
 (0)