]> git.baikalelectronics.ru Git - kernel.git/commitdiff
clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
authorVitaly Kuznetsov <vkuznets@redhat.com>
Thu, 13 May 2021 07:32:46 +0000 (09:32 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 14 May 2021 12:55:13 +0000 (14:55 +0200)
Mohammed reports (https://bugzilla.kernel.org/show_bug.cgi?id=213029)
the commit bccc999ea88e ("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: bccc999ea88e ("clocksource/drivers/hyper-v: Handle vDSO differences inline")
Reported-by: Mohammed Gamal <mgamal@redhat.com>
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20210513073246.1715070-1-vkuznets@redhat.com
arch/x86/include/asm/vdso/clocksource.h
drivers/clocksource/hyperv_timer.c

index 119ac8612d893164634f76e46f674f435bccbd87..136e5e57cfe112ddd486a71d0def80413fe15f07 100644 (file)
@@ -7,4 +7,6 @@
        VDSO_CLOCKMODE_PVCLOCK, \
        VDSO_CLOCKMODE_HVCLOCK
 
+#define HAVE_VDSO_CLOCKMODE_HVCLOCK
+
 #endif /* __ASM_VDSO_CLOCKSOURCE_H */
index 977fd05ac35f62e1db380a8f289f475b52109355..d6ece7bbce894b0f9d42da6922178f9341bbb658 100644 (file)
@@ -419,7 +419,7 @@ static void resume_hv_clock_tsc(struct clocksource *arg)
        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)
 {
        vclocks_set_used(VDSO_CLOCKMODE_HVCLOCK);
@@ -435,7 +435,7 @@ static struct clocksource hyperv_cs_tsc = {
        .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
        .suspend= suspend_hv_clock_tsc,
        .resume = resume_hv_clock_tsc,
-#ifdef VDSO_CLOCKMODE_HVCLOCK
+#ifdef HAVE_VDSO_CLOCKMODE_HVCLOCK
        .enable = hv_cs_enable,
        .vdso_clock_mode = VDSO_CLOCKMODE_HVCLOCK,
 #else