Commit 76164ca0 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Thomas Gleixner
Browse files

vdso/vsyscall: Split up __arch_update_vsyscall() into __arch_update_vdso_clock()



The upcoming auxiliary clocks need this hook, too.
To separate the architecture hooks from the timekeeper internals, refactor
the hook to only operate on a single vDSO clock.

While at it, use a more robust #define for the hook override.

Signed-off-by: default avatarThomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250701-vdso-auxclock-v1-3-df7d9f87b9b8@linutronix.de
parent 6fedaf68
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -13,12 +13,11 @@
 * Update the vDSO data page to keep in sync with kernel timekeeping.
 */
static __always_inline
void __arm64_update_vsyscall(struct vdso_time_data *vdata)
void __arch_update_vdso_clock(struct vdso_clock *vc)
{
	vdata->clock_data[CS_HRES_COARSE].mask	= VDSO_PRECISION_MASK;
	vdata->clock_data[CS_RAW].mask		= VDSO_PRECISION_MASK;
	vc->mask	= VDSO_PRECISION_MASK;
}
#define __arch_update_vsyscall __arm64_update_vsyscall
#define __arch_update_vdso_clock __arch_update_vdso_clock

/* The asm-generic header needs to be included after the definitions above */
#include <asm-generic/vdso/vsyscall.h>
+3 −3
Original line number Diff line number Diff line
@@ -22,11 +22,11 @@ static __always_inline const struct vdso_rng_data *__arch_get_vdso_u_rng_data(vo

#endif /* CONFIG_GENERIC_VDSO_DATA_STORE */

#ifndef __arch_update_vsyscall
static __always_inline void __arch_update_vsyscall(struct vdso_time_data *vdata)
#ifndef __arch_update_vdso_clock
static __always_inline void __arch_update_vdso_clock(struct vdso_clock *vc)
{
}
#endif /* __arch_update_vsyscall */
#endif /* __arch_update_vdso_clock */

#ifndef __arch_sync_vdso_time_data
static __always_inline void __arch_sync_vdso_time_data(struct vdso_time_data *vdata)
+2 −1
Original line number Diff line number Diff line
@@ -118,7 +118,8 @@ void update_vsyscall(struct timekeeper *tk)
	if (clock_mode != VDSO_CLOCKMODE_NONE)
		update_vdso_time_data(vdata, tk);

	__arch_update_vsyscall(vdata);
	__arch_update_vdso_clock(&vc[CS_HRES_COARSE]);
	__arch_update_vdso_clock(&vc[CS_RAW]);

	vdso_write_end(vdata);