* [PATCH] [stable 4.4] ARM: fix put_user() for gcc-8
[not found] <20180726081358.3829157-1-arnd@arndb.de>
@ 2018-07-26 8:13 ` Arnd Bergmann
2018-07-27 9:45 ` Patch "ARM: fix put_user() for gcc-8" has been added to the 3.18-stable tree gregkh at linuxfoundation.org
2018-07-27 9:45 ` Patch "ARM: fix put_user() for gcc-8" has been added to the 4.4-stable tree gregkh at linuxfoundation.org
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-07-26 8:13 UTC (permalink / raw)
To: linux-arm-kernel
Building kernels before linux-4.7 with gcc-8 results in many build failures
when gcc triggers a check that was meant to catch broken compilers:
/tmp/ccCGMQmS.s:648: Error: .err encountered
According to the discussion in the gcc bugzilla, a local "register
asm()" variable is still supposed to be the correct way to force an
inline assembly to use a particular register, but marking it 'const'
lets the compiler do optimizations that break that, i.e the compiler is
free to treat the variable as either 'const' or 'register' in that case.
Upstream commit 9f73bd8bb445 ("ARM: uaccess: remove put_user() code
duplication") fixed this problem in linux-4.8 as part of a larger change,
but seems a little too big to be backported to 4.4.
Let's take the simplest fix and change only the one broken line in the
same way as newer kernels.
Suggested-by: Bernd Edlinger <bernd.edlinger@hotmail•de>
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85745
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86673
Signed-off-by: Arnd Bergmann <arnd@arndb•de>
---
This should also apply to older kernels before 4.4, but I did not try that.
Presumably they have additional problems with modern compilers anyway.
arch/arm/include/asm/uaccess.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index 35c9db857ebe..cd8b589111ba 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -251,7 +251,7 @@ extern int __put_user_8(void *, unsigned long long);
({ \
unsigned long __limit = current_thread_info()->addr_limit - 1; \
const typeof(*(p)) __user *__tmp_p = (p); \
- register const typeof(*(p)) __r2 asm("r2") = (x); \
+ register typeof(*(p)) __r2 asm("r2") = (x); \
register const typeof(*(p)) __user *__p asm("r0") = __tmp_p; \
register unsigned long __l asm("r1") = __limit; \
register int __e asm("r0"); \
--
2.18.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Patch "ARM: fix put_user() for gcc-8" has been added to the 3.18-stable tree
2018-07-26 8:13 ` [PATCH] [stable 4.4] ARM: fix put_user() for gcc-8 Arnd Bergmann
@ 2018-07-27 9:45 ` gregkh at linuxfoundation.org
2018-07-27 9:45 ` Patch "ARM: fix put_user() for gcc-8" has been added to the 4.4-stable tree gregkh at linuxfoundation.org
1 sibling, 0 replies; 3+ messages in thread
From: gregkh at linuxfoundation.org @ 2018-07-27 9:45 UTC (permalink / raw)
To: linux-arm-kernel
This is a note to let you know that I've just added the patch titled
ARM: fix put_user() for gcc-8
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
arm-fix-put_user-for-gcc-8.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger•kernel.org> know about it.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Patch "ARM: fix put_user() for gcc-8" has been added to the 4.4-stable tree
2018-07-26 8:13 ` [PATCH] [stable 4.4] ARM: fix put_user() for gcc-8 Arnd Bergmann
2018-07-27 9:45 ` Patch "ARM: fix put_user() for gcc-8" has been added to the 3.18-stable tree gregkh at linuxfoundation.org
@ 2018-07-27 9:45 ` gregkh at linuxfoundation.org
1 sibling, 0 replies; 3+ messages in thread
From: gregkh at linuxfoundation.org @ 2018-07-27 9:45 UTC (permalink / raw)
To: linux-arm-kernel
This is a note to let you know that I've just added the patch titled
ARM: fix put_user() for gcc-8
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
arm-fix-put_user-for-gcc-8.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger•kernel.org> know about it.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-27 9:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20180726081358.3829157-1-arnd@arndb.de>
2018-07-26 8:13 ` [PATCH] [stable 4.4] ARM: fix put_user() for gcc-8 Arnd Bergmann
2018-07-27 9:45 ` Patch "ARM: fix put_user() for gcc-8" has been added to the 3.18-stable tree gregkh at linuxfoundation.org
2018-07-27 9:45 ` Patch "ARM: fix put_user() for gcc-8" has been added to the 4.4-stable tree gregkh at linuxfoundation.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox