mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf.git
synced 2026-04-18 06:34:27 -04:00
vdso: Remove remnants of architecture-specific time storage
All users of the time releated parts of the vDSO are now using the generic storage implementation. Remove the therefore unnecessary compatibility accessor functions and symbols. Co-developed-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250204-vdso-store-rng-v3-18-13a4669dfc8c@linutronix.de
This commit is contained in:
committed by
Thomas Gleixner
parent
998a8a2608
commit
ac1a42f4e4
@@ -12,7 +12,10 @@
|
||||
* The vDSO data page.
|
||||
*/
|
||||
#ifdef CONFIG_HAVE_GENERIC_VDSO
|
||||
static union vdso_data_store vdso_time_data_store __page_aligned_data;
|
||||
static union {
|
||||
struct vdso_time_data data[CS_BASES];
|
||||
u8 page[PAGE_SIZE];
|
||||
} vdso_time_data_store __page_aligned_data;
|
||||
struct vdso_time_data *vdso_k_time_data = vdso_time_data_store.data;
|
||||
static_assert(sizeof(vdso_time_data_store) == PAGE_SIZE);
|
||||
#endif /* CONFIG_HAVE_GENERIC_VDSO */
|
||||
@@ -123,9 +126,4 @@ int vdso_join_timens(struct task_struct *task, struct time_namespace *ns)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct vdso_time_data *arch_get_vdso_data(void *vvar_page)
|
||||
{
|
||||
return (struct vdso_time_data *)vvar_page;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT
|
||||
static __always_inline bool vdso_delta_ok(const struct vdso_data *vd, u64 delta)
|
||||
static __always_inline bool vdso_delta_ok(const struct vdso_time_data *vd, u64 delta)
|
||||
{
|
||||
return delta < vd->max_cycles;
|
||||
}
|
||||
#else
|
||||
static __always_inline bool vdso_delta_ok(const struct vdso_data *vd, u64 delta)
|
||||
static __always_inline bool vdso_delta_ok(const struct vdso_time_data *vd, u64 delta)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -39,7 +39,7 @@ static __always_inline u64 vdso_shift_ns(u64 ns, u32 shift)
|
||||
* Default implementation which works for all sane clocksources. That
|
||||
* obviously excludes x86/TSC.
|
||||
*/
|
||||
static __always_inline u64 vdso_calc_ns(const struct vdso_data *vd, u64 cycles, u64 base)
|
||||
static __always_inline u64 vdso_calc_ns(const struct vdso_time_data *vd, u64 cycles, u64 base)
|
||||
{
|
||||
u64 delta = (cycles - vd->cycle_last) & VDSO_DELTA_MASK(vd);
|
||||
|
||||
@@ -58,7 +58,7 @@ static inline bool __arch_vdso_hres_capable(void)
|
||||
#endif
|
||||
|
||||
#ifndef vdso_clocksource_ok
|
||||
static inline bool vdso_clocksource_ok(const struct vdso_data *vd)
|
||||
static inline bool vdso_clocksource_ok(const struct vdso_time_data *vd)
|
||||
{
|
||||
return vd->clock_mode != VDSO_CLOCKMODE_NONE;
|
||||
}
|
||||
@@ -79,21 +79,20 @@ const struct vdso_time_data *__arch_get_vdso_u_timens_data(const struct vdso_tim
|
||||
{
|
||||
return (void *)vd + PAGE_SIZE;
|
||||
}
|
||||
#define __arch_get_timens_vdso_data(vd) __arch_get_vdso_u_timens_data(vd)
|
||||
#endif /* CONFIG_GENERIC_VDSO_DATA_STORE */
|
||||
|
||||
static __always_inline int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
|
||||
static __always_inline int do_hres_timens(const struct vdso_time_data *vdns, clockid_t clk,
|
||||
struct __kernel_timespec *ts)
|
||||
{
|
||||
const struct timens_offset *offs = &vdns->offset[clk];
|
||||
const struct vdso_timestamp *vdso_ts;
|
||||
const struct vdso_data *vd;
|
||||
const struct vdso_time_data *vd;
|
||||
u64 cycles, ns;
|
||||
u32 seq;
|
||||
s64 sec;
|
||||
|
||||
vd = vdns - (clk == CLOCK_MONOTONIC_RAW ? CS_RAW : CS_HRES_COARSE);
|
||||
vd = __arch_get_timens_vdso_data(vd);
|
||||
vd = __arch_get_vdso_u_timens_data(vd);
|
||||
if (clk != CLOCK_MONOTONIC_RAW)
|
||||
vd = &vd[CS_HRES_COARSE];
|
||||
else
|
||||
@@ -128,19 +127,19 @@ static __always_inline int do_hres_timens(const struct vdso_data *vdns, clockid_
|
||||
}
|
||||
#else
|
||||
static __always_inline
|
||||
const struct vdso_data *__arch_get_timens_vdso_data(const struct vdso_data *vd)
|
||||
const struct vdso_time_data *__arch_get_vdso_u_timens_data(const struct vdso_time_data *vd)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static __always_inline int do_hres_timens(const struct vdso_data *vdns, clockid_t clk,
|
||||
static __always_inline int do_hres_timens(const struct vdso_time_data *vdns, clockid_t clk,
|
||||
struct __kernel_timespec *ts)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static __always_inline int do_hres(const struct vdso_data *vd, clockid_t clk,
|
||||
static __always_inline int do_hres(const struct vdso_time_data *vd, clockid_t clk,
|
||||
struct __kernel_timespec *ts)
|
||||
{
|
||||
const struct vdso_timestamp *vdso_ts = &vd->basetime[clk];
|
||||
@@ -192,10 +191,10 @@ static __always_inline int do_hres(const struct vdso_data *vd, clockid_t clk,
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TIME_NS
|
||||
static __always_inline int do_coarse_timens(const struct vdso_data *vdns, clockid_t clk,
|
||||
static __always_inline int do_coarse_timens(const struct vdso_time_data *vdns, clockid_t clk,
|
||||
struct __kernel_timespec *ts)
|
||||
{
|
||||
const struct vdso_data *vd = __arch_get_timens_vdso_data(vdns);
|
||||
const struct vdso_time_data *vd = __arch_get_vdso_u_timens_data(vdns);
|
||||
const struct vdso_timestamp *vdso_ts = &vd->basetime[clk];
|
||||
const struct timens_offset *offs = &vdns->offset[clk];
|
||||
u64 nsec;
|
||||
@@ -221,14 +220,14 @@ static __always_inline int do_coarse_timens(const struct vdso_data *vdns, clocki
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static __always_inline int do_coarse_timens(const struct vdso_data *vdns, clockid_t clk,
|
||||
static __always_inline int do_coarse_timens(const struct vdso_time_data *vdns, clockid_t clk,
|
||||
struct __kernel_timespec *ts)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static __always_inline int do_coarse(const struct vdso_data *vd, clockid_t clk,
|
||||
static __always_inline int do_coarse(const struct vdso_time_data *vd, clockid_t clk,
|
||||
struct __kernel_timespec *ts)
|
||||
{
|
||||
const struct vdso_timestamp *vdso_ts = &vd->basetime[clk];
|
||||
@@ -255,7 +254,7 @@ static __always_inline int do_coarse(const struct vdso_data *vd, clockid_t clk,
|
||||
}
|
||||
|
||||
static __always_inline int
|
||||
__cvdso_clock_gettime_common(const struct vdso_data *vd, clockid_t clock,
|
||||
__cvdso_clock_gettime_common(const struct vdso_time_data *vd, clockid_t clock,
|
||||
struct __kernel_timespec *ts)
|
||||
{
|
||||
u32 msk;
|
||||
@@ -282,7 +281,7 @@ __cvdso_clock_gettime_common(const struct vdso_data *vd, clockid_t clock,
|
||||
}
|
||||
|
||||
static __maybe_unused int
|
||||
__cvdso_clock_gettime_data(const struct vdso_data *vd, clockid_t clock,
|
||||
__cvdso_clock_gettime_data(const struct vdso_time_data *vd, clockid_t clock,
|
||||
struct __kernel_timespec *ts)
|
||||
{
|
||||
int ret = __cvdso_clock_gettime_common(vd, clock, ts);
|
||||
@@ -300,7 +299,7 @@ __cvdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
|
||||
|
||||
#ifdef BUILD_VDSO32
|
||||
static __maybe_unused int
|
||||
__cvdso_clock_gettime32_data(const struct vdso_data *vd, clockid_t clock,
|
||||
__cvdso_clock_gettime32_data(const struct vdso_time_data *vd, clockid_t clock,
|
||||
struct old_timespec32 *res)
|
||||
{
|
||||
struct __kernel_timespec ts;
|
||||
@@ -326,7 +325,7 @@ __cvdso_clock_gettime32(clockid_t clock, struct old_timespec32 *res)
|
||||
#endif /* BUILD_VDSO32 */
|
||||
|
||||
static __maybe_unused int
|
||||
__cvdso_gettimeofday_data(const struct vdso_data *vd,
|
||||
__cvdso_gettimeofday_data(const struct vdso_time_data *vd,
|
||||
struct __kernel_old_timeval *tv, struct timezone *tz)
|
||||
{
|
||||
|
||||
@@ -343,7 +342,7 @@ __cvdso_gettimeofday_data(const struct vdso_data *vd,
|
||||
if (unlikely(tz != NULL)) {
|
||||
if (IS_ENABLED(CONFIG_TIME_NS) &&
|
||||
vd->clock_mode == VDSO_CLOCKMODE_TIMENS)
|
||||
vd = __arch_get_timens_vdso_data(vd);
|
||||
vd = __arch_get_vdso_u_timens_data(vd);
|
||||
|
||||
tz->tz_minuteswest = vd[CS_HRES_COARSE].tz_minuteswest;
|
||||
tz->tz_dsttime = vd[CS_HRES_COARSE].tz_dsttime;
|
||||
@@ -360,13 +359,13 @@ __cvdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
|
||||
|
||||
#ifdef VDSO_HAS_TIME
|
||||
static __maybe_unused __kernel_old_time_t
|
||||
__cvdso_time_data(const struct vdso_data *vd, __kernel_old_time_t *time)
|
||||
__cvdso_time_data(const struct vdso_time_data *vd, __kernel_old_time_t *time)
|
||||
{
|
||||
__kernel_old_time_t t;
|
||||
|
||||
if (IS_ENABLED(CONFIG_TIME_NS) &&
|
||||
vd->clock_mode == VDSO_CLOCKMODE_TIMENS)
|
||||
vd = __arch_get_timens_vdso_data(vd);
|
||||
vd = __arch_get_vdso_u_timens_data(vd);
|
||||
|
||||
t = READ_ONCE(vd[CS_HRES_COARSE].basetime[CLOCK_REALTIME].sec);
|
||||
|
||||
@@ -384,7 +383,7 @@ static __maybe_unused __kernel_old_time_t __cvdso_time(__kernel_old_time_t *time
|
||||
|
||||
#ifdef VDSO_HAS_CLOCK_GETRES
|
||||
static __maybe_unused
|
||||
int __cvdso_clock_getres_common(const struct vdso_data *vd, clockid_t clock,
|
||||
int __cvdso_clock_getres_common(const struct vdso_time_data *vd, clockid_t clock,
|
||||
struct __kernel_timespec *res)
|
||||
{
|
||||
u32 msk;
|
||||
@@ -396,7 +395,7 @@ int __cvdso_clock_getres_common(const struct vdso_data *vd, clockid_t clock,
|
||||
|
||||
if (IS_ENABLED(CONFIG_TIME_NS) &&
|
||||
vd->clock_mode == VDSO_CLOCKMODE_TIMENS)
|
||||
vd = __arch_get_timens_vdso_data(vd);
|
||||
vd = __arch_get_vdso_u_timens_data(vd);
|
||||
|
||||
/*
|
||||
* Convert the clockid to a bitmask and use it to check which
|
||||
@@ -425,7 +424,7 @@ int __cvdso_clock_getres_common(const struct vdso_data *vd, clockid_t clock,
|
||||
}
|
||||
|
||||
static __maybe_unused
|
||||
int __cvdso_clock_getres_data(const struct vdso_data *vd, clockid_t clock,
|
||||
int __cvdso_clock_getres_data(const struct vdso_time_data *vd, clockid_t clock,
|
||||
struct __kernel_timespec *res)
|
||||
{
|
||||
int ret = __cvdso_clock_getres_common(vd, clock, res);
|
||||
@@ -443,7 +442,7 @@ int __cvdso_clock_getres(clockid_t clock, struct __kernel_timespec *res)
|
||||
|
||||
#ifdef BUILD_VDSO32
|
||||
static __maybe_unused int
|
||||
__cvdso_clock_getres_time32_data(const struct vdso_data *vd, clockid_t clock,
|
||||
__cvdso_clock_getres_time32_data(const struct vdso_time_data *vd, clockid_t clock,
|
||||
struct old_timespec32 *res)
|
||||
{
|
||||
struct __kernel_timespec ts;
|
||||
|
||||
Reference in New Issue
Block a user