summaryrefslogtreecommitdiff
path: root/kernel/time/timekeeping.c
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>2025-07-01 10:58:05 +0200
committerThomas Gleixner <tglx@linutronix.de>2025-07-18 13:45:33 +0200
commit380b84e168e57c54d0a9e053a5558fddc43f0c1a (patch)
treea6c5e8b5cb747d13716de16d75636ff171d8bd8a /kernel/time/timekeeping.c
parent9b7fc3f14576c268f62fe0b882fac5e61239b659 (diff)
downloadlinux-380b84e168e57c54d0a9e053a5558fddc43f0c1a.tar.gz
linux-380b84e168e57c54d0a9e053a5558fddc43f0c1a.tar.bz2
linux-380b84e168e57c54d0a9e053a5558fddc43f0c1a.zip
vdso/vsyscall: Update auxiliary clock data in the datapage
Expose the auxiliary clock data so it can be read from the vDSO. Architectures not using the generic vDSO time framework, namely SPARC64, are not supported. 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-11-df7d9f87b9b8@linutronix.de
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r--kernel/time/timekeeping.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index cbcf090bb4be..243fe25e680a 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -66,11 +66,21 @@ static inline bool tk_get_aux_ts64(unsigned int tkid, struct timespec64 *ts)
{
return ktime_get_aux_ts64(CLOCK_AUX + tkid - TIMEKEEPER_AUX_FIRST, ts);
}
+
+static inline bool tk_is_aux(const struct timekeeper *tk)
+{
+ return tk->id >= TIMEKEEPER_AUX_FIRST && tk->id <= TIMEKEEPER_AUX_LAST;
+}
#else
static inline bool tk_get_aux_ts64(unsigned int tkid, struct timespec64 *ts)
{
return false;
}
+
+static inline bool tk_is_aux(const struct timekeeper *tk)
+{
+ return false;
+}
#endif
/* flag for if timekeeping is suspended */
@@ -719,6 +729,8 @@ static void timekeeping_update_from_shadow(struct tk_data *tkd, unsigned int act
update_fast_timekeeper(&tk->tkr_mono, &tk_fast_mono);
update_fast_timekeeper(&tk->tkr_raw, &tk_fast_raw);
+ } else if (tk_is_aux(tk)) {
+ vdso_time_update_aux(tk);
}
if (action & TK_CLOCK_WAS_SET)