From patchwork Tue Nov 22 11:05:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101480 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp2033891qge; Tue, 22 Nov 2016 03:06:49 -0800 (PST) X-Received: by 10.99.104.68 with SMTP id d65mr42427046pgc.52.1479812809358; Tue, 22 Nov 2016 03:06:49 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10si24748935pge.149.2016.11.22.03.06.48; Tue, 22 Nov 2016 03:06:49 -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 S932928AbcKVLGp (ORCPT + 26 others); Tue, 22 Nov 2016 06:06:45 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:55592 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752526AbcKVLGm (ORCPT ); Tue, 22 Nov 2016 06:06:42 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0LuLSB-1cr1yV34vX-011nHV; Tue, 22 Nov 2016 12:06:12 +0100 From: Arnd Bergmann To: Russell King Cc: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Nicolas Pitre , linux-arm-kernel@lists.infradead.org, Nicholas Piggin , viro@zeniv.linux.org.uk, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, regressions@leemhuis.info, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] kbuild: provide include/asm/asm-prototypes.h for ARM Date: Tue, 22 Nov 2016 12:05:40 +0100 Message-Id: <20161122110557.1533467-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:q1/Dzon1YKnj8d7BrSRHdju/yLI9XO2pd9okzJx4A29B8XLJYOg SN1/aWjUOpC2S0/aZx4zqtdsqPOwnJCQkWiUOZMYx8+tJTuyX37Gnr1lvQxeozehyefuOaG 4yU9GrOCULjs10v+VvlNx2qH9G4H/OdIJz6niDTVfQdXSqx0GG5N1lpMKpO1Zi06bOrGO3h OXsHeXPaEu1dBIwGrYH7w== X-UI-Out-Filterresults: notjunk:1; V01:K0:XLQaJ+Z+P4Q=:YyXoX0LmPeCayjNGIZ0Vq0 KtGm3+8CnpW7sNWPBygy9wQyWfSthbt+Bns/YXaje+HmYB4TwEpa/SmldItrdS+pjfOPNLVje tvLtxrtWm23cDrwTMxeALFAR+vtGfYl/xX4yqe9DmYbW+N/7ysxP6KLnc3i2rpSms29PwksvO gMfeIOCnO6f1P8/PC495sk7c4OLWXvSEhHDNN78XpgdzQYwqo9qDY0Q0cqJNJfQ/EsNDqT//i malMfPT0XlkKeQL5o1OTcAnVuVKi2ElB9W94FAy37a44xs+MCmRjMqOoNcahoYTVmq4Rqc6Fb fxrAos4UGeLtigH3meNPtlvpgyJGuI8+k2JwRzzphwvP2jGO4iyZGzaqvdvYT787nQbpH0NhP V366gYiDVsAEU34YEvpgHbs/Bc84Dz9udJKa+XFPZB85VayrhqsFrxU+WJ1ivsw2nFW+k432o LWpkBj2p95PkBLJwkFIhW3ujqwY2/4hkW0Iuw8WGn52WHlw3uXEpjWtXDl+sRaHEjnyxg3s9q Vjn2tBxvXHGQg7v9I1UGohOJjVp4pYWJr0EWs2TUiNYze6K9sNbYNP7lg5YFRO7M1CsAo64Ub Cta1h9MJMGstnPLp7OUqQjh4Ck1coDgkVc/0PQ80gsPPAvnlR5Dz7t0xoQA7a/LkJ401urNKU eYHlaNszAxU9Dnt+kX/JygcRduXh3srqpOaW8CMtyftiTbKJ5zsOviHnCv8uRiuVASwfZkfZO SbYqRwGKCxZtrsl/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds an asm/asm-prototypes.h header for ARM to fix the broken symbol versioning for symbols exported from assembler files. I couldn't find the correct prototypes for the compiler builtins, so I went with the fake 'void f(void)' prototypes that we had before, restoring the state before they were moved. Originally I assumed that the problem was just a harmless warning in unusual configurations, but as Uwe found, we actually need this to load most modules when symbol versioning is enabled, as it is in many distro kernels. Cc: Uwe Kleine-König Fixes: 4dd1837d7589 ("arm: move exports to definitions") Signed-off-by: Arnd Bergmann --- Compared to the earlier version, I dropped the changes to the csumpartial files, which now get handled correctly by Kbuild even when the export comes from a macro, and I also dropped the changes to the bitops files, which were already fixed in a patch from Nico. The patch applies cleanly on top of the rmk/fixes tree but has no effect there, as it also needs 4efca4ed05cb ("kbuild: modversions for EXPORT_SYMBOL() for asm") and cc6acc11cad1 ("kbuild: be more careful about matching preprocessed asm ___EXPORT_SYMBOL"). With the combination of rmk/fixes, torvalds/master and these two patches, symbol versioning works again on ARM. As it is still broken on almost all other architectures (powerpc is fixed, x86 has a patch), I wonder if we should make CONFIG_MODVERSIONS as broken for everything else. --- arch/arm/include/asm/asm-prototypes.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 arch/arm/include/asm/asm-prototypes.h -- 2.9.0 diff --git a/arch/arm/include/asm/asm-prototypes.h b/arch/arm/include/asm/asm-prototypes.h new file mode 100644 index 000000000000..04e5616a7b15 --- /dev/null +++ b/arch/arm/include/asm/asm-prototypes.h @@ -0,0 +1,34 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +extern void __aeabi_idivmod(void); +extern void __aeabi_idiv(void); +extern void __aeabi_lasr(void); +extern void __aeabi_llsl(void); +extern void __aeabi_llsr(void); +extern void __aeabi_lmul(void); +extern void __aeabi_uidivmod(void); +extern void __aeabi_uidiv(void); +extern void __aeabi_ulcmp(void); + +extern void __ashldi3(void); +extern void __ashrdi3(void); +extern void __bswapdi2(void); +extern void __bswapsi2(void); +extern void __divsi3(void); +extern void __do_div64(void); +extern void __lshrdi3(void); +extern void __modsi3(void); +extern void __muldi3(void); +extern void __ucmpdi2(void); +extern void __udivsi3(void); +extern void __umodsi3(void); From patchwork Tue Nov 22 11:05:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101479 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp2034166qge; Tue, 22 Nov 2016 03:07:25 -0800 (PST) X-Received: by 10.98.211.67 with SMTP id q64mr24632922pfg.173.1479812845353; Tue, 22 Nov 2016 03:07:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i68si27939760pgc.178.2016.11.22.03.07.23; Tue, 22 Nov 2016 03:07: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 S933038AbcKVLHO (ORCPT + 26 others); Tue, 22 Nov 2016 06:07:14 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:65346 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932771AbcKVLHM (ORCPT ); Tue, 22 Nov 2016 06:07:12 -0500 Received: from wuerfel.lan ([78.43.21.235]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lh5vD-1cUyqm33mZ-00oVcv; Tue, 22 Nov 2016 12:06:39 +0100 From: Arnd Bergmann To: Russell King Cc: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Nicolas Pitre , linux-arm-kernel@lists.infradead.org, Nicholas Piggin , viro@zeniv.linux.org.uk, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, regressions@leemhuis.info, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ARM: move mmiocpy/mmioset exports to io.c Date: Tue, 22 Nov 2016 12:05:41 +0100 Message-Id: <20161122110557.1533467-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161122110557.1533467-1-arnd@arndb.de> References: <20161122110557.1533467-1-arnd@arndb.de> X-Provags-ID: V03:K0:d2qxpjAvshUVoq8HnOsFr6jVVJZx3QivkrqMXxH/f4wKaZ7yCPx A+LP1ppuMRRHbUMUx+apW7cP+g6/7RnZKC6r8a8u2adVEFFp+veDO1Lra4+/ABqYr2mIIK6 W8UZLGQ3QASg8zi3pO9Kg6OU+UJbqpMlPLqwN57IobtWMfUg3Ne42cSVz62O2u4xijPlBee /GjCY9bxQs7uDfw6TnYew== X-UI-Out-Filterresults: notjunk:1; V01:K0:kQZGJIokceo=:CzoBxpcuTlj8WpnBAmzJAX jOY5Zj5sadndZ1CtQ3tuaHXbyPRlpsF7BQeozdM/oT5eIB86ZU2bws2fHIRInux28Z7VT259C H93xvdis7GIGl6LmW+6jQF6cfvt15+tkgj7xxBUJSlIGq4g4vFNgyOePqA/k0QSEHEGEg1RC6 8QZQza4hc7QWk6RecahDTPRR6RcRY+MzHZfQaNI14h4Rs41LHaPJtxZSaTZ8PvTvNfk9F6MQN avNjR7hz5n9exedRmSlf9LH5S0mX2QR90RDAKjYfEsGd8jxLqvBdKxTyXN6tndkVbcbV6+yfX +EjUYEY7OkYdLC2yNkyTHNm1SxVpc9YRjNNpK575lmYamEiU/TuTdwBGDBhtv6GpNsg//GcUp iBsn9R7r//3M9WlckmS8K7fFrXQgkK3thRU3podPsR9IUUYAWvdfPJyBnHIdl8kn/+/jaHXkq TgeEP6ZIBK/gDO5KtF0eCBtq66vPKBSDQK1B49OC+4LrAQ+OVOUt50rf+LPRvkVjx88W+RVYc Rl/YFhJEQgyIc/PKlgKMcOJn/7ewiytCCE40ZqD0yzTDZtseqUFhQ+8bSPKcpN/Ven0RtSRPG 0remOZX5eX+oKtLP86v2UQNx2rJT4td+vYqj4oAKOnCGHa0UK4pKRr+NSZYB/OkOa3RRzlnwP s7lybLopGUdLZKo8sjtmXHd04KOmT35Xp3uwYpusBhwkTZ3p82TSyzP3PW4bRo0vTXWg= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The prototypes for mmioset/mmiocpy are intentionally hidden inside of inline functions, which breaks the EXPORT_SYMBOL statements when symbol versioning is enabled. This moves the two exports from the files that implement the code into the kernel/io.c file, adding another local declaration there. Signed-off-by: Arnd Bergmann --- arch/arm/kernel/io.c | 7 +++++++ arch/arm/lib/memcpy.S | 1 - arch/arm/lib/memset.S | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/arm/kernel/io.c b/arch/arm/kernel/io.c index eedefe050022..c74746997626 100644 --- a/arch/arm/kernel/io.c +++ b/arch/arm/kernel/io.c @@ -82,3 +82,10 @@ void _memset_io(volatile void __iomem *dst, int c, size_t count) } } EXPORT_SYMBOL(_memset_io); + +/* can't export them from memcpy.S/memset.S because of hidden declaration */ +void mmioset(void __iomem *addr, unsigned int c, size_t n); +EXPORT_SYMBOL(mmioset); + +void mmiocpy(void *dest, const void __iomem *src, size_t n); +EXPORT_SYMBOL(mmiocpy); diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S index 1be5b6ddf37c..1f822fc52400 100644 --- a/arch/arm/lib/memcpy.S +++ b/arch/arm/lib/memcpy.S @@ -70,4 +70,3 @@ ENTRY(memcpy) ENDPROC(memcpy) ENDPROC(mmiocpy) EXPORT_SYMBOL(memcpy) -EXPORT_SYMBOL(mmiocpy) diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S index 7b72044cba62..6f075ca09abc 100644 --- a/arch/arm/lib/memset.S +++ b/arch/arm/lib/memset.S @@ -137,4 +137,3 @@ UNWIND( .fnend ) ENDPROC(memset) ENDPROC(mmioset) EXPORT_SYMBOL(memset) -EXPORT_SYMBOL(mmioset)