]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.32.17/x86-fix-vsyscall-on-gcc-4.5-with-os.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.17 / x86-fix-vsyscall-on-gcc-4.5-with-os.patch
1 From 124482935fb7fb9303c8a8ab930149c6a93d9910 Mon Sep 17 00:00:00 2001
2 From: Andi Kleen <andi@firstfloor.org>
3 Date: Fri, 18 Jun 2010 23:09:00 +0200
4 Subject: x86: Fix vsyscall on gcc 4.5 with -Os
5
6 From: Andi Kleen <andi@firstfloor.org>
7
8 commit 124482935fb7fb9303c8a8ab930149c6a93d9910 upstream.
9
10 This fixes the -Os breaks with gcc 4.5 bug. rdtsc_barrier needs to be
11 force inlined, otherwise user space will jump into kernel space and
12 kill init.
13
14 This also addresses http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
15 I believe.
16
17 Signed-off-by: Andi Kleen <ak@linux.intel.com>
18 LKML-Reference: <20100618210859.GA10913@basil.fritz.box>
19 Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21
22 ---
23 arch/x86/include/asm/system.h | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26 --- a/arch/x86/include/asm/system.h
27 +++ b/arch/x86/include/asm/system.h
28 @@ -449,7 +449,7 @@ void stop_this_cpu(void *dummy);
29 *
30 * (Could use an alternative three way for this if there was one.)
31 */
32 -static inline void rdtsc_barrier(void)
33 +static __always_inline void rdtsc_barrier(void)
34 {
35 alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC);
36 alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);