From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759922AbcLPJXm (ORCPT ); Fri, 16 Dec 2016 04:23:42 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:61561 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759718AbcLPJXg (ORCPT ); Fri, 16 Dec 2016 04:23:36 -0500 From: Arnd Bergmann To: Russell King Cc: Nicolas Pitre , Arnd Bergmann , Jonas Jensen , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: disallow ARM_THUMB for ARMv4 builds Date: Fri, 16 Dec 2016 10:14:39 +0100 Message-Id: <20161216091457.2452987-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:AdFcutvidF/T3LYZ1yha93/r+03vq7NQxrkkmkVXXZMAF+NjpoD vT4mGyCMhKuZrJdU/I/ZDelh+Pev5addhF70vjtzo0lDFTgvWqAt4avFkELg94Qp3xdB6oh QdtMNx34RdhfabY6rQxG/03MMr1i4yZUR3AcIR6FpWdFEKg+yaEwRDGrHQILfPI2auEl9kj 7iLdTkf2y56xGuWEXykXg== X-UI-Out-Filterresults: notjunk:1;V01:K0:iA+O5zhzLB0=:TJTmv0H8hQfcruIUr5VTSY 7VnWWm37o1cLxOfm5NdHEZA1cWOxHvrAuOf1jPUq0MZ5N0b5nEocAwp+OlaIVvxqCzpUhdRqJ iwf7akSeXjH/u0VWIoag1X4NTLA0KCUkAAltgGecoq82qwWgAipXLZA7Mmq52X6tlIe9kAR2h uT1YHXcoYo1BWC/Q+mUc4qgue+CI7FUjKTX3iAQwY1dVg1depsYhgMnSOE8xKAXyePTgHcEPE L+n9d87OtBj0z8X6oXghKu7HIHblOEsR6bTqJleYZS6IFtuXii7aJS1fP50Z8Y0+AneI6WVeU 8nUKrjUbjIWg2XUZ5jNGJ61Xx3qSwf/UdUFvn7OQPajAGV/NbPkk7IhaNixRt/eu8z3zmVChA BIJaVpwand/vTlksuNftVO+hOOarZYq/wwEjwirYa7OefcDe5zzW9Ns+qWVw2pHMnEYRT9hYq dy2sZ6JYhYQRuFX/u6VVjUuyVh+zaL5yqjb+szxlurNUN+Hm9iKuRWxCSaVMr25zAqJUNRnNP fOXyGRNAL+q/WEXrU+CZIryejkg6AehUghB8UBf3Vw4ctow8IhWogmYh+Cdml0OpYIRde6UlH zc34ii1mq3Hl5lVD5L1g8EDz35zd9fxsjpFW7soSpSUbV13squukd3jl9nFSMzpoLen4kAoEC NWmLTHlXIsx1XE2aYfCerxj+zlinAoY5UMvGVtSQfFLf3K3Kwodq3f6lH5Wb7aeculhA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 Link: http://lkml.iu.edu/hypermail/linux/kernel/1404.1/00908.html Signed-off-by: Arnd Bergmann --- 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