]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - 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
CommitLineData
45426b3c
GKH
1From 124482935fb7fb9303c8a8ab930149c6a93d9910 Mon Sep 17 00:00:00 2001
2From: Andi Kleen <andi@firstfloor.org>
3Date: Fri, 18 Jun 2010 23:09:00 +0200
4Subject: x86: Fix vsyscall on gcc 4.5 with -Os
5
6From: Andi Kleen <andi@firstfloor.org>
7
8commit 124482935fb7fb9303c8a8ab930149c6a93d9910 upstream.
9
10This fixes the -Os breaks with gcc 4.5 bug. rdtsc_barrier needs to be
11force inlined, otherwise user space will jump into kernel space and
12kill init.
13
14This also addresses http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129
15I believe.
16
17Signed-off-by: Andi Kleen <ak@linux.intel.com>
18LKML-Reference: <20100618210859.GA10913@basil.fritz.box>
19Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
20Signed-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);