[PATCH 01/15] vdso: Move the kernel-side time update helpers to a new header
From: Thomas Weißschuh
Date: Wed Sep 09 2026 - 05:00:29 EST
The vdso/ header namespace is meant for symbols which are usable from
vDSO userspace code. However vdso_update_begin() and vdso_update_end()
are only usable from the kernel.
Move them into a new header in the linux/ namespace. Also rename them to
make clear that they are only for time-related data.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
---
MAINTAINERS | 1 +
arch/s390/kernel/time.c | 5 +++--
include/linux/vdso_time.h | 8 ++++++++
include/vdso/vsyscall.h | 3 ---
kernel/time/vsyscall.c | 13 +++++++------
5 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 3a19da74d00c..562ace172594 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11066,6 +11066,7 @@ S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/vdso
F: include/asm-generic/vdso/vsyscall.h
F: include/linux/vdso_datastore.h
+F: include/linux/vdso_time.h
F: include/vdso/
F: kernel/time/namespace_vdso.c
F: kernel/time/vsyscall.c
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 2b989bebd220..161628f6906f 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -39,6 +39,7 @@
#include <linux/gfp.h>
#include <linux/kprobes.h>
#include <linux/uaccess.h>
+#include <linux/vdso_time.h>
#include <vdso/vsyscall.h>
#include <vdso/clocksource.h>
#include <vdso/helpers.h>
@@ -527,7 +528,7 @@ static int stp_sync_clock(void *data)
cpu_relax();
rc = 0;
if (stp_info.todoff || stp_info.tmd != 2) {
- flags = vdso_update_begin();
+ flags = vdso_time_update_begin();
rc = chsc_sstpc(stp_page, STP_OP_SYNC, 0,
&clock_delta);
if (rc == 0) {
@@ -537,7 +538,7 @@ static int stp_sync_clock(void *data)
if (rc == 0 && stp_info.tmd != 2)
rc = -EAGAIN;
}
- vdso_update_end(flags);
+ vdso_time_update_end(flags);
}
sync->in_sync = rc ? -EAGAIN : 1;
xchg(&first, 0);
diff --git a/include/linux/vdso_time.h b/include/linux/vdso_time.h
new file mode 100644
index 000000000000..6d81ee3a3c9c
--- /dev/null
+++ b/include/linux/vdso_time.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_VDSO_TIME_H
+#define _LINUX_VDSO_TIME_H
+
+unsigned long vdso_time_update_begin(void);
+void vdso_time_update_end(unsigned long flags);
+
+#endif /* _LINUX_VDSO_TIME_H */
diff --git a/include/vdso/vsyscall.h b/include/vdso/vsyscall.h
index c5c2a2c07857..29dd4e097220 100644
--- a/include/vdso/vsyscall.h
+++ b/include/vdso/vsyscall.h
@@ -6,9 +6,6 @@
#include <asm/vdso/vsyscall.h>
-unsigned long vdso_update_begin(void);
-void vdso_update_end(unsigned long flags);
-
#endif /* !__ASSEMBLER__ */
#endif /* __VDSO_VSYSCALL_H */
diff --git a/kernel/time/vsyscall.c b/kernel/time/vsyscall.c
index aa59919b8f2c..12e205d86e7f 100644
--- a/kernel/time/vsyscall.c
+++ b/kernel/time/vsyscall.c
@@ -9,6 +9,7 @@
#include <linux/hrtimer.h>
#include <linux/timekeeper_internal.h>
+#include <linux/vdso_time.h>
#include <vdso/datapage.h>
#include <vdso/helpers.h>
#include <vdso/vsyscall.h>
@@ -177,7 +178,7 @@ void vdso_time_update_aux(struct timekeeper *tk)
#endif
/**
- * vdso_update_begin - Start of a VDSO update section
+ * vdso_time_update_begin - Start of a VDSO update section
*
* Allows architecture code to safely update the architecture specific VDSO
* data. Disables interrupts, acquires timekeeper lock to serialize against
@@ -188,7 +189,7 @@ void vdso_time_update_aux(struct timekeeper *tk)
* Returns: Saved interrupt flags which need to be handed in to
* vdso_update_end().
*/
-unsigned long vdso_update_begin(void)
+unsigned long vdso_time_update_begin(void)
{
struct vdso_time_data *vdata = vdso_k_time_data;
unsigned long flags = timekeeper_lock_irqsave();
@@ -198,14 +199,14 @@ unsigned long vdso_update_begin(void)
}
/**
- * vdso_update_end - End of a VDSO update section
- * @flags: Interrupt flags as returned from vdso_update_begin()
+ * vdso_time_update_end - End of a VDSO update section
+ * @flags: Interrupt flags as returned from vdso_time_update_begin()
*
- * Pairs with vdso_update_begin(). Marks vdso data consistent, invokes data
+ * Pairs with vdso_time_update_begin(). Marks vdso data consistent, invokes data
* synchronization if the architecture requires it, drops timekeeper lock
* and restores interrupt flags.
*/
-void vdso_update_end(unsigned long flags)
+void vdso_time_update_end(unsigned long flags)
{
struct vdso_time_data *vdata = vdso_k_time_data;
--
2.55.0