Skip to content

Commit

Permalink
x86: Fix vsyscall on gcc 4.5 with -Os
Browse files Browse the repository at this point in the history
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 <ak@linux.intel.com>
LKML-Reference: <20100618210859.GA10913@basil.fritz.box>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: <stable@kernel.org>
  • Loading branch information
Andi Kleen authored and H. Peter Anvin committed Jun 18, 2010
1 parent 6a4f3b5 commit 1244829
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1244829

Please sign in to comment.