On Thu, Jan 16, 2020 at 2:35 AM Thomas Gleixner <t...@linutronix.de> wrote: > > static __maybe_unused int > __cvdso_data_clock_gettime(clockid_t clock, struct __kernel_timespec *ts, > const struct vdso_data *vd) > { > ..... > } > > static __maybe_unused int > __cvdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts) > { > const struct vdso_data *vd = __arch_get_vdso_data(); > > return __cvdso_data_clock_gettime(clock, ts, vd); > } > > and then use __cvdso_data_clock_gettime on PPC and let the other archs > unmodified. > >
FWIW, I did some experiments on x86 with gcc 9.2. gcc 9.2 uses rip-relative accesses if I simplify the config enough and otherwise materializes the pointer. Presumably it decides that the code size reduction is worth it if there are a lot of accesses. I suspect that tglx's suggestion will be fine or at worst will add negligible overhead on x86_64.