diff options
author | Peter Zijlstra <peterz@infradead.org> | 2023-05-19 12:21:08 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2023-06-05 21:11:08 +0200 |
commit | e39acc37db34f6688e2c16e958fb1d662c422c81 (patch) | |
tree | eceb7d6b799562d0c1e35f4e4e0b9d2f7d8ca819 /arch/x86 | |
parent | 9397fa2ea3e7634f61da1ab76b9eb88ba04dfdfc (diff) | |
download | linux-e39acc37db34f6688e2c16e958fb1d662c422c81.tar.gz linux-e39acc37db34f6688e2c16e958fb1d662c422c81.tar.bz2 linux-e39acc37db34f6688e2c16e958fb1d662c422c81.zip |
clocksource: hyper-v: Provide noinstr sched_clock()
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 making the Hyper-V TSC and MSR sched_clock
implementations noinstr.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Co-developed-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Michael Kelley <mikelley@microsoft.com> # Hyper-V
Link: https://lore.kernel.org/r/20230519102715.843039089@infradead.org
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/mshyperv.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 49bb4f2bd300..88d9ef98e087 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -257,6 +257,11 @@ void hv_set_register(unsigned int reg, u64 value); u64 hv_get_non_nested_register(unsigned int reg); void hv_set_non_nested_register(unsigned int reg, u64 value); +static __always_inline u64 hv_raw_get_register(unsigned int reg) +{ + return __rdmsr(reg); +} + #else /* CONFIG_HYPERV */ static inline void hyperv_init(void) {} static inline void hyperv_setup_mmu_ops(void) {} |