summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/time.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2023-05-19 12:21:04 +0200
committerPeter Zijlstra <peterz@infradead.org>2023-06-05 21:11:06 +0200
commit91b41a237512b569746e1f560a42d9fba077261d (patch)
tree03db4aa84444888fb7d7d731fe61575fe58b47e3 /arch/s390/kernel/time.c
parent6b10fef09f937433563822f4bb6a2f947176e5a0 (diff)
downloadlinux-stable-91b41a237512b569746e1f560a42d9fba077261d.tar.gz
linux-stable-91b41a237512b569746e1f560a42d9fba077261d.tar.bz2
linux-stable-91b41a237512b569746e1f560a42d9fba077261d.zip
s390/time: Provide sched_clock_noinstr()
With the intent to provide local_clock_noinstr(), a variant of local_clock() that's safe to be called from noinstr code (with the assumption that any such code will already be non-preemptible), prepare for things by providing a noinstr sched_clock_noinstr() function. Specifically, preempt_enable_*() calls out to schedule(), which upsets noinstr validation efforts. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Heiko Carstens <hca@linux.ibm.com> Tested-by: Michael Kelley <mikelley@microsoft.com> # Hyper-V Link: https://lore.kernel.org/r/20230519102715.570170436@infradead.org
Diffstat (limited to 'arch/s390/kernel/time.c')
-rw-r--r--arch/s390/kernel/time.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 6b7b6d5e3632..276278199c44 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -102,6 +102,11 @@ void __init time_early_init(void)
((long) qui.old_leap * 4096000000L);
}
+unsigned long long noinstr sched_clock_noinstr(void)
+{
+ return tod_to_ns(__get_tod_clock_monotonic());
+}
+
/*
* Scheduler clock - returns current time in nanosec units.
*/