Commit 3486d2c9 authored by Vitaly Kuznetsov's avatar Vitaly Kuznetsov Committed by Thomas Gleixner

clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86

Mohammed reports (https://bugzilla.kernel.org/show_bug.cgi?id=213029)
the commit e4ab4658 ("clocksource/drivers/hyper-v: Handle vDSO
differences inline") broke vDSO on x86. The problem appears to be that
VDSO_CLOCKMODE_HVCLOCK is an enum value in 'enum vdso_clock_mode' and
'#ifdef VDSO_CLOCKMODE_HVCLOCK' branch evaluates to false (it is not
a define).

Use a dedicated HAVE_VDSO_CLOCKMODE_HVCLOCK define instead.

Fixes: e4ab4658 ("clocksource/drivers/hyper-v: Handle vDSO differences inline")
Reported-by: default avatarMohammed Gamal <mgamal@redhat.com>
Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarMichael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20210513073246.1715070-1-vkuznets@redhat.com
parent e09784a8
...@@ -7,4 +7,6 @@ ...@@ -7,4 +7,6 @@
VDSO_CLOCKMODE_PVCLOCK, \ VDSO_CLOCKMODE_PVCLOCK, \
VDSO_CLOCKMODE_HVCLOCK VDSO_CLOCKMODE_HVCLOCK
#define HAVE_VDSO_CLOCKMODE_HVCLOCK
#endif /* __ASM_VDSO_CLOCKSOURCE_H */ #endif /* __ASM_VDSO_CLOCKSOURCE_H */
...@@ -419,7 +419,7 @@ static void resume_hv_clock_tsc(struct clocksource *arg) ...@@ -419,7 +419,7 @@ static void resume_hv_clock_tsc(struct clocksource *arg)
hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr); hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr);
} }
#ifdef VDSO_CLOCKMODE_HVCLOCK #ifdef HAVE_VDSO_CLOCKMODE_HVCLOCK
static int hv_cs_enable(struct clocksource *cs) static int hv_cs_enable(struct clocksource *cs)
{ {
vclocks_set_used(VDSO_CLOCKMODE_HVCLOCK); vclocks_set_used(VDSO_CLOCKMODE_HVCLOCK);
...@@ -435,7 +435,7 @@ static struct clocksource hyperv_cs_tsc = { ...@@ -435,7 +435,7 @@ static struct clocksource hyperv_cs_tsc = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS, .flags = CLOCK_SOURCE_IS_CONTINUOUS,
.suspend= suspend_hv_clock_tsc, .suspend= suspend_hv_clock_tsc,
.resume = resume_hv_clock_tsc, .resume = resume_hv_clock_tsc,
#ifdef VDSO_CLOCKMODE_HVCLOCK #ifdef HAVE_VDSO_CLOCKMODE_HVCLOCK
.enable = hv_cs_enable, .enable = hv_cs_enable,
.vdso_clock_mode = VDSO_CLOCKMODE_HVCLOCK, .vdso_clock_mode = VDSO_CLOCKMODE_HVCLOCK,
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment