diff --git a/arch/x86/entry/vdso/vclock_gettime.c b/arch/x86/entry/vdso/vclock_gettime.c index 91ed1bb2a3bb..4f22e9cb97a5 100644 --- a/arch/x86/entry/vdso/vclock_gettime.c +++ b/arch/x86/entry/vdso/vclock_gettime.c @@ -319,6 +319,14 @@ notrace int __vdso_clock_gettime(clockid_t clock, struct timespec *ts) int clock_gettime(clockid_t, struct timespec *) __attribute__((weak, alias("__vdso_clock_gettime"))); +notrace int __vdso_clock_gettime_monotonic(struct timespec *ts) +{ + if (likely(do_monotonic(ts) != VCLOCK_NONE)) + return 0; + + return vdso_fallback_gettime(CLOCK_MONOTONIC, ts); +} + notrace int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz) { if (likely(tv != NULL)) { diff --git a/arch/x86/entry/vdso/vdso.lds.S b/arch/x86/entry/vdso/vdso.lds.S index d3a2dce4cfa9..28e23cbc02c9 100644 --- a/arch/x86/entry/vdso/vdso.lds.S +++ b/arch/x86/entry/vdso/vdso.lds.S @@ -15,6 +15,11 @@ * This controls what userland symbols we export from the vDSO. */ VERSION { + LINUX_4.19 { + global: + __vdso_clock_gettime_monotonic; + }; + LINUX_2.6 { global: clock_gettime;