Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib/vdso: Cleanup clock mode storage leftovers

Now that all architectures are converted to use the generic storage the
helpers and conditionals can be removed.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lkml.kernel.org/r/20200207124403.470699892@linutronix.de



+7 -32
-1
arch/arm/mm/Kconfig
··· 900 900 select GENERIC_TIME_VSYSCALL 901 901 select GENERIC_VDSO_32 902 902 select GENERIC_GETTIMEOFDAY 903 - select GENERIC_VDSO_CLOCK_MODE 904 903 help 905 904 Place in the process address space an ELF shared object 906 905 providing fast implementations of gettimeofday and
-1
arch/arm64/Kconfig
··· 110 110 select GENERIC_STRNLEN_USER 111 111 select GENERIC_TIME_VSYSCALL 112 112 select GENERIC_GETTIMEOFDAY 113 - select GENERIC_VDSO_CLOCK_MODE 114 113 select HANDLE_DOMAIN_IRQ 115 114 select HARDIRQS_SW_RESEND 116 115 select HAVE_PCI
-1
arch/mips/Kconfig
··· 37 37 select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC 38 38 select GENERIC_SMP_IDLE_THREAD 39 39 select GENERIC_TIME_VSYSCALL 40 - select GENERIC_VDSO_CLOCK_MODE 41 40 select GUP_GET_PTE_LOW_HIGH if CPU_MIPS32 && PHYS_ADDR_T_64BIT 42 41 select HANDLE_DOMAIN_IRQ 43 42 select HAVE_ARCH_COMPILER_H
-1
arch/x86/Kconfig
··· 125 125 select GENERIC_STRNLEN_USER 126 126 select GENERIC_TIME_VSYSCALL 127 127 select GENERIC_GETTIMEOFDAY 128 - select GENERIC_VDSO_CLOCK_MODE 129 128 select GENERIC_VDSO_TIME_NS 130 129 select GUP_GET_PTE_LOW_HIGH if X86_PAE 131 130 select HARDLOCKUP_CHECK_TIMESTAMP if X86_64
-7
include/asm-generic/vdso/vsyscall.h
··· 18 18 } 19 19 #endif /* __arch_update_vdso_data */ 20 20 21 - #ifndef __arch_get_clock_mode 22 - static __always_inline int __arch_get_clock_mode(struct timekeeper *tk) 23 - { 24 - return 0; 25 - } 26 - #endif /* __arch_get_clock_mode */ 27 - 28 21 #ifndef __arch_update_vsyscall 29 22 static __always_inline void __arch_update_vsyscall(struct vdso_data *vdata, 30 23 struct timekeeper *tk)
+2 -2
include/linux/clocksource.h
··· 24 24 struct module; 25 25 26 26 #if defined(CONFIG_ARCH_CLOCKSOURCE_DATA) || \ 27 - defined(CONFIG_GENERIC_VDSO_CLOCK_MODE) 27 + defined(CONFIG_GENERIC_GETTIMEOFDAY) 28 28 #include <asm/clocksource.h> 29 29 #endif 30 30 31 31 enum vdso_clock_mode { 32 32 VDSO_CLOCKMODE_NONE, 33 - #ifdef CONFIG_GENERIC_VDSO_CLOCK_MODE 33 + #ifdef CONFIG_GENERIC_GETTIMEOFDAY 34 34 VDSO_ARCH_CLOCKMODES, 35 35 #endif 36 36 VDSO_CLOCKMODE_MAX,
-4
kernel/time/vsyscall.c
··· 77 77 /* copy vsyscall data */ 78 78 vdso_write_begin(vdata); 79 79 80 - #ifdef CONFIG_GENERIC_VDSO_CLOCK_MODE 81 80 clock_mode = tk->tkr_mono.clock->vdso_clock_mode; 82 - #else 83 - clock_mode = __arch_get_clock_mode(tk); 84 - #endif 85 81 vdata[CS_HRES_COARSE].clock_mode = clock_mode; 86 82 vdata[CS_RAW].clock_mode = clock_mode; 87 83
-3
lib/vdso/Kconfig
··· 30 30 Selected by architectures which support time namespaces in the 31 31 VDSO 32 32 33 - config GENERIC_VDSO_CLOCK_MODE 34 - bool 35 - 36 33 endif
+5 -12
lib/vdso/gettimeofday.c
··· 65 65 66 66 do { 67 67 seq = vdso_read_begin(vd); 68 - if (IS_ENABLED(CONFIG_GENERIC_VDSO_CLOCK_MODE) && 69 - vd->clock_mode == VDSO_CLOCKMODE_NONE) 68 + 69 + if (unlikely(vd->clock_mode == VDSO_CLOCKMODE_NONE)) 70 70 return -1; 71 + 71 72 cycles = __arch_get_hw_counter(vd->clock_mode); 72 73 ns = vdso_ts->nsec; 73 74 last = vd->cycle_last; 74 - if (!IS_ENABLED(CONFIG_GENERIC_VDSO_CLOCK_MODE) && 75 - unlikely((s64)cycles < 0)) 76 - return -1; 77 - 78 75 ns += vdso_calc_delta(cycles, last, vd->mask, vd->mult); 79 76 ns >>= vd->shift; 80 77 sec = vdso_ts->sec; ··· 134 137 } 135 138 smp_rmb(); 136 139 137 - if (IS_ENABLED(CONFIG_GENERIC_VDSO_CLOCK_MODE) && 138 - vd->clock_mode == VDSO_CLOCKMODE_NONE) 140 + if (unlikely(vd->clock_mode == VDSO_CLOCKMODE_NONE)) 139 141 return -1; 142 + 140 143 cycles = __arch_get_hw_counter(vd->clock_mode); 141 144 ns = vdso_ts->nsec; 142 145 last = vd->cycle_last; 143 - if (!IS_ENABLED(CONFIG_GENERIC_VDSO_CLOCK_MODE) && 144 - unlikely((s64)cycles < 0)) 145 - return -1; 146 - 147 146 ns += vdso_calc_delta(cycles, last, vd->mask, vd->mult); 148 147 ns >>= vd->shift; 149 148 sec = vdso_ts->sec;