Skip to content

Commit 3486d2c

Browse files
vittyvkKAGA-KOKO
authored andcommitted
clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
Mohammed reports (https://bugzilla.kernel.org/show_bug.cgi?id=213029) the commit e4ab465 ("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: e4ab465 ("clocksource/drivers/hyper-v: Handle vDSO differences inline") Reported-by: Mohammed Gamal <[email protected]> Suggested-by: Thomas Gleixner <[email protected]> Signed-off-by: Vitaly Kuznetsov <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e09784a commit 3486d2c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

arch/x86/include/asm/vdso/clocksource.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@
77
VDSO_CLOCKMODE_PVCLOCK, \
88
VDSO_CLOCKMODE_HVCLOCK
99

10+
#define HAVE_VDSO_CLOCKMODE_HVCLOCK
11+
1012
#endif /* __ASM_VDSO_CLOCKSOURCE_H */

drivers/clocksource/hyperv_timer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static void resume_hv_clock_tsc(struct clocksource *arg)
419419
hv_set_register(HV_REGISTER_REFERENCE_TSC, tsc_msr);
420420
}
421421

422-
#ifdef VDSO_CLOCKMODE_HVCLOCK
422+
#ifdef HAVE_VDSO_CLOCKMODE_HVCLOCK
423423
static int hv_cs_enable(struct clocksource *cs)
424424
{
425425
vclocks_set_used(VDSO_CLOCKMODE_HVCLOCK);
@@ -435,7 +435,7 @@ static struct clocksource hyperv_cs_tsc = {
435435
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
436436
.suspend= suspend_hv_clock_tsc,
437437
.resume = resume_hv_clock_tsc,
438-
#ifdef VDSO_CLOCKMODE_HVCLOCK
438+
#ifdef HAVE_VDSO_CLOCKMODE_HVCLOCK
439439
.enable = hv_cs_enable,
440440
.vdso_clock_mode = VDSO_CLOCKMODE_HVCLOCK,
441441
#else

0 commit comments

Comments
 (0)