From patchwork Thu Feb 18 14:01:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102750 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp604491lbl; Thu, 18 Feb 2016 06:03:35 -0800 (PST) X-Received: by 10.66.225.177 with SMTP id rl17mr10387435pac.46.1455804215700; Thu, 18 Feb 2016 06:03:35 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23si9609804pfi.250.2016.02.18.06.03.35; Thu, 18 Feb 2016 06:03:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946141AbcBRODd (ORCPT + 30 others); Thu, 18 Feb 2016 09:03:33 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:65289 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425456AbcBRODb (ORCPT ); Thu, 18 Feb 2016 09:03:31 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0MduSz-1aJxvC2D53-00PefC; Thu, 18 Feb 2016 15:02:59 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , Linus Walleij , Maxime Coquelin stm32 , linux-kernel@vger.kernel.org Subject: [PATCH 1/9] ARM: ARMv7-M uses BE-8, not BE-32 Date: Thu, 18 Feb 2016 15:01:53 +0100 Message-Id: <1455804123-2526139-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:eTIOQ0H3Z3nTqaWm+7g27cJbf1cESmHJzILz4N6HWyIPoOr4/Xa hXKVWyMV3xjQdZ1V7VM5Dd8M+mEhHSoZDlcl/BmRu5jNuq7Uks1fcOC7eJtPoCrwceLG63r CnvqSjXtNWZsD0UsYIClvMkRSXy/ug/JQF9y85vNm+ec7vkDJsKbjaJQ/biaN6ExJ07Ngj9 fTPiNwhs18NqnQlSgE7Sg== X-UI-Out-Filterresults: notjunk:1; V01:K0:zAQaDq1Z8Yo=:3CADz4c7sqESJI/IlQRy8Y wSAeJT1r5i4YJ+tP5G6aOVVU4rrwI19msembjRXeNPY8x9QZ8vFsHKyNtwtzaOHl0pINewTBG K7Pe7NVpAURhT0/btJPqlz0bsnCnAIVpI5tsRbK8dHbMe6g+SBf08j1yLlfUuKWG2POdrR/gC Zlacz0oCW46kZut+Is5m99msIDqGcETQQQicIFu3yAsCIHfuefO4/coPsCx2WSdh4+5Zt3RMq N7qBB9o22DO2EdogmWcktPmg5cyW7/N0QJ9g76PvlwToES5uuyNwy1Yd0zVirTwXOsvd2rVuQ c9QFddD8MHTddpDqF/14Hoe3Yvdm6MSSIXmPhyquGezfHYVXiOjUAdndTy+6gcrrOETWBT7qx qJdB0+bK/xRusK1RJJibLNvOhYt+8f5Z9P73crKbO0NtV2fioa2Q0RQ7XnZvOuuWB58jXc4Ih Z9QrpkJe7my27xHeuGtaiwsRzFYoHdREq1JcDnP1xPAKbdjsSiYbtrpruDA6kuiIfP5b/5KwS +9Spz/LAeQSbwYJ/CNfOAp6jrX15zkWjqdKF9jnsYngcVpinggaxjbiFpkFzbaLmAtkW5di9a IytVdHBQCPPgtJuWgXHMiBX4VUwQfaDZGPe3kErYzRUFLeODW6/i+gKUxvNEhS4SGk6SSXlKX 3Gzukjupupfuu8N8MrbfIQOdPGSLtGcL+qGL/7mZw/hSlXIetFcBdaRvBjuwtM7q589k= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When configuring the kernel for big-endian, we set either BE-8 or BE-32 based on the CPU architecture level. Until linux-4.4, we did not have any ARMv7-M platform allowing big-endian builds, but now i.MX/Vybrid is in that category, adn we get a build error because of this: arch/arm/kernel/module-plts.c: In function 'get_module_plt': arch/arm/kernel/module-plts.c:60:46: error: implicit declaration of function '__opcode_to_mem_thumb32' [-Werror=implicit-function-declaration] This comes down to picking the wrong default, ARMv7-M uses BE8 like ARMv7-A does. Changing the default gets the kernel to compile and presumably works. Signed-off-by: Arnd Bergmann --- arch/arm/mm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 55347662e5ed..ff1637365494 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig @@ -723,7 +723,7 @@ config CPU_BIG_ENDIAN config CPU_ENDIAN_BE8 bool depends on CPU_BIG_ENDIAN - default CPU_V6 || CPU_V6K || CPU_V7 + default CPU_V6 || CPU_V6K || CPU_V7 || CPU_V7M help Support for the BE-8 (big-endian) mode on ARMv6 and ARMv7 processors. From patchwork Thu Feb 18 14:01:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102748 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp604790lbl; Thu, 18 Feb 2016 06:04:00 -0800 (PST) X-Received: by 10.98.89.215 with SMTP id k84mr10374054pfj.66.1455804238373; Thu, 18 Feb 2016 06:03:58 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68si9675363pfj.77.2016.02.18.06.03.57; Thu, 18 Feb 2016 06:03:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946183AbcBRODz (ORCPT + 30 others); Thu, 18 Feb 2016 09:03:55 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:64877 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425940AbcBRODu (ORCPT ); Thu, 18 Feb 2016 09:03:50 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0MhUQs-1aJhcJ0npq-00McWr; Thu, 18 Feb 2016 15:03:21 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , Marc Zyngier , Daniel Thompson , linux-kernel@vger.kernel.org Subject: [PATCH 2/9] ARM: change NR_IPIS to 8 Date: Thu, 18 Feb 2016 15:01:54 +0100 Message-Id: <1455804123-2526139-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:EYl9zg+MC6/f1TH4BCKmbakplC/UPu9i3JxxtLz+HDsugVLkHNz ca5q98HI9PXL/3qpJo9Qo3Kl570FvyL+DtcJlIMfoPwW009vmVJs8MApb0mXKyMP63Ep0sK E1Xl8oScTz1yhwjsMnb0plmhnLi7OEbgGAtfd1VcLcPfW63JmdxnVl7SHYtGeiiAU9jGc5C xkhs8W1py/WOuWGI58Ywg== X-UI-Out-Filterresults: notjunk:1; V01:K0:xeMkiULrTOY=:CkhkmJGmzQSnBhoHZ1o6Ew JfqVAY6wfNa0KCz1B7vzsxOQo3b47sEsMxUOXdVU0orndfPmMJh7QEGJLSTU0LFI1MDpi0oVf 1B4w2+6Aq265FSBvwaPOo6R4HWqQJeg45F/xdsbWZL59LU2LZFxAmNEl2bh+/w40PFXmzDnzY VnC0CE7luOi/dNKaBRXQ+IfUQwLL4SpgPHAol9Lyzs1CtzxE/YNcVpWDI1nTkMTy/YjI+0qkO wQkx9LzR9dxO5bG9pEuwAcDrsAscN3FeLgwcJb4h+5HLR3CK/LL4mB3xnSLLMQGetYVgUIv++ 9scCar9Ml/3E1nxCpxcuN6XiAlDUfAPppCrEqQFp5zDj2vzwvWW77qKhmV6VbZItFL1yifbWu 3kwO1QvhWxnzsWCiLoHVqUr3yc1GOsyh0o2T3Yx4QXLYKPwDUyeQhb6fPwiAOS9TmtM9JdMiE wqMNjpI1xLj8LLKNUeMEnKic1M3efSbL3CGut2Ut2VU6aU8RpO/8Xo7szCldncwsDXeHzNU0k qFBw/mrDz14muznWFM97Z7JTZxBgEFnMZfxuLEDFKofY97GAdo4gVpQXb/CLZ2LZG43hWhf9s Gt330vrNutrO5WcfvAZKR9yAL3TbJGQMWlfD43pkxT6S2RIBgJGQm+vzoK0QK1J+puurbOIIz dakYQbaeX/qdmtrI1+K5x5DiA3kY0BCn/U2PX5UtTC0anUMd8UVXtcdKOziCODVVwhAk= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When function tracing for IPIs is enabled, we get a warning for an overflow of the ipi_types array with the IPI_CPU_BACKTRACE type as triggered by raise_nmi(): arch/arm/kernel/smp.c: In function 'raise_nmi': arch/arm/kernel/smp.c:489:2: error: array subscript is above array bounds [-Werror=array-bounds] trace_ipi_raise(target, ipi_types[ipinr]); This is a correct warning as we actually overflow the array here. To make the tracing work correctly, this extends the array by one entry and increases NR_IPI accordingly. This only works after patch e7273ff49acf ("ARM: 8488/1: Make IPI_CPU_BACKTRACE a "non-secure" SGI"), which changed the number assignment from '15' to '8'. If we decide to backport this patch to stable kernels, we probably need to backport e7273ff49acf as well. As far as I can tell, the problem has existed since the tracepoints were originally added, but it only triggered a gcc warning with the later change to NR_IPIS. Signed-off-by: Arnd Bergmann Fixes: e7273ff49acf ("ARM: 8488/1: Make IPI_CPU_BACKTRACE a "non-secure" SGI") Fixes: 365ec7b17327 ("ARM: add IPI tracepoints") # v3.17 --- arch/arm/include/asm/hardirq.h | 2 +- arch/arm/kernel/smp.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.7.0 diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h index 3d7351c844aa..fe3ea776dc34 100644 --- a/arch/arm/include/asm/hardirq.h +++ b/arch/arm/include/asm/hardirq.h @@ -5,7 +5,7 @@ #include #include -#define NR_IPI 7 +#define NR_IPI 8 typedef struct { unsigned int __softirq_pending; diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index b4048e370730..d021566d71c2 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -482,6 +482,7 @@ static const char *ipi_types[NR_IPI] __tracepoint_string = { S(IPI_CPU_STOP, "CPU stop interrupts"), S(IPI_IRQ_WORK, "IRQ work interrupts"), S(IPI_COMPLETION, "completion interrupts"), + S(IPI_CPU_BACKTRACE, "CPU backtrace"), }; static void smp_cross_call(const struct cpumask *target, unsigned int ipinr) From patchwork Thu Feb 18 14:01:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102747 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp605045lbl; Thu, 18 Feb 2016 06:04:22 -0800 (PST) X-Received: by 10.66.136.231 with SMTP id qd7mr10271350pab.51.1455804262420; Thu, 18 Feb 2016 06:04:22 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si9678123pfi.36.2016.02.18.06.04.22; Thu, 18 Feb 2016 06:04:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946314AbcBROES (ORCPT + 30 others); Thu, 18 Feb 2016 09:04:18 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:63418 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946181AbcBROEO (ORCPT ); Thu, 18 Feb 2016 09:04:14 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0MdLhj-1aF0ec0XBL-00IVn2; Thu, 18 Feb 2016 15:03:41 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , Kees Cook , Catalin Marinas , Laura Abbott , linux-kernel@vger.kernel.org Subject: [PATCH 3/9] ARM: make free_memmap as __init Date: Thu, 18 Feb 2016 15:01:55 +0100 Message-Id: <1455804123-2526139-4-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:gq2l2xzuE8epLvgcdcRcWQ/NsAhEanrWvf4mB+/NuA57oumlaw3 r54D596ABkA5ja6jI9bFjVPDysjjVWUO3b4a4eWpChvFJyziL7aJD/BkFPYL7ZPOz3eTbef DCeHha/7I90mdJKH//AUZTzF4OJAQ9EBLRUFx9jnaeaxRdkROiVGQ1bP19GUNM0N0aAMrCt Ptlk6ZWFyFlSQPRUfO0IQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:NwxXmCbLBw8=:EI9phpV5LBJtnSj4xVTYzm QPyQSYjxgEanvoXkLzg2WzCm4M9CcJkPQtV8v9g8xGbyvpz6M+kenTW5HlV5sRagdm/kJLdtY uq007NlKGD2JN+eOfaet4UUpQW8oMrNm2sP9HJon9QrRz894f83PkB2Jr/sEQjxHUerFMe6Ec V7LEI/Cd7uVSveD8Mo3WoZf5hcqRFObJaLpHK6nn/DnfJDhscRkFrGVgdfAm50jya1T3C1ICI uzg3jJlQV4PxhV71DAEIo1bTkctYqjbZcF82cJg8K5vil++D5i2cQh0FwFKcpQ/l/mC9MOAHY gFUX5ANke7Vk4h4nziXHipzwT04JIBzAsdluRZgkC2tFNJyuXHVOwsRFzDXwUyqXuM+rPrzn0 jKF3RjQe/QA0nkgHaoxLaVyprygv2VWPFTbk/i5k/f5aK84uWJdVvmmJA/B4GOGEOtdwbavpG NpZuEGbxFULr1f1csVj9U0dwlAGUciayemWi0BkqwwLjNX84urdw9WaSrqv+OSbKjZ6Jwu3B4 YOdnaPouxypAq3QV1dCUk2tv74qLZQ1tNXQ7lk7WEEd2+H6QfmbgKuL87HhbdQ07fFg15QOzP kGq1W9ku6/pJA+WR8fFOup8gTosp6LbWBYpxmrg613/eV+N04UCtBP7fvEjPeDI03J3pzwkmK En1FXFoaqNb9sFsMLaUUDPYIexGGyztldchaD472w65xkUnGgYtlVUQhhmNPOIsNqqQ4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org free_memmap is an inline function, but gcc may choose to ignore that when CONFIG_OPTIMIZE_INLINING is set. In that case it is put in the .text section, causing a kbuild warning: WARNING: vmlinux.o(.text.unlikely+0x1a0): Section mismatch in reference from the function free_memmap() to the function .init.text:__memblock_free_early() The function free_memmap() references the function __init __memblock_free_early(). This is often because free_memmap lacks a __init annotation or the annotation of __memblock_free_early is wrong. FATAL: modpost: Section mismatches detected. Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them. This marks the function both inline and __init, which is a correct annotation and avoids the problem. Signed-off-by: Arnd Bergmann --- arch/arm/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 370581aeb871..a4db267c35b2 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -330,7 +330,7 @@ static inline void poison_init_mem(void *s, size_t count) *p++ = 0xe7fddef0; } -static inline void +static inline void __init free_memmap(unsigned long start_pfn, unsigned long end_pfn) { struct page *start_pg, *end_pg; From patchwork Thu Feb 18 14:01:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102746 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp605136lbl; Thu, 18 Feb 2016 06:04:30 -0800 (PST) X-Received: by 10.66.119.202 with SMTP id kw10mr5271647pab.110.1455804270075; Thu, 18 Feb 2016 06:04:30 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fk7si9647820pac.50.2016.02.18.06.04.29; Thu, 18 Feb 2016 06:04:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946328AbcBROEZ (ORCPT + 30 others); Thu, 18 Feb 2016 09:04:25 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:55311 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946181AbcBROEV (ORCPT ); Thu, 18 Feb 2016 09:04:21 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LfzrP-1aCmhJ382t-00pbTo; Thu, 18 Feb 2016 15:03:50 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , linux-kernel@vger.kernel.org Subject: [PATCH 4/9] ARM: add CONFIG_PHYS_OFFSET default values Date: Thu, 18 Feb 2016 15:01:56 +0100 Message-Id: <1455804123-2526139-5-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:UcZoG2SRS0NasKo0oOjRKzl2hEhaVPjw2bj1P5Mn+DZ3cdFl74b T/rtNAMnZ8gpiq7Mmeiw2k6KWCVOZ7MuV0vqApqOtOKWFIuzEri2zAvHnFEgJHALk0exW6T Cm7DwcNN1gy3u/U8pE6VJAy7CDhnbZzHHF/4heScBOs3KqYLK6kMm1yA8UlhfNyyBUu0nqh yEGhy2JboI2UBULEqyHKg== X-UI-Out-Filterresults: notjunk:1; V01:K0:TySHnPNcSFI=:7GAyfjnLHYDxNzU5KtRutn hlwtjFeBspxAVIvihOksfOdIZUA6n+YhZ0CebOBlmpM7ANqBHvv+7R750AXAjKTsdSTguC0Yl KimuJyMotgnINGLAyNPdsWpTgh73UmDEclesYSKf01GRvxdkTtp9VAA5fFLv41vjhQbdUbWL/ Y31UIFyf7BIsX3uQEQy/akLw+JyvaS3T74AM4W0kEVmAUHtGwHgMEvh5dnbi9UF9+v0g69oHW 9bdp2uXMgyvte2DiypAnbDEhKgEukqxopcXGY5XYs0Buk78xH3varA2sG5gV4jJCeZcySZZrO Z/+k7zMX3f6cg4vjtUynWD3s6gGSKPbvKnmiKGuFI2/hJdekXAW3TEdaXv04HCTD/K/FEwr/2 2qG09sKRw2zodMgFDML2zEHc32uAIGnOQqmeJ0m1qlh0/bflaCPfgmjbxMF/a7cngy/Y+EqHm hGLIvut4vE50Uc4XRkor4syqaa9gwRcQDyThRyJIP+1plUAF1y6qtf0orvJxjbMkvMY3ojs6/ oyXKU0Qkva8dvTcTfTwlGlioPbhE0M0t1Q49sRGHc0xV6NFkrcwwqMMRMTSO3enZTx8MguaP7 QiRgtqlurbUqhE6guqZkDm6xyuHLNYqaF3LdsgU4lNW0SPW8J4eRLGY7hO4ZQGIWnfPGLjqgR vN2CJdjH1CdAo+7t30Now6sv7vtiJmnOjLbxXwwPJS+NAodLl9Fmzz0vzhM7x5boWsR0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For platforms that are not yet converted to ARCH_MULTIPLATFORM, we can disable CONFIG_ARM_PATCH_PHYS_VIRT, which in turn requires setting a correct address here. As we actualy know what all the values are supposed to be based on the old mach/memory.h header file contents (from git history), we can just add them here. This also solves a problem in Kconfig where 'make randconfig' fails to continue if no number is selected for a 'hex' option. Users can still override the number at configuration time, e.g. when the memory visible to the kernel starts at a nonstandard address on some machine, but it should no longer be required now. To make this foolproof, another patch is required in mach-davinci to prevent a configuration with both DMx and DA8xx enabled but ARM_PATCH_PHYS_VIRT disabled. The two patches however can be merged independently as there is no direct dependency between them. Signed-off-by: Arnd Bergmann --- arch/arm/Kconfig | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) -- 2.7.0 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index be00b53f399b..7839c9923709 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -271,15 +271,29 @@ config PHYS_OFFSET depends on !ARM_PATCH_PHYS_VIRT default DRAM_BASE if !MMU default 0x00000000 if ARCH_EBSA110 || \ + ARCH_DOVE || \ ARCH_FOOTBRIDGE || \ + (ARCH_GEMINI && GEMINI_MEM_SWAP) || \ ARCH_INTEGRATOR || \ + ARCH_IOP33X || \ ARCH_IOP13XX || \ + ARCH_IXP4XX || \ ARCH_KS8695 || \ - (ARCH_REALVIEW && !REALVIEW_HIGH_PHYS_OFFSET) - default 0x10000000 if ARCH_OMAP1 || ARCH_RPC + (ARCH_REALVIEW && !REALVIEW_HIGH_PHYS_OFFSET) || \ + ARCH_W90X900 + default 0x10000000 if (ARCH_GEMINI && !GEMINI_MEM_SWAP) || \ + ARCH_OMAP1 || \ + ARCH_RPC default 0x20000000 if ARCH_S5PV210 + default 0x30000000 if ARCH_S3C24XX default 0x70000000 if REALVIEW_HIGH_PHYS_OFFSET - default 0xc0000000 if ARCH_SA1100 + default 0x80000000 if (ARCH_DAVINCI_DMx && !ARCH_DAVINCI_DA8XX) || \ + ARCH_NETX || \ + ARCH_LPC32XX + default 0xa0000000 if ARCH_IOP32X || ARCH_PXA + default 0xc0000000 if (ARCH_DAVINCI_DA8XX && !ARCH_DAVINCI_DMx) || \ + ARCH_CLPS711X || \ + ARCH_SA1100 help Please provide the physical address corresponding to the location of main memory in your system. From patchwork Thu Feb 18 14:01:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102745 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp605341lbl; Thu, 18 Feb 2016 06:04:48 -0800 (PST) X-Received: by 10.66.242.17 with SMTP id wm17mr10184258pac.155.1455804287922; Thu, 18 Feb 2016 06:04:47 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ez9si9693181pab.20.2016.02.18.06.04.47; Thu, 18 Feb 2016 06:04:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946353AbcBROEp (ORCPT + 30 others); Thu, 18 Feb 2016 09:04:45 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:55602 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425501AbcBROEk (ORCPT ); Thu, 18 Feb 2016 09:04:40 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0M3C4d-1ZeZPp3TMN-00sx0C; Thu, 18 Feb 2016 15:04:10 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , linux-kernel@vger.kernel.org Subject: [PATCH 5/9] ARM: atags_to_fdt: don't warn about stack size Date: Thu, 18 Feb 2016 15:01:57 +0100 Message-Id: <1455804123-2526139-6-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:MrDLxKt0Oq18rZkIZ+i4+xnDQcy07/xSGnft/Fje2Bu7OxrMkI+ /ZcZPQTqJhsecEM2VWHsf8TJQjnycQQE0Sk05UZAQ9ZDNhJCnVpEXLbn9OIcwhnUFwgLmQj g7exzWdi2YYQpZDrxNp5iQuHbzRoJTW2yTT2b1vFFa6EbGFxg97scwFBDCcgY4sRmo9yb+R CtcTl5dVVb915yy7xdCYg== X-UI-Out-Filterresults: notjunk:1; V01:K0:xDLlub+n3tI=:0zTcNiMuw3Yen6E6pKJmCY 7xXjPGIHNTpteVJcTutLdNB9ozFHoGXu05wdYNtrhhSkuG0u3lglk5+38u5nRcECh62wS8yPC LzVuxxMwHMsEKiGGuOYqvgw2P4rYc5TEoxlgqYEhE/qDlwPg3cSNSZBbgyrbF/8yUTbeCR1z/ KuQAD+nJb/DsKx8ei6u1pwj05JZtx4wbWJsKx5PWdljdlqeIn21GRl2EpgrvQZJqPyooWUFih oBZTl84A5I6mL91ouRZgGfV0GXdCBTn0UsRrekQBGod5gwxMLdB7d+jQAR7Pa/30/hMIxSBbX 5vkeY9wf9S1bfXUK0Hy5I4MvpZNQVwAAHHmO72DSzhdh5LH9H5luzG9kTjB2leIFVM7Nj5fzs Nq/BcJ3M6lGPfPkrE9MBSXxr+oOgh02Ap2OtL+yhUsNQ/xnYD9KEv7RBF0qIAyF5YGh2ZVdEa folAw3uqD6+JpXWZBZBNMt71E95UjGeMa0/m81Wnd8MsVhxFbhnqBZJZyvESpQ0XW4qv2eWyf Ur+VM9qRS7B2k1iF7SFf+25gjlOfuBsWNyxiQkmkhii1P+zdng1sEAe8dhN3LctreR+J90IJ6 h4ochpA7BsSgo7HYP3sRTaK4fwYIvS2Ytn2KElQS037mGCe4Vif/ie5b4UwfUYBTWDn9Mwu9A 1oDlkPdInM+bLVbuy1XIte7f4m6RxW3Aat3plUr++f5KUSCz4kiqiu+19rvWPetvJl/U= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The merge_fdt_bootargs() function by definition consumes more than 1024 bytes of stack because it has a 1024 byte command line on the stack, meaning that we always get a warning when building this file: arch/arm/boot/compressed/atags_to_fdt.c: In function 'merge_fdt_bootargs': arch/arm/boot/compressed/atags_to_fdt.c:98:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=] However, as this is the decompressor and we know that it has a very shallow call chain, and we do not actually risk overflowing the kernel stack at runtime here. This just shuts up the warning by disabling the warning flag for this file. Signed-off-by: Arnd Bergmann --- arch/arm/boot/compressed/Makefile | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.0 diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 7a6a58ef8aaf..b5db4c868640 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -85,6 +85,8 @@ $(addprefix $(obj)/,$(libfdt) $(libfdt_hdrs)): $(obj)/%: $(srctree)/scripts/dtc/ $(addprefix $(obj)/,$(libfdt_objs) atags_to_fdt.o): \ $(addprefix $(obj)/,$(libfdt_hdrs)) +CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN} + ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y) OBJS += $(libfdt_objs) atags_to_fdt.o endif From patchwork Thu Feb 18 14:01:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102744 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp605427lbl; Thu, 18 Feb 2016 06:04:55 -0800 (PST) X-Received: by 10.66.124.170 with SMTP id mj10mr10386050pab.92.1455804295503; Thu, 18 Feb 2016 06:04:55 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c74si9688072pfj.65.2016.02.18.06.04.55; Thu, 18 Feb 2016 06:04:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946367AbcBROEx (ORCPT + 30 others); Thu, 18 Feb 2016 09:04:53 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:59502 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425501AbcBROEt (ORCPT ); Thu, 18 Feb 2016 09:04:49 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0M8hqV-1Zk5jT43Bz-00wEGK; Thu, 18 Feb 2016 15:04:21 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , Will Deacon , linux-kernel@vger.kernel.org Subject: [PATCH 6/9] ARM: uaccess: avoid warning for NOMMU in access_ok Date: Thu, 18 Feb 2016 15:01:58 +0100 Message-Id: <1455804123-2526139-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:Ua541HzBJT5rCyNvpOhC4kw9l2dFl7MaSTPEFPn0n16hK6rL6oN Qc1eYbk/WgxLhLIOWEZSFlb4WD1SuTmLFkRP6lhMPjlNN4f0lWnUGknUiIohMUbOHJXxLUS MhDQpgGIGRISCRUMypJcoyuD6V1Nx2yfG4DHTELkklq+E/jcgFFSIKlgZIa/XkdrApsTNY3 iTMlWUTAkLYtlF9PuUDAA== X-UI-Out-Filterresults: notjunk:1; V01:K0:12xWeJA8upo=:Wp5jSG9kqxqi9oiULc8ova npDFm02q22/UblxHsiL9QCcjFG3xIKEq5iayJ/PDeXc27CIB37B1+9UyxCcgzG/pI/MFAAOFV 8+JjZjhRo2BYLOUEbWNJtA7T8YMLGNSNdviQQs7uypMfiJi6vI6A0Ww74hu/RYMA5ciRglSYc KjNmGhfbw9bGRyYzcDxK/p77WFndQ54YmuFLCY7xYbiBfK6i5xoHJpFO0LkJTZz8KahlE3/wF 5VpHPk6qG8OoCFYiFx2zIqYS/NXx2kgiUQpgGud3rxCDulzwS687oQtu/WlXlFwyfFyPeJFv7 AL2cBC6BymlTVjiChnmC9nCVVzVfTq07meInm1LoRPZOuplKvxgfL3SOgPSeZ78mqDO35nsdb 61kemBFbqe2SPA2wAHgXsAjxf4TmoXq7RDfwoYCw/ViWfHutP3jbva2VbhefZXqDO6WNQ0Pqf PyAtFYfKstouSNo3DNoVML+0K01ZUAJ08mAxuXmYUPQtN+revM+xyi5PfQIc7EtFq1pF41P8R YrKOX3t1OtDyNCrHgs0EH+4mi+JzG7MsnzgSAAkn68/Hg3KozGQGEu6Tb5rZtNb2RlLGts+iD QplrMowa8bNnIxkJcduUScLdMu7IduU0fzkezONl7eiQ/L2K0WJBS1SseAJgKWdE2isTp7qfb fSN9yv/losI/X1ZeYjwniXitjA5cia6JrliR2p/DiIUdS15Ugbx1vr5TW00aRA/BgyfI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_MMU is disabled, the access_ok() and __range_ok() macros always return success, and there is a cast to void to ensure the compiler does not warn about an unused address variable. However, at least one driver has a variable for the size argument as well and does warn about that one: drivers/vhost/vhost.c: In function 'vq_access_ok': drivers/vhost/vhost.c:633:9: warning: unused variable 's' [-Wunused-variable] This changes the macro to also ignore the size argument explicitly to shut up that warning. Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 35c9db857ebe..9c74c84a10d2 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -290,7 +290,7 @@ extern int __put_user_8(void *, unsigned long long); #define segment_eq(a, b) (1) #define __addr_ok(addr) ((void)(addr), 1) -#define __range_ok(addr, size) ((void)(addr), 0) +#define __range_ok(addr, size) ((void)(addr), (void)(size), 0) #define get_fs() (KERNEL_DS) static inline void set_fs(mm_segment_t fs) From patchwork Thu Feb 18 14:01:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102743 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp605574lbl; Thu, 18 Feb 2016 06:05:09 -0800 (PST) X-Received: by 10.98.16.12 with SMTP id y12mr10405631pfi.6.1455804309389; Thu, 18 Feb 2016 06:05:09 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si9625250pas.72.2016.02.18.06.05.08; Thu, 18 Feb 2016 06:05:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946381AbcBROFF (ORCPT + 30 others); Thu, 18 Feb 2016 09:05:05 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:53897 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425501AbcBROE7 (ORCPT ); Thu, 18 Feb 2016 09:04:59 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0MINTj-1aXlR33jxf-0049lQ; Thu, 18 Feb 2016 15:04:31 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , linux-kernel@vger.kernel.org Subject: [PATCH 7/9] ARM: move NO_DMA definition to ecard.h Date: Thu, 18 Feb 2016 15:01:59 +0100 Message-Id: <1455804123-2526139-8-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:xjzITam8+y5jXUHhplFcv7nBpg4QY2wt5rzrZcoWPDYkTQEK5iG ZeMgxJRHOydUhtbEAWLKheDRJPC9QG9MJVbiHzewRBOa/SbICc00RX+nadmflTAgzi7uinS bIwTgqGnTU2j66/jx46I8wySFvGQKAFAOuhZ0nQF1nugRVAoKkKerA7US0nFiRuYARagTeW RvsR0Jc4fbHr5sY/Wkqyw== X-UI-Out-Filterresults: notjunk:1; V01:K0:3RMOYUMtglE=:NBsuQDIHfR0pepLsfMcBlo iqmop1Z5d2nu2IVVjaIBnuVl5HcTcarH421wHmqpBDYItB+a9TskX/SP7VRwbfPt85P1gHhKL 3cqkzRHXXAfZHqGrwgg9cEtdi4mQPqPV/oz7rccF0We114xAauztr5Petz7/g3hIw7MzyqvFY jkJKrsy+DXhYbIymoCY7WarBhzgYTDkjsFbVkDPNROJG1hvp3Dks5AtlxRdGOGYTuFd2eWnnR rddHFQ7f/DQ34t8AP4awrRkucHiZXp35oVOmyP4OQFEEOxDoB9hqGSoeWPTCjOm98NZ7uinpV dXPbc2fGwCB2z4V1TrYP2hAkpf3WdH9kBBT/cTqVMp4cbQ68C5sUOdU789LK98sAm5/TZ21Gj PqjoQ2uu+EGXNjUK3ENEN2y+JCnhcmYm37RBi03FA5IO6ESQYWKrM8tBTpt/rz1+3499Qfn0M 7mPf4zE1puF/EwFKcZkCNKdvrBa87qbPiBXvm7+iOQh/yAWnyi04PEmeSrsWeccSugDikxiCj 9alsUjgRw6olQ2GErU63VYrxH/cWHmSV2qH9+eugZ1FR8MiXu4FgXrMhaPoD8nhKtEYI3EivQ N8sggmM3mTwW+kIAoq9YnmNqyzIOMBAqYxOc/0Ed1c+V81qGlD1JR68FHoJSKMrj2Qg0rOqDu B1PwYK50ccGdFk5jKFscFlZeP4F500RmHvh6GDjZwHasVjOLQTIXbCOxbc6vWuceUjBQ= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The NO_DMA macro is only used on the RiscPC ecard bus, and conflicts with a couple of driver specific macros with the same name: drivers/scsi/eata.c:571:0: warning: "NO_DMA" redefined #define NO_DMA 0xff In file included from ../drivers/scsi/eata.c:495:0: arch/arm/include/asm/dma.h:140:0: note: this is the location of the previous definition #define NO_DMA 255 This moves the definition out of the asm/dma.h header that is used by all ISA DMA API users and into the ecard header. Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/dma.h | 4 ---- arch/arm/include/asm/ecard.h | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.7.0 diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h index bb4fa67da541..573128481fc4 100644 --- a/arch/arm/include/asm/dma.h +++ b/arch/arm/include/asm/dma.h @@ -136,10 +136,6 @@ extern void set_dma_speed(unsigned int chan, int cycle_ns); */ extern int get_dma_residue(unsigned int chan); -#ifndef NO_DMA -#define NO_DMA 255 -#endif - #endif /* CONFIG_ISA_DMA_API */ #ifdef CONFIG_PCI diff --git a/arch/arm/include/asm/ecard.h b/arch/arm/include/asm/ecard.h index eaea14676d57..d3e16628c792 100644 --- a/arch/arm/include/asm/ecard.h +++ b/arch/arm/include/asm/ecard.h @@ -83,6 +83,10 @@ #define CONST const #endif +#ifndef NO_DMA +#define NO_DMA 255 +#endif + #define MAX_ECARDS 9 struct ecard_id { /* Card ID structure */ From patchwork Thu Feb 18 14:02:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102742 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp605655lbl; Thu, 18 Feb 2016 06:05:17 -0800 (PST) X-Received: by 10.98.13.68 with SMTP id v65mr10210617pfi.150.1455804317586; Thu, 18 Feb 2016 06:05:17 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si9642026pfi.163.2016.02.18.06.05.17; Thu, 18 Feb 2016 06:05:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946396AbcBROFO (ORCPT + 30 others); Thu, 18 Feb 2016 09:05:14 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:61184 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425501AbcBROFJ (ORCPT ); Thu, 18 Feb 2016 09:05:09 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0LfAVs-1aCVpi2wK8-00omGd; Thu, 18 Feb 2016 15:04:42 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , Nicolas Pitre , linux-kernel@vger.kernel.org Subject: [PATCH 8/9] ARM: do not use optimized do_div for ARMv3 Date: Thu, 18 Feb 2016 15:02:00 +0100 Message-Id: <1455804123-2526139-9-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:szUbznyZjp1Denmj3hWaReWQT4ox8XoI6iNEWzVlUnAlebMFGEi 7mMgXdvDCdaVASX9x5hrtrUhFPnEP1pNO1AfKMtddL8xUjeNKO0jLgwLKoo5q/eVvzwZzd1 U5dRm+4et5cicxSehSmMZl/HhWBotPBAD5nmPLGE1CRp3s2KnhQqcqLtUBm+Ij7xnxwGXrq Qkc3xSdu8CPMhw4gALcfg== X-UI-Out-Filterresults: notjunk:1; V01:K0:HQ4cD1EA/yo=:/gSAfULom+uMoLVmlo5l/p ACci4vHHkXV1nFTwzSa4IA/lYwQd4KQQXYc6oCLLuXG6NnvTWiCYRjYAxlxjDMyXLWIRi32sY mKNtiWjM2KHInocJiABQtemHeAfLoyRLeurS5xV/8mrrDM2WuSmlAjzBZrSkkz4BtOxp7xCIv oSe4NjuE4T23HdKTxHIIlMsm4E5tN3UYuPJQwRjWY4XAKOJe0+1oB/82XBh2vufEaRL/7qAYo sc+sFdi1ZqolIhHZ4e46pjDk1cCH1zuoPZee2VfCZ1bqRPbATkEQ0HfBTHmI/SNtN/VNRkbtz prKFsCHUQGKpTZiyZsTKXd6GfMrUZxXEgw3uU5pS8QssjAObGs9AUl6wpocJ9jnyM6AJwNkdX OrqFqZt20a39uQuv9bbb6VIaM1l61HmT61VCthDFNSA4/JcZ7l0sFPAvlFiPXN4VezJ0Khadw 0TEW6vWqHFQNe4S9+2Z0LwcFYEeo46qj+rO7VxuT6I3CVpunsw4znf4kGsPMC2qKtvUNOf3mo pcdMbs0L8uNF20wVSa3jud9tR5zC86GdcM8OFZ0oBaHTvP0N3f6AlG3h5VetKrzaah28QSJMi yCWZblFe33zi8RXe1RK3URxhEbzLKVpDf93JWI2mR7AwBwr4V+XkbEBBOjluNIYsbxI7ruD8I Y8ZREWgjE5lrj2XZuyDpXH8IiMQL1Zoj1Ds9BEoE2WbjHW71HaZA7qxGbvTYh8D+X8b4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The gcc-4.9 optimization goes wrong while building target_core_iblock.c for ARMv3 and leaves a bogus reference to __aeabi_uldivmod in the output: ERROR: "__aeabi_uldivmod" [drivers/target/target_core_iblock.ko] undefined! I could not find anyone who is interested in fixing it in gcc, so as a workaround this disables the do_div magic, just like we do for old compilers and for OABI. Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/div64.h | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.7.0 diff --git a/arch/arm/include/asm/div64.h b/arch/arm/include/asm/div64.h index 7d919a9b32e5..958fdc2363f5 100644 --- a/arch/arm/include/asm/div64.h +++ b/arch/arm/include/asm/div64.h @@ -58,6 +58,14 @@ static inline uint32_t __div64_32(uint64_t *n, uint32_t base) */ #define do_div(n, base) __div64_32(&(n), base) +#elif defined(CONFIG_CPU_32v3) + +/* + * modern compiler versions (>= gcc-4.9) tend to misoptimize + * the code for ARMv3, and this is not getting fixed any more. + */ +#define do_div(n, base) __div64_32(&(n), base) + #else /* From patchwork Thu Feb 18 14:02:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102741 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp605736lbl; Thu, 18 Feb 2016 06:05:25 -0800 (PST) X-Received: by 10.98.79.28 with SMTP id d28mr10252214pfb.77.1455804325671; Thu, 18 Feb 2016 06:05:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u11si9647199pas.102.2016.02.18.06.05.25; Thu, 18 Feb 2016 06:05:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946410AbcBROFU (ORCPT + 30 others); Thu, 18 Feb 2016 09:05:20 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:55390 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425501AbcBROFP (ORCPT ); Thu, 18 Feb 2016 09:05:15 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0Lp7C8-1a0Nlt0bCO-00eq6N; Thu, 18 Feb 2016 15:04:49 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , linux-kernel@vger.kernel.org Subject: [PATCH 9/9] ARM: fix kprobe test with CONFIG_CPU_32v3 Date: Thu, 18 Feb 2016 15:02:01 +0100 Message-Id: <1455804123-2526139-10-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:7spuFblZJSXC87OgicHMBL+t3fX7E1Ctl04u9ojiYM9kUS+dNoW JR0njk4I2tqbEr9LB0qPY/Z6+UFfjQAVmRY8BaYJNM///XjI0ifIWWZ07fs7VCXDq2j4R3R 4cAEy5XQJmBKGy8w6mZynX0NDtlR+1yg2fpErOCQFEwLvdGU45c5A7O8t5n94+VzC0NaSMh 69lRiY9Nu3mGWu/ORUuWg== X-UI-Out-Filterresults: notjunk:1; V01:K0:tYGU7+3xiVY=:YNUekPsUQhJGONMotfSQBE C79o2z8mMSnfYwNIVLXI0pER1ucB9W4GFI1/4j9umND5fvB6CbJsa6kq0XUSjS3WHE4sRt6uR MebRa1ioMP7GkbRfjWf/qaAXXzNv60JpYaTVLfTySQVX0Y3Bg4B0tUDEueeM10bQddcZt9zpL CQY+65sXGXKYwkiRGUTWIfBL/0aZBlhMOGQ7Qo7gfMDcj415r4GF+uEdMqPtpqVFfUwe8W04d liRiYbsGZmpOPZ705gFTZdwOYr9F2vlHY+Vz4cGGSicv1JZzEcE62FTKf9iFrWO3MU++34Wt7 bwCflrz0LZKvQ+vZCWs6HzrweDAfnR6FRYJ+0YtVbUMEjb77nPXLth779bgSPKom2hJDbY5OS v1AB3o2Gvrz1wox5+ezzvp4ksG6F3kL+Lc9XcJCdCMSQlCq1hotiTsy5NjIJ11fGto4is1b/l dD/xHBuaUjvgmGNyjHh+6HDb99zuUkzcxhHE9ZHHZNNT8jOTH2PDCIpdpdylBTYica71IXr88 gle8/SOwJy2iVq6zSRgO/qNEyce5Qn0+7zBfKiqR5RmyYzEzYG6c0+XjrbPXrjRu3dD/+zbXi 3I13b/pEgyRLEJ/xo4MhHCwrYRiSFX2edvyaVFk45q9l5Cd8yGurbbRMZXh9BFACdW7TITqSO jZErkT3KBDtFJlvil8XBD34gNnFw6hp056540Ye4dJfK7ugNvxltXcKx5pGHB6Rh20xY= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ARMv3 did not have 16-bit load/store or 32-bit multiply instructions, so building the kprobe test code fails with lots of warnings about these: /tmp/ccI4SKHx.s:19585: Error: selected processor does not support ARM mode `umull r0,r1,r2,r3' /tmp/ccI4SKHx.s:19617: Error: selected processor does not support ARM mode `umullls r7,r8,r9,r10' /tmp/ccI4SKHx.s:19645: Error: selected processor does not support ARM mode `umull lr,r12,r11,r13' /tmp/ccI4SKHx.s:19727: Error: selected processor does not support ARM mode `umulls r0,r1,r2,r3' ... /tmp/ccI4SKHx.s:21273: Error: selected processor does not support ARM mode `strh r0,[r1,-r2]' /tmp/ccI4SKHx.s:21309: Error: selected processor does not support ARM mode `streqh r14,[r11,r12]' /tmp/ccI4SKHx.s:21333: Error: selected processor does not support ARM mode `streqh r14,[r13,r12]' This puts all the affected instructions inside an #ifdef section, like we do for the other architecture levels. Signed-off-by: Arnd Bergmann --- arch/arm/probes/kprobes/test-arm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.7.0 diff --git a/arch/arm/probes/kprobes/test-arm.c b/arch/arm/probes/kprobes/test-arm.c index 8866aedfdea2..4e8511f0582d 100644 --- a/arch/arm/probes/kprobes/test-arm.c +++ b/arch/arm/probes/kprobes/test-arm.c @@ -391,6 +391,7 @@ void kprobe_arm_test_cases(void) TEST_UNSUPPORTED(__inst_arm(0xe0700090) " @ undef") TEST_UNSUPPORTED(__inst_arm(0xe07fff9f) " @ undef") +#if __LINUX_ARM_ARCH__ >= 4 TEST_RR( "umull r0, r1, r",2, VAL1,", r",3, VAL2,"") TEST_RR( "umullls r7, r8, r",9, VAL2,", r",10, VAL1,"") TEST_R( "umull lr, r12, r",11,VAL3,", r13") @@ -436,6 +437,7 @@ void kprobe_arm_test_cases(void) TEST_UNSUPPORTED(__inst_arm(0xe0f0f392) " @ smlals r0, pc, r2, r3") TEST_UNSUPPORTED(__inst_arm(0xe0f0139f) " @ smlals r0, r1, pc, r3") TEST_UNSUPPORTED(__inst_arm(0xe0f01f92) " @ smlals r0, r1, r2, pc") +#endif TEST_GROUP("Synchronization primitives") @@ -478,7 +480,7 @@ void kprobe_arm_test_cases(void) TEST_UNSUPPORTED("ldrexh r2, [sp]") #endif TEST_GROUP("Extra load/store instructions") - +#if __LINUX_ARM_ARCH__ >= 4 TEST_RPR( "strh r",0, VAL1,", [r",1, 48,", -r",2, 24,"]") TEST_RPR( "streqh r",14,VAL2,", [r",11,0, ", r",12, 48,"]") TEST_UNSUPPORTED( "streqh r14, [r13, r12]") @@ -560,6 +562,7 @@ void kprobe_arm_test_cases(void) TEST( "ldrsh r0, [pc, #0]") TEST_UNSUPPORTED(__inst_arm(0xe1ffc3f0) " @ ldrsh r12, [pc, #48]!") TEST_UNSUPPORTED(__inst_arm(0xe0d9f3f0) " @ ldrsh pc, [r9], #48") +#endif #if __LINUX_ARM_ARCH__ >= 7 TEST_UNSUPPORTED("strht r1, [r2], r3")