CLOCK_BOOTTIME_ALARM behaves exactly as CLOCK_BOOTTIME as far as the vDSO is concerned. The vDSO library can handle it automatically correctly. Only the basetime needs to be maintained during the tick.
The namespace offset is already set correctly, although it was not used before. Reuse the CLOCK_BOOTTIME basetime for CLOCK_BOOTTIME_ALARM and update the userspace hres clock mask to include CLOCK_BOOTTIME_ALARM. Signed-off-by: Thomas Weißschuh <[email protected]> --- include/vdso/datapage.h | 1 + kernel/time/vsyscall.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h index 09897f76ae07..33297b5e2521 100644 --- a/include/vdso/datapage.h +++ b/include/vdso/datapage.h @@ -35,6 +35,7 @@ struct vdso_arch_data { #define VDSO_HRES (BIT(CLOCK_REALTIME) | \ BIT(CLOCK_MONOTONIC) | \ BIT(CLOCK_BOOTTIME) | \ + BIT(CLOCK_BOOTTIME_ALARM) | \ BIT(CLOCK_TAI)) #define VDSO_COARSE (BIT(CLOCK_REALTIME_COARSE) | \ BIT(CLOCK_MONOTONIC_COARSE)) diff --git a/kernel/time/vsyscall.c b/kernel/time/vsyscall.c index 0e4b499328c0..bb412ad1782f 100644 --- a/kernel/time/vsyscall.c +++ b/kernel/time/vsyscall.c @@ -57,6 +57,9 @@ static inline void update_vdso_time_data(struct vdso_time_data *vdata, struct ti vdso_ts->sec += __iter_div64_u64_rem(nsec, (u64)NSEC_PER_SEC << tk->tkr_mono.shift, &vdso_ts->nsec); + /* CLOCK_BOOTTIME_ALARM, copy of CLOCK_BOOTIME */ + vc[CS_HRES_COARSE].basetime[CLOCK_BOOTTIME_ALARM] = *vdso_ts; + /* CLOCK_MONOTONIC_RAW */ vdso_ts = &vc[CS_RAW].basetime[CLOCK_MONOTONIC_RAW]; vdso_ts->sec = tk->raw_sec; -- 2.55.0

