Skip to content

Commit 76164ca

Browse files
t-8chKAGA-KOKO
authored andcommitted
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: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20250701-vdso-auxclock-v1-3-df7d9f87b9b8@linutronix.de
1 parent 6fedaf6 commit 76164ca

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

arch/arm64/include/asm/vdso/vsyscall.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
* Update the vDSO data page to keep in sync with kernel timekeeping.
1414
*/
1515
static __always_inline
16-
void __arm64_update_vsyscall(struct vdso_time_data *vdata)
16+
void __arch_update_vdso_clock(struct vdso_clock *vc)
1717
{
18-
vdata->clock_data[CS_HRES_COARSE].mask = VDSO_PRECISION_MASK;
19-
vdata->clock_data[CS_RAW].mask = VDSO_PRECISION_MASK;
18+
vc->mask = VDSO_PRECISION_MASK;
2019
}
21-
#define __arch_update_vsyscall __arm64_update_vsyscall
20+
#define __arch_update_vdso_clock __arch_update_vdso_clock
2221

2322
/* The asm-generic header needs to be included after the definitions above */
2423
#include <asm-generic/vdso/vsyscall.h>

include/asm-generic/vdso/vsyscall.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ static __always_inline const struct vdso_rng_data *__arch_get_vdso_u_rng_data(vo
2222

2323
#endif /* CONFIG_GENERIC_VDSO_DATA_STORE */
2424

25-
#ifndef __arch_update_vsyscall
26-
static __always_inline void __arch_update_vsyscall(struct vdso_time_data *vdata)
25+
#ifndef __arch_update_vdso_clock
26+
static __always_inline void __arch_update_vdso_clock(struct vdso_clock *vc)
2727
{
2828
}
29-
#endif /* __arch_update_vsyscall */
29+
#endif /* __arch_update_vdso_clock */
3030

3131
#ifndef __arch_sync_vdso_time_data
3232
static __always_inline void __arch_sync_vdso_time_data(struct vdso_time_data *vdata)

kernel/time/vsyscall.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ void update_vsyscall(struct timekeeper *tk)
118118
if (clock_mode != VDSO_CLOCKMODE_NONE)
119119
update_vdso_time_data(vdata, tk);
120120

121-
__arch_update_vsyscall(vdata);
121+
__arch_update_vdso_clock(&vc[CS_HRES_COARSE]);
122+
__arch_update_vdso_clock(&vc[CS_RAW]);
122123

123124
vdso_write_end(vdata);
124125

0 commit comments

Comments
 (0)