clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
Subsystems (4)
PATCH v2 1/1 clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
Mohammed reports (https://bugzilla.kernel.org/show_bug.cgi?id=213029)
the commit e4ab4658f1cf ("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.
--- arch/x86/include/asm/vdso/clocksource.h | 2 ++ drivers/clocksource/hyperv_timer.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
arch/x86/include/asm/vdso/clocksource.h +2 -0
@@ -7,4 +7,6 @@VDSO_CLOCKMODE_PVCLOCK , \ VDSO_CLOCKMODE_HVCLOCK +#define HAVE_VDSO_CLOCKMODE_HVCLOCK +#endif /* __ASM_VDSO_CLOCKSOURCE_H */
drivers/clocksource/hyperv_timer.c +2 -2
@@ -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
Signature · 1 line
2.31.1
From: Vitaly Kuznetsov <[email protected]> Sent: Thursday, May 13, 2021 12:33 AM
Quoted 52 lines
Mohammed reports (https://bugzilla.kernel.org/show_bug.cgi?id=213029)
the commite4ab4658f1cf("clocksource/drivers/hyper-v: Handle vDSO differences inline") broke vDSO on x86. The problem appears to be thatVDSO_CLOCKMODE_HVCLOCKis an enum value in 'enumvdso_clock_mode' and '#ifdefVDSO_CLOCKMODE_HVCLOCK' branch evaluates to false (it is not a define). Use a dedicatedHAVE_VDSO_CLOCKMODE_HVCLOCKdefine instead.Suggested-by Thomas Gleixner <[email protected]>Reported-by Mohammed Gamal <[email protected]>Fixes e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")Signed-off-by Vitaly Kuznetsov <[email protected]>--- arch/x86/include/asm/vdso/clocksource.h | 2 ++ drivers/clocksource/hyperv_timer.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)arch/x86/include/asm/vdso/clocksource.h +2
-0@@ -7,4 +7,6 @@VDSO_CLOCKMODE_PVCLOCK , \ VDSO_CLOCKMODE_HVCLOCK +#define HAVE_VDSO_CLOCKMODE_HVCLOCK +#endif /* __ASM_VDSO_CLOCKSOURCE_H */ drivers/clocksource/hyperv_timer.c +2
-3@@ -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 --
Quoted 1 line
2.31.1
Quoted 13 lines · Michael Kelley
From: Vitaly Kuznetsov <[email protected]> Sent: Thursday, May 13, 2021 12:33 AM
Quoted 12 lines
Mohammed reports (https://bugzilla.kernel.org/show_bug.cgi?id=213029)
the commite4ab4658f1cf("clocksource/drivers/hyper-v: Handle vDSO differences inline") broke vDSO on x86. The problem appears to be thatVDSO_CLOCKMODE_HVCLOCKis an enum value in 'enumvdso_clock_mode' and '#ifdefVDSO_CLOCKMODE_HVCLOCK' branch evaluates to false (it is not a define). Use a dedicatedHAVE_VDSO_CLOCKMODE_HVCLOCKdefine instead.Suggested-by Thomas Gleixner <[email protected]>Reported-by Mohammed Gamal <[email protected]>Fixes e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")Signed-off-by Vitaly Kuznetsov <[email protected]>
[...]
Quoted 3 lines
Reviewed-by Michael Kelley <[email protected]>
Applied to hyperv-fixes. Thanks.
Quoted 14 lines · Wei Liu
Quoted 13 lines · Michael Kelley
From: Vitaly Kuznetsov <[email protected]> Sent: Thursday, May 13, 2021 12:33 AM
Quoted 12 lines
Mohammed reports (https://bugzilla.kernel.org/show_bug.cgi?id=213029)
the commite4ab4658f1cf("clocksource/drivers/hyper-v: Handle vDSO differences inline") broke vDSO on x86. The problem appears to be thatVDSO_CLOCKMODE_HVCLOCKis an enum value in 'enumvdso_clock_mode' and '#ifdefVDSO_CLOCKMODE_HVCLOCK' branch evaluates to false (it is not a define). Use a dedicatedHAVE_VDSO_CLOCKMODE_HVCLOCKdefine instead.Suggested-by Thomas Gleixner <[email protected]>Reported-by Mohammed Gamal <[email protected]>Fixes e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")Signed-off-by Vitaly Kuznetsov <[email protected]>
Quoted 5 lines
[...]
Quoted 3 lines
Reviewed-by Michael Kelley <[email protected]>Applied to hyperv-fixes. Thanks.
It's already in the tip tree...
Wei Liu
maintainerQuoted 16 lines · Thomas Gleixner
Quoted 14 lines · Wei Liu
Quoted 13 lines · Michael Kelley
From: Vitaly Kuznetsov <[email protected]> Sent: Thursday, May 13, 2021 12:33 AM
Quoted 12 lines
Mohammed reports (https://bugzilla.kernel.org/show_bug.cgi?id=213029)
the commite4ab4658f1cf("clocksource/drivers/hyper-v: Handle vDSO differences inline") broke vDSO on x86. The problem appears to be thatVDSO_CLOCKMODE_HVCLOCKis an enum value in 'enumvdso_clock_mode' and '#ifdefVDSO_CLOCKMODE_HVCLOCK' branch evaluates to false (it is not a define). Use a dedicatedHAVE_VDSO_CLOCKMODE_HVCLOCKdefine instead.Suggested-by Thomas Gleixner <[email protected]>Reported-by Mohammed Gamal <[email protected]>Fixes e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")Signed-off-by Vitaly Kuznetsov <[email protected]>
Quoted 7 lines
Quoted 5 lines
[...]
Quoted 3 lines
Reviewed-by Michael Kelley <[email protected]>Applied to hyperv-fixes. Thanks.
It's already in the tip tree...
Okay. I will drop it. Thanks.
The following commit has been merged into the timers/urgent branch of tip:
The following commit has been merged into the timers/urgent branch of tip:
Commit-ID: 3486d2c9be652a31033363bdd50391b0c8a8fe21 Gitweb: https://git.kernel.org/tip/3486d2c9be652a31033363bdd50391b0c8a8fe21 Author: Vitaly Kuznetsov <[email protected]> AuthorDate: Thu, 13 May 2021 09:32:46 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Fri, 14 May 2021 14:55:13 +02:00
clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
Mohammed reports (https://bugzilla.kernel.org/show_bug.cgi?id=213029)
the commit e4ab4658f1cf ("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.
--- arch/x86/include/asm/vdso/clocksource.h | 2 ++ drivers/clocksource/hyperv_timer.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
arch/x86/include/asm/vdso/clocksource.h +2 -0
@@ -7,4 +7,6 @@VDSO_CLOCKMODE_PVCLOCK , \ VDSO_CLOCKMODE_HVCLOCK +#define HAVE_VDSO_CLOCKMODE_HVCLOCK +#endif /* __ASM_VDSO_CLOCKSOURCE_H */
drivers/clocksource/hyperv_timer.c +2 -2
@@ -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