diff options
author | Peter Zijlstra <peterz@infradead.org> | 2023-01-26 16:08:36 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2023-01-31 15:01:47 +0100 |
commit | 8739c6811572b087decd561f96382087402cc343 (patch) | |
tree | 60330c4df92998fd1994afa131ebab2b24ca67b2 /arch/x86/kernel/kvmclock.c | |
parent | 5c9da9fe826d4a0d84bb322cca27cc8ad8d23b24 (diff) | |
download | linux-stable-8739c6811572b087decd561f96382087402cc343.tar.gz linux-stable-8739c6811572b087decd561f96382087402cc343.tar.bz2 linux-stable-8739c6811572b087decd561f96382087402cc343.zip |
sched/clock/x86: Mark sched_clock() noinstr
In order to use sched_clock() from noinstr code, mark it and all it's
implenentations noinstr.
The whole pvclock thing (used by KVM/Xen) is a bit of a pain,
since it calls out to watchdogs, create a
pvclock_clocksource_read_nowd() variant doesn't do that and can be
noinstr.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230126151323.702003578@infradead.org
Diffstat (limited to 'arch/x86/kernel/kvmclock.c')
-rw-r--r-- | arch/x86/kernel/kvmclock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index 16333ba1904b..0f35d44c56fe 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -71,12 +71,12 @@ static int kvm_set_wallclock(const struct timespec64 *now) return -ENODEV; } -static u64 kvm_clock_read(void) +static noinstr u64 kvm_clock_read(void) { u64 ret; preempt_disable_notrace(); - ret = pvclock_clocksource_read(this_cpu_pvti()); + ret = pvclock_clocksource_read_nowd(this_cpu_pvti()); preempt_enable_notrace(); return ret; } @@ -86,7 +86,7 @@ static u64 kvm_clock_get_cycles(struct clocksource *cs) return kvm_clock_read(); } -static u64 kvm_sched_clock_read(void) +static noinstr u64 kvm_sched_clock_read(void) { return kvm_clock_read() - kvm_sched_clock_offset; } |