[PATCH] Revert "clocksource/drivers/hyper-v: Handle vDSO differences inline"
Tim Gardner
tim.gardner at canonical.com
Mon Jun 6 15:13:26 UTC 2022
BugLink: https://bugs.launchpad.net/bugs/1977753
This reverts commit 66dd4561556e58a49962635e6db510016bd67a19.
Causes problems with strace, e.g.,
"strace date 2>&1 | grep time" should no longer show the clock_gettime() syscall.
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
arch/x86/include/asm/mshyperv.h | 2 ++
drivers/clocksource/hyperv_timer.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h
index f8a102cab8dd..5eba0ba2bfba 100644
--- a/arch/x86/include/asm/mshyperv.h
+++ b/arch/x86/include/asm/mshyperv.h
@@ -26,6 +26,8 @@ static inline u64 hv_get_register(unsigned int reg)
return value;
}
+#define hv_set_clocksource_vdso(val) \
+ ((val).archdata.vclock_mode = VCLOCK_HVCLOCK)
#define hv_get_raw_timer() rdtsc_ordered()
void hyperv_callback_vector(void);
diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index 11254d315a5b..b1db186b7999 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -512,6 +512,7 @@ static bool __init hv_init_tsc_clocksource(void)
tsc_msr = tsc_msr | 0x1 | (u64)phys_addr;
hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr);
+ hv_set_clocksource_vdso(hyperv_cs_tsc);
clocksource_register_hz(&hyperv_cs_tsc, NSEC_PER_SEC/100);
hv_sched_clock_offset = hyperv_cs->read(hyperv_cs);
--
2.36.1
More information about the kernel-team
mailing list