All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
@ 2021-05-13  7:32 Vitaly Kuznetsov
  2021-05-13 13:29 ` Michael Kelley
  2021-05-14 12:59 ` [tip: timers/urgent] " tip-bot2 for Vitaly Kuznetsov
  0 siblings, 2 replies; 6+ messages in thread
From: Vitaly Kuznetsov @ 2021-05-13  7:32 UTC (permalink / raw)
  To: linux-hyperv
  Cc: Daniel Lezcano, Michael Kelley, Mohammed Gamal, Wei Liu,
	K. Y. Srinivasan, Haiyang Zhang, Dexuan Cui, Stephen Hemminger,
	Thomas Gleixner, linux-kernel

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.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Mohammed Gamal <mgamal@redhat.com>
Fixes: e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 arch/x86/include/asm/vdso/clocksource.h | 2 ++
 drivers/clocksource/hyperv_timer.c      | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/vdso/clocksource.h b/arch/x86/include/asm/vdso/clocksource.h
index 119ac8612d89..136e5e57cfe1 100644
--- a/arch/x86/include/asm/vdso/clocksource.h
+++ b/arch/x86/include/asm/vdso/clocksource.h
@@ -7,4 +7,6 @@
 	VDSO_CLOCKMODE_PVCLOCK,	\
 	VDSO_CLOCKMODE_HVCLOCK
 
+#define HAVE_VDSO_CLOCKMODE_HVCLOCK
+
 #endif /* __ASM_VDSO_CLOCKSOURCE_H */
diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index 977fd05ac35f..d6ece7bbce89 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -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
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH v2] clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
  2021-05-13  7:32 [PATCH v2] clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86 Vitaly Kuznetsov
@ 2021-05-13 13:29 ` Michael Kelley
  2021-05-15 15:43   ` Wei Liu
  2021-05-14 12:59 ` [tip: timers/urgent] " tip-bot2 for Vitaly Kuznetsov
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Kelley @ 2021-05-13 13:29 UTC (permalink / raw)
  To: vkuznets, linux-hyperv
  Cc: Daniel Lezcano, Mohammed Gamal, Wei Liu, KY Srinivasan,
	Haiyang Zhang, Dexuan Cui, Stephen Hemminger, Thomas Gleixner,
	linux-kernel

From: Vitaly Kuznetsov <vkuznets@redhat.com> Sent: Thursday, May 13, 2021 12:33 AM
> 
> 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.
> 
> Suggested-by: Thomas Gleixner <tglx@linutronix.de>
> Reported-by: Mohammed Gamal <mgamal@redhat.com>
> Fixes: e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
>  arch/x86/include/asm/vdso/clocksource.h | 2 ++
>  drivers/clocksource/hyperv_timer.c      | 4 ++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/include/asm/vdso/clocksource.h
> b/arch/x86/include/asm/vdso/clocksource.h
> index 119ac8612d89..136e5e57cfe1 100644
> --- a/arch/x86/include/asm/vdso/clocksource.h
> +++ b/arch/x86/include/asm/vdso/clocksource.h
> @@ -7,4 +7,6 @@
>  	VDSO_CLOCKMODE_PVCLOCK,	\
>  	VDSO_CLOCKMODE_HVCLOCK
> 
> +#define HAVE_VDSO_CLOCKMODE_HVCLOCK
> +
>  #endif /* __ASM_VDSO_CLOCKSOURCE_H */
> diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
> index 977fd05ac35f..d6ece7bbce89 100644
> --- a/drivers/clocksource/hyperv_timer.c
> +++ b/drivers/clocksource/hyperv_timer.c
> @@ -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
> --
> 2.31.1

Reviewed-by: Michael Kelley <mikelley@microsoft.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip: timers/urgent] clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
  2021-05-13  7:32 [PATCH v2] clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86 Vitaly Kuznetsov
  2021-05-13 13:29 ` Michael Kelley
@ 2021-05-14 12:59 ` tip-bot2 for Vitaly Kuznetsov
  1 sibling, 0 replies; 6+ messages in thread
From: tip-bot2 for Vitaly Kuznetsov @ 2021-05-14 12:59 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Mohammed Gamal, Thomas Gleixner, Vitaly Kuznetsov,
	Michael Kelley, x86, linux-kernel

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 <vkuznets@redhat.com>
AuthorDate:    Thu, 13 May 2021 09:32:46 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
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.

Fixes: e4ab4658f1cf ("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 | 2 ++
 drivers/clocksource/hyperv_timer.c      | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/vdso/clocksource.h b/arch/x86/include/asm/vdso/clocksource.h
index 119ac86..136e5e5 100644
--- a/arch/x86/include/asm/vdso/clocksource.h
+++ b/arch/x86/include/asm/vdso/clocksource.h
@@ -7,4 +7,6 @@
 	VDSO_CLOCKMODE_PVCLOCK,	\
 	VDSO_CLOCKMODE_HVCLOCK
 
+#define HAVE_VDSO_CLOCKMODE_HVCLOCK
+
 #endif /* __ASM_VDSO_CLOCKSOURCE_H */
diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index 977fd05..d6ece7b 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
  2021-05-13 13:29 ` Michael Kelley
@ 2021-05-15 15:43   ` Wei Liu
  2021-05-15 19:06     ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: Wei Liu @ 2021-05-15 15:43 UTC (permalink / raw)
  To: Michael Kelley
  Cc: vkuznets, linux-hyperv, Daniel Lezcano, Mohammed Gamal, Wei Liu,
	KY Srinivasan, Haiyang Zhang, Dexuan Cui, Stephen Hemminger,
	Thomas Gleixner, linux-kernel

On Thu, May 13, 2021 at 01:29:12PM +0000, Michael Kelley wrote:
> From: Vitaly Kuznetsov <vkuznets@redhat.com> Sent: Thursday, May 13, 2021 12:33 AM
> > 
> > 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.
> > 
> > Suggested-by: Thomas Gleixner <tglx@linutronix.de>
> > Reported-by: Mohammed Gamal <mgamal@redhat.com>
> > Fixes: e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")
> > Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
[...]
> 
> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> 

Applied to hyperv-fixes. Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
  2021-05-15 15:43   ` Wei Liu
@ 2021-05-15 19:06     ` Thomas Gleixner
  2021-05-15 19:32       ` Wei Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2021-05-15 19:06 UTC (permalink / raw)
  To: Wei Liu, Michael Kelley
  Cc: vkuznets, linux-hyperv, Daniel Lezcano, Mohammed Gamal, Wei Liu,
	KY Srinivasan, Haiyang Zhang, Dexuan Cui, Stephen Hemminger,
	linux-kernel

On Sat, May 15 2021 at 15:43, Wei Liu wrote:

> On Thu, May 13, 2021 at 01:29:12PM +0000, Michael Kelley wrote:
>> From: Vitaly Kuznetsov <vkuznets@redhat.com> Sent: Thursday, May 13, 2021 12:33 AM
>> > 
>> > 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.
>> > 
>> > Suggested-by: Thomas Gleixner <tglx@linutronix.de>
>> > Reported-by: Mohammed Gamal <mgamal@redhat.com>
>> > Fixes: e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")
>> > Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> [...]
>> 
>> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
>> 
> Applied to hyperv-fixes. Thanks.

It's already in the tip tree...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86
  2021-05-15 19:06     ` Thomas Gleixner
@ 2021-05-15 19:32       ` Wei Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2021-05-15 19:32 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Wei Liu, Michael Kelley, vkuznets, linux-hyperv, Daniel Lezcano,
	Mohammed Gamal, KY Srinivasan, Haiyang Zhang, Dexuan Cui,
	Stephen Hemminger, linux-kernel

On Sat, May 15, 2021 at 09:06:37PM +0200, Thomas Gleixner wrote:
> On Sat, May 15 2021 at 15:43, Wei Liu wrote:
> 
> > On Thu, May 13, 2021 at 01:29:12PM +0000, Michael Kelley wrote:
> >> From: Vitaly Kuznetsov <vkuznets@redhat.com> Sent: Thursday, May 13, 2021 12:33 AM
> >> > 
> >> > 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.
> >> > 
> >> > Suggested-by: Thomas Gleixner <tglx@linutronix.de>
> >> > Reported-by: Mohammed Gamal <mgamal@redhat.com>
> >> > Fixes: e4ab4658f1cf ("clocksource/drivers/hyper-v: Handle vDSO differences inline")
> >> > Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> > [...]
> >> 
> >> Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> >> 
> > Applied to hyperv-fixes. Thanks.
> 
> It's already in the tip tree...

Okay. I will drop it. Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-15 19:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13  7:32 [PATCH v2] clocksource/drivers/hyper-v: Re-enable VDSO_CLOCKMODE_HVCLOCK on X86 Vitaly Kuznetsov
2021-05-13 13:29 ` Michael Kelley
2021-05-15 15:43   ` Wei Liu
2021-05-15 19:06     ` Thomas Gleixner
2021-05-15 19:32       ` Wei Liu
2021-05-14 12:59 ` [tip: timers/urgent] " tip-bot2 for Vitaly Kuznetsov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.