Skip to content

Commit

Permalink
x86: vget_cycles() __always_inline
Browse files Browse the repository at this point in the history
Mark vget_cycles() as __always_inline, so gcc is never tempted to make
the vsyscall vread_tsc() dive into kernel text, with resulting SIGSEGV.

This was a self-inflicted wound: I've not seen that happen with unhacked
sources; but for debug reasons I'd changed my x86/Makefile to compile
no-unit-at-a-time, and that in conjunction with OPTIMIZE_INLINING=y
ended up with vget_cycles() in kernel text.  Perhaps it can happen
in other ways: safer to use __always_inline.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Hugh Dickins authored and Ingo Molnar committed Apr 29, 2008
1 parent 4c0587e commit 9752082
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/asm-x86/tsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static inline cycles_t get_cycles(void)
return ret;
}

static inline cycles_t vget_cycles(void)
static __always_inline cycles_t vget_cycles(void)
{
/*
* We only do VDSOs on TSC capable CPUs, so this shouldnt
Expand Down

0 comments on commit 9752082

Please sign in to comment.