From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@armlinux.org.uk>,
Nicolas Pitre <nicolas.pitre@linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Jonas Jensen <jonas.jensen@gmail.com>
Subject: Re: [PATCH] ARM: disallow ARM_THUMB for ARMv4 builds
Date: Fri, 16 Dec 2016 17:20:22 +0000 [thread overview]
Message-ID: <CAKv+Gu93Gtkh7spA-HUHNKSmDjhK_nuwR9KaDu8=S2GDyhUJCA@mail.gmail.com> (raw)
In-Reply-To: <20161216091457.2452987-1-arnd@arndb.de>
On 16 December 2016 at 09:14, Arnd Bergmann <arnd@arndb.de> wrote:
> With old compilers (gcc-4.3 and earlier), we run into a build error
> when CONFIG_ARM_THUMB is enabled in kernels that have both ARMv4 and
> ARMv4T/ARMv5 CPU support:
>
> arch/arm/kernel/entry-armv.S: Assembler messages:
> arch/arm/kernel/entry-armv.S:938: Error: selected processor does not support `bx lr' in ARM mode
> arch/arm/kernel/entry-armv.S:961: Error: selected processor does not support `bx lr' in ARM mode
> arch/arm/kernel/entry-armv.S:1004: Error: selected processor does not support `bx lr' in ARM mode
>
> The problem evidently is that 'bx' cannot work on the old CPUs, but
> the new ones have to use it whenever returning to THUMB user space.
>
Can't we use the old
tst lr, #1
moveq pc, lr
bx lr
trick? (where bx lr needs to be emitted as a plain opcode to hide it
from the assembler)
> This was discussed a while ago without a conclusion about what
> the proper patch should be to solve it, and came again up now when I
> experimented with old toolchain versions.
>
> This sidesteps the problem by declaring that we do not support
> the configuration and instead have to disable CONFIG_ARM_THUMB
> and not use THUMB user space with a kernel that supports the
> FA526 CPU, which is the only one that is allowed in a multiplatform
> configuration together with ARMv4T/ARMv5 anyway. This is not
> a regression because the configuration never worked anyway.
> The only platform affected by this is moxart, as no other ARMv4
> platforms are part of ARCH_MULTIPLATFORM.
>
> Cc: Jonas Jensen <jonas.jensen@gmail.com>
> Link: http://lkml.iu.edu/hypermail/linux/kernel/1404.1/00908.html
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/arm/mm/Kconfig | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> index 5d4920c069f2..f7b7aa37964f 100644
> --- a/arch/arm/mm/Kconfig
> +++ b/arch/arm/mm/Kconfig
> @@ -655,11 +655,7 @@ config ARCH_DMA_ADDR_T_64BIT
>
> config ARM_THUMB
> bool "Support Thumb user binaries" if !CPU_THUMBONLY
> - depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || \
> - CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || \
> - CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \
> - CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V6K || \
> - CPU_V7 || CPU_FEROCEON || CPU_V7M
> + depends on !(CPU_32v3 || CPU_32v4)
> default y
> help
> Say Y if you want to include kernel support for running user space
> --
> 2.9.0
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2016-12-16 17:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-16 9:14 [PATCH] ARM: disallow ARM_THUMB for ARMv4 builds Arnd Bergmann
2016-12-16 17:20 ` Ard Biesheuvel [this message]
2016-12-16 21:51 ` Arnd Bergmann
2016-12-18 11:57 ` Ard Biesheuvel
2016-12-18 14:16 ` Russell King - ARM Linux
2016-12-18 15:04 ` Ard Biesheuvel
2016-12-18 23:40 ` Russell King - ARM Linux
2016-12-19 4:10 ` Nicolas Pitre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAKv+Gu93Gtkh7spA-HUHNKSmDjhK_nuwR9KaDu8=S2GDyhUJCA@mail.gmail.com' \
--to=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=jonas.jensen@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=nicolas.pitre@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).