x86: Don't instrument vdso functions
PATCH 1/1 x86: Don't instrument vdso functions
The mcount instrumentation is currently leaking into vdso functions. Patch below fixes this (bits taken from 2.6.27).
Jan
--- arch/x86/vdso/vclock_gettime.c | 15 ++++++++------- arch/x86/vdso/vgetcpu.c | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-)
arch/x86/vdso/vclock_gettime.c +8 -7
@@ -23,7 +23,7 @@#define gtod vdso_vsyscall_gtod_data -static long vdso_fallback_gettime (long clock,struct timespec *ts) +notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) {long ret; asm("syscall" : "=a" (ret) :
@@ -31,7 +31,7 @@ static long vdso_fallback_gettime(long creturn ret; } -static inline long vgetns (void ) +notrace static inline long vgetns(void) {long v;cycles_t (*vread)(void);
@@ -40,7 +40,7 @@ static inline long vgetns(void)return (v * gtod->clock.mult) >> gtod->clock.shift; } -static noinline int do_realtime(struct timespec *ts) +notrace static noinline int do_realtime(struct timespec *ts) {unsigned long seq, ns; do {
@@ -54,7 +54,8 @@ static noinline int do_realtime(struct t }/* Copy of the version in kernel/time.c which we cannot directly access */ -static void vset_normalized_timespec (struct timespec *ts,long sec,long nsec) +notrace static void +vset_normalized_timespec (struct timespec *ts,long sec,long nsec) {while (nsec >=NSEC_PER_SEC ) { nsec -=NSEC_PER_SEC ;
@@ -68,7 +69,7 @@ static void vset_normalized_timespec(str ts->tv_nsec = nsec; } -static noinline int do_monotonic(struct timespec *ts) +notrace static noinline int do_monotonic(struct timespec *ts) {unsigned long seq, ns, secs; do {
@@ -82,7 +83,7 @@ static noinline int do_monotonic(structreturn 0 ; } -int __vdso_clock_gettime (clockid_t clock,struct timespec *ts) +notrace int __vdso_clock_gettime(clockid_t clock, struct timespec *ts) {if (likely (gtod->sysctl_enabled && gtod->clock.vread))switch (clock) {
@@ -96,7 +97,7 @@ int __vdso_clock_gettime(clockid_t clockint clock_gettime (clockid_t ,struct timespec *) __attribute__((weak,alias ("__vdso_clock_gettime" ))); -int __vdso_gettimeofday (struct timeval *tv,struct timezone *tz) +notrace int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz) {long ret;if (likely (gtod->sysctl_enabled && gtod->clock.vread)) {
arch/x86/vdso/vgetcpu.c +2 -1
@@ -13,7 +13,8 @@#include <asm/vgtod.h> #include "vextern.h" -long __vdso_getcpu (unsigned *cpu,unsigned *node,struct getcpu_cache *unused) +notrace long +__vdso_getcpu (unsigned *cpu,unsigned *node,struct getcpu_cache *unused) {unsigned int p;
Quoted 2 lines · Jan Kiszka
The mcount instrumentation is currently leaking into vdso functions. Patch below fixes this (bits taken from 2.6.27).
What are these vdso functions? Functions called from user-space?
Signature · 1 line
Gilles.
Quoted 5 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka
The mcount instrumentation is currently leaking into vdso functions. Patch below fixes this (bits taken from 2.6.27).
What are these vdso functions? Functions called from user-space?
They belong to a virtual lib that is automatically mapped into every process. They provide the same functionality like vsyscalls, but with a different way to address them (VDSO is more flexible, vsyscalls are legacy).
Jan
Quoted 6 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka
The mcount instrumentation is currently leaking into vdso functions. Patch below fixes this (bits taken from 2.6.27).
What are these vdso functions? Functions called from user-space?
Yes. Bits of kernel code mapped into user-space to eliminate the need for reaching them via syscalls.
Signature · 1 line
Philippe.
Quoted 9 lines · Philippe Gerum
Quoted 5 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka
The mcount instrumentation is currently leaking into vdso functions. Patch below fixes this (bits taken from 2.6.27).
What are these vdso functions? Functions called from user-space?
Yes. Bits of kernel code mapped into user-space to eliminate the need for reaching them via syscalls.
They have copied it from ARM or Blackfin!
Signature · 1 line
Gilles.