From: Andi Kleen Date: Fri, 18 Jun 2010 21:09:00 +0000 (+0200) Subject: x86: Fix vsyscall on gcc 4.5 with -Os X-Git-Tag: MMI-PSA29.97-13-9~23276^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=124482935fb7fb9303c8a8ab930149c6a93d9910;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git x86: Fix vsyscall on gcc 4.5 with -Os This fixes the -Os breaks with gcc 4.5 bug. rdtsc_barrier needs to be force inlined, otherwise user space will jump into kernel space and kill init. This also addresses http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44129 I believe. Signed-off-by: Andi Kleen LKML-Reference: <20100618210859.GA10913@basil.fritz.box> Signed-off-by: H. Peter Anvin Cc: --- diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h index b8fe48ee2ed9..e7f4d33c55ed 100644 --- a/arch/x86/include/asm/system.h +++ b/arch/x86/include/asm/system.h @@ -451,7 +451,7 @@ void stop_this_cpu(void *dummy); * * (Could use an alternative three way for this if there was one.) */ -static inline void rdtsc_barrier(void) +static __always_inline void rdtsc_barrier(void) { alternative(ASM_NOP3, "mfence", X86_FEATURE_MFENCE_RDTSC); alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC);