Skip to content

Commit f86fd32

Browse files
committed
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
1 parent 5e3c6a3 commit f86fd32

9 files changed

Lines changed: 7 additions & 32 deletions

File tree

‎arch/arm/mm/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,6 @@ config VDSO
900900
select GENERIC_TIME_VSYSCALL
901901
select GENERIC_VDSO_32
902902
select GENERIC_GETTIMEOFDAY
903-
select GENERIC_VDSO_CLOCK_MODE
904903
help
905904
Place in the process address space an ELF shared object
906905
providing fast implementations of gettimeofday and

‎arch/arm64/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ config ARM64
110110
select GENERIC_STRNLEN_USER
111111
select GENERIC_TIME_VSYSCALL
112112
select GENERIC_GETTIMEOFDAY
113-
select GENERIC_VDSO_CLOCK_MODE
114113
select HANDLE_DOMAIN_IRQ
115114
select HARDIRQS_SW_RESEND
116115
select HAVE_PCI

‎arch/mips/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ config MIPS
3737
select GENERIC_SCHED_CLOCK if !CAVIUM_OCTEON_SOC
3838
select GENERIC_SMP_IDLE_THREAD
3939
select GENERIC_TIME_VSYSCALL
40-
select GENERIC_VDSO_CLOCK_MODE
4140
select GUP_GET_PTE_LOW_HIGH if CPU_MIPS32 && PHYS_ADDR_T_64BIT
4241
select HANDLE_DOMAIN_IRQ
4342
select HAVE_ARCH_COMPILER_H

‎arch/x86/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ config X86
125125
select GENERIC_STRNLEN_USER
126126
select GENERIC_TIME_VSYSCALL
127127
select GENERIC_GETTIMEOFDAY
128-
select GENERIC_VDSO_CLOCK_MODE
129128
select GENERIC_VDSO_TIME_NS
130129
select GUP_GET_PTE_LOW_HIGH if X86_PAE
131130
select HARDLOCKUP_CHECK_TIMESTAMP if X86_64

‎include/asm-generic/vdso/vsyscall.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ static __always_inline bool __arch_update_vdso_data(void)
1818
}
1919
#endif /* __arch_update_vdso_data */
2020

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-
2821
#ifndef __arch_update_vsyscall
2922
static __always_inline void __arch_update_vsyscall(struct vdso_data *vdata,
3023
struct timekeeper *tk)

‎include/linux/clocksource.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ struct clocksource;
2424
struct module;
2525

2626
#if defined(CONFIG_ARCH_CLOCKSOURCE_DATA) || \
27-
defined(CONFIG_GENERIC_VDSO_CLOCK_MODE)
27+
defined(CONFIG_GENERIC_GETTIMEOFDAY)
2828
#include <asm/clocksource.h>
2929
#endif
3030

3131
enum vdso_clock_mode {
3232
VDSO_CLOCKMODE_NONE,
33-
#ifdef CONFIG_GENERIC_VDSO_CLOCK_MODE
33+
#ifdef CONFIG_GENERIC_GETTIMEOFDAY
3434
VDSO_ARCH_CLOCKMODES,
3535
#endif
3636
VDSO_CLOCKMODE_MAX,

‎kernel/time/vsyscall.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ void update_vsyscall(struct timekeeper *tk)
7777
/* copy vsyscall data */
7878
vdso_write_begin(vdata);
7979

80-
#ifdef CONFIG_GENERIC_VDSO_CLOCK_MODE
8180
clock_mode = tk->tkr_mono.clock->vdso_clock_mode;
82-
#else
83-
clock_mode = __arch_get_clock_mode(tk);
84-
#endif
8581
vdata[CS_HRES_COARSE].clock_mode = clock_mode;
8682
vdata[CS_RAW].clock_mode = clock_mode;
8783

‎lib/vdso/Kconfig‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,4 @@ config GENERIC_VDSO_TIME_NS
3030
Selected by architectures which support time namespaces in the
3131
VDSO
3232

33-
config GENERIC_VDSO_CLOCK_MODE
34-
bool
35-
3633
endif

‎lib/vdso/gettimeofday.c‎

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,13 @@ static int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
6565

6666
do {
6767
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))
7070
return -1;
71+
7172
cycles = __arch_get_hw_counter(vd->clock_mode);
7273
ns = vdso_ts->nsec;
7374
last = vd->cycle_last;
74-
if (!IS_ENABLED(CONFIG_GENERIC_VDSO_CLOCK_MODE) &&
75-
unlikely((s64)cycles < 0))
76-
return -1;
77-
7875
ns += vdso_calc_delta(cycles, last, vd->mask, vd->mult);
7976
ns >>= vd->shift;
8077
sec = vdso_ts->sec;
@@ -137,16 +134,12 @@ static __always_inline int do_hres(const struct vdso_data *vd, clockid_t clk,
137134
}
138135
smp_rmb();
139136

140-
if (IS_ENABLED(CONFIG_GENERIC_VDSO_CLOCK_MODE) &&
141-
vd->clock_mode == VDSO_CLOCKMODE_NONE)
137+
if (unlikely(vd->clock_mode == VDSO_CLOCKMODE_NONE))
142138
return -1;
139+
143140
cycles = __arch_get_hw_counter(vd->clock_mode);
144141
ns = vdso_ts->nsec;
145142
last = vd->cycle_last;
146-
if (!IS_ENABLED(CONFIG_GENERIC_VDSO_CLOCK_MODE) &&
147-
unlikely((s64)cycles < 0))
148-
return -1;
149-
150143
ns += vdso_calc_delta(cycles, last, vd->mask, vd->mult);
151144
ns >>= vd->shift;
152145
sec = vdso_ts->sec;

0 commit comments

Comments
 (0)