diff mbox series

Revert "clocksource/drivers/hyper-v: Handle vDSO differences inline"

Message ID 20220606151326.16562-2-tim.gardner@canonical.com
State New
Headers show
Series Revert "clocksource/drivers/hyper-v: Handle vDSO differences inline" | expand

Commit Message

Tim Gardner June 6, 2022, 3:13 p.m. UTC
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@canonical.com>
---
 arch/x86/include/asm/mshyperv.h    | 2 ++
 drivers/clocksource/hyperv_timer.c | 1 +
 2 files changed, 3 insertions(+)
diff mbox series

Patch

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);