• Arnd Bergmann's avatar
    ARM: 9137/1: disallow CONFIG_THUMB with ARMv4 · 8b5bd5ad
    Arnd Bergmann authored
    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: default avatarNick Desaulniers <ndesaulniers@google.com>
    Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
    8b5bd5ad
Kconfig 29.9 KB