Linux-HyperV Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] x86/Hyper-V: Fix build error with CONFIG_HYPERV_TSCPAGE=N
@ 2019-08-22  5:38 lantianyu1986
  2019-08-22  8:39 ` Vitaly Kuznetsov
  0 siblings, 1 reply; 7+ messages in thread
From: lantianyu1986 @ 2019-08-22  5:38 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin, sashal, tglx, mingo, bp, hpa, x86,
	daniel.lezcano, michael.h.kelley
  Cc: Tianyu Lan, linux-hyperv, linux-kernel

From: Tianyu Lan <Tianyu.Lan@microsoft.com>

Both Hyper-V tsc page and Hyper-V tsc MSR code use variable
hv_sched_clock_offset for their sched clock callback and so
define the variable regardless of CONFIG_HYPERV_TSCPAGE setting.

Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
---
This patch is based on the top of "git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
timers/core".

 drivers/clocksource/hyperv_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index dad8af198e20..c322ab4d3689 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -22,6 +22,7 @@
 #include <asm/mshyperv.h>
 
 static struct clock_event_device __percpu *hv_clock_event;
+static u64 hv_sched_clock_offset __ro_after_init;
 
 /*
  * If false, we're using the old mechanism for stimer0 interrupts
@@ -215,7 +216,6 @@ EXPORT_SYMBOL_GPL(hyperv_cs);
 #ifdef CONFIG_HYPERV_TSCPAGE
 
 static struct ms_hyperv_tsc_page tsc_pg __aligned(PAGE_SIZE);
-static u64 hv_sched_clock_offset __ro_after_init;
 
 struct ms_hyperv_tsc_page *hv_get_tsc_page(void)
 {
-- 
2.14.5


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

* Re: [PATCH] x86/Hyper-V: Fix build error with CONFIG_HYPERV_TSCPAGE=N
  2019-08-22  5:38 [PATCH] x86/Hyper-V: Fix build error with CONFIG_HYPERV_TSCPAGE=N lantianyu1986
@ 2019-08-22  8:39 ` Vitaly Kuznetsov
  2019-08-22  9:14   ` Tianyu Lan
  2019-08-24 15:12   ` Sasha Levin
  0 siblings, 2 replies; 7+ messages in thread
From: Vitaly Kuznetsov @ 2019-08-22  8:39 UTC (permalink / raw)
  To: lantianyu1986
  Cc: Tianyu Lan, linux-hyperv, linux-kernel, kys, haiyangz, sthemmin,
	sashal, tglx, mingo, bp, hpa, x86, daniel.lezcano,
	michael.h.kelley

lantianyu1986@gmail.com writes:

> From: Tianyu Lan <Tianyu.Lan@microsoft.com>
>
> Both Hyper-V tsc page and Hyper-V tsc MSR code use variable
> hv_sched_clock_offset for their sched clock callback and so
> define the variable regardless of CONFIG_HYPERV_TSCPAGE setting.

CONFIG_HYPERV_TSCPAGE is gone after my "x86/hyper-v: enable TSC page
clocksource on 32bit" patch. Do we still have an issue to fix?

>
> Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
> ---
> This patch is based on the top of "git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
> timers/core".
>
>  drivers/clocksource/hyperv_timer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
> index dad8af198e20..c322ab4d3689 100644
> --- a/drivers/clocksource/hyperv_timer.c
> +++ b/drivers/clocksource/hyperv_timer.c
> @@ -22,6 +22,7 @@
>  #include <asm/mshyperv.h>
>  
>  static struct clock_event_device __percpu *hv_clock_event;
> +static u64 hv_sched_clock_offset __ro_after_init;
>  
>  /*
>   * If false, we're using the old mechanism for stimer0 interrupts
> @@ -215,7 +216,6 @@ EXPORT_SYMBOL_GPL(hyperv_cs);
>  #ifdef CONFIG_HYPERV_TSCPAGE
>  
>  static struct ms_hyperv_tsc_page tsc_pg __aligned(PAGE_SIZE);
> -static u64 hv_sched_clock_offset __ro_after_init;
>  
>  struct ms_hyperv_tsc_page *hv_get_tsc_page(void)
>  {

-- 
Vitaly

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

* Re: [PATCH] x86/Hyper-V: Fix build error with CONFIG_HYPERV_TSCPAGE=N
  2019-08-22  8:39 ` Vitaly Kuznetsov
@ 2019-08-22  9:14   ` Tianyu Lan
  2019-08-24 15:12   ` Sasha Levin
  1 sibling, 0 replies; 7+ messages in thread
From: Tianyu Lan @ 2019-08-22  9:14 UTC (permalink / raw)
  To: Vitaly Kuznetsov
  Cc: Tianyu Lan, linux-hyperv, linux-kernel@vger kernel org,
	KY Srinivasan, Haiyang Zhang, Stephen Hemminger, Sasha Levin,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
	the arch/x86 maintainers, Daniel Lezcano, michael.h.kelley

On Thu, Aug 22, 2019 at 4:39 PM Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>
> lantianyu1986@gmail.com writes:
>
> > From: Tianyu Lan <Tianyu.Lan@microsoft.com>
> >
> > Both Hyper-V tsc page and Hyper-V tsc MSR code use variable
> > hv_sched_clock_offset for their sched clock callback and so
> > define the variable regardless of CONFIG_HYPERV_TSCPAGE setting.
>
> CONFIG_HYPERV_TSCPAGE is gone after my "x86/hyper-v: enable TSC page
> clocksource on 32bit" patch. Do we still have an issue to fix?
>
Hi Vtialy:
             Your patch also fixs the build issue. If it's not
necessary to have a dedicated patch
to fix the issue, please ignore it. Thanks.

> >
> > Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
> > ---
> > This patch is based on the top of "git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
> > timers/core".
> >
> >  drivers/clocksource/hyperv_timer.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
> > index dad8af198e20..c322ab4d3689 100644
> > --- a/drivers/clocksource/hyperv_timer.c
> > +++ b/drivers/clocksource/hyperv_timer.c
> > @@ -22,6 +22,7 @@
> >  #include <asm/mshyperv.h>
> >
> >  static struct clock_event_device __percpu *hv_clock_event;
> > +static u64 hv_sched_clock_offset __ro_after_init;
> >
> >  /*
> >   * If false, we're using the old mechanism for stimer0 interrupts
> > @@ -215,7 +216,6 @@ EXPORT_SYMBOL_GPL(hyperv_cs);
> >  #ifdef CONFIG_HYPERV_TSCPAGE
> >
> >  static struct ms_hyperv_tsc_page tsc_pg __aligned(PAGE_SIZE);
> > -static u64 hv_sched_clock_offset __ro_after_init;
> >
> >  struct ms_hyperv_tsc_page *hv_get_tsc_page(void)
> >  {
>
> --
> Vitaly



-- 
Best regards
Tianyu Lan

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

* Re: [PATCH] x86/Hyper-V: Fix build error with CONFIG_HYPERV_TSCPAGE=N
  2019-08-22  8:39 ` Vitaly Kuznetsov
  2019-08-22  9:14   ` Tianyu Lan
@ 2019-08-24 15:12   ` Sasha Levin
  2019-08-26  3:31     ` Tianyu Lan
  2019-08-26  7:20     ` Vitaly Kuznetsov
  1 sibling, 2 replies; 7+ messages in thread
From: Sasha Levin @ 2019-08-24 15:12 UTC (permalink / raw)
  To: Vitaly Kuznetsov
  Cc: lantianyu1986, Tianyu Lan, linux-hyperv, linux-kernel, kys,
	haiyangz, sthemmin, tglx, mingo, bp, hpa, x86, daniel.lezcano,
	michael.h.kelley

On Thu, Aug 22, 2019 at 10:39:46AM +0200, Vitaly Kuznetsov wrote:
>lantianyu1986@gmail.com writes:
>
>> From: Tianyu Lan <Tianyu.Lan@microsoft.com>
>>
>> Both Hyper-V tsc page and Hyper-V tsc MSR code use variable
>> hv_sched_clock_offset for their sched clock callback and so
>> define the variable regardless of CONFIG_HYPERV_TSCPAGE setting.
>
>CONFIG_HYPERV_TSCPAGE is gone after my "x86/hyper-v: enable TSC page
>clocksource on 32bit" patch. Do we still have an issue to fix?

Yes. Let's get it fixed on older kernels (as such we need to tag this
one for stable). The 32bit TSC patch won't come in before 5.4 anyway.

Vitaly, does can you ack this patch? It might require you to re-spin
your patch.

--
Thanks,
Sasha

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

* Re: [PATCH] x86/Hyper-V: Fix build error with CONFIG_HYPERV_TSCPAGE=N
  2019-08-24 15:12   ` Sasha Levin
@ 2019-08-26  3:31     ` Tianyu Lan
  2019-08-26  7:20     ` Vitaly Kuznetsov
  1 sibling, 0 replies; 7+ messages in thread
From: Tianyu Lan @ 2019-08-26  3:31 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Vitaly Kuznetsov, Tianyu Lan, linux-hyperv,
	linux-kernel@vger kernel org, KY Srinivasan, Haiyang Zhang,
	Stephen Hemminger, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	H. Peter Anvin, the arch/x86 maintainers, Daniel Lezcano,
	michael.h.kelley

On Sun, Aug 25, 2019 at 1:52 AM Sasha Levin <sashal@kernel.org> wrote:
>
> On Thu, Aug 22, 2019 at 10:39:46AM +0200, Vitaly Kuznetsov wrote:
> >lantianyu1986@gmail.com writes:
> >
> >> From: Tianyu Lan <Tianyu.Lan@microsoft.com>
> >>
> >> Both Hyper-V tsc page and Hyper-V tsc MSR code use variable
> >> hv_sched_clock_offset for their sched clock callback and so
> >> define the variable regardless of CONFIG_HYPERV_TSCPAGE setting.
> >
> >CONFIG_HYPERV_TSCPAGE is gone after my "x86/hyper-v: enable TSC page
> >clocksource on 32bit" patch. Do we still have an issue to fix?
>
> Yes. Let's get it fixed on older kernels (as such we need to tag this
> one for stable). The 32bit TSC patch won't come in before 5.4 anyway.
>
> Vitaly, does can you ack this patch? It might require you to re-spin
> your patch.
>
Hi Sasha:
               Thomas has foled this fix into original patch.
https://lkml.org/lkml/2019/8/23/600
--
Best regards
Tianyu Lan

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

* Re: [PATCH] x86/Hyper-V: Fix build error with CONFIG_HYPERV_TSCPAGE=N
  2019-08-24 15:12   ` Sasha Levin
  2019-08-26  3:31     ` Tianyu Lan
@ 2019-08-26  7:20     ` Vitaly Kuznetsov
  2019-08-26 11:55       ` Thomas Gleixner
  1 sibling, 1 reply; 7+ messages in thread
From: Vitaly Kuznetsov @ 2019-08-26  7:20 UTC (permalink / raw)
  To: Sasha Levin
  Cc: lantianyu1986, Tianyu Lan, linux-hyperv, linux-kernel, kys,
	haiyangz, sthemmin, mingo, bp, hpa, x86, daniel.lezcano,
	michael.h.kelley, tglx

Sasha Levin <sashal@kernel.org> writes:

> On Thu, Aug 22, 2019 at 10:39:46AM +0200, Vitaly Kuznetsov wrote:
>>lantianyu1986@gmail.com writes:
>>
>>> From: Tianyu Lan <Tianyu.Lan@microsoft.com>
>>>
>>> Both Hyper-V tsc page and Hyper-V tsc MSR code use variable
>>> hv_sched_clock_offset for their sched clock callback and so
>>> define the variable regardless of CONFIG_HYPERV_TSCPAGE setting.
>>
>>CONFIG_HYPERV_TSCPAGE is gone after my "x86/hyper-v: enable TSC page
>>clocksource on 32bit" patch. Do we still have an issue to fix?
>
> Yes. Let's get it fixed on older kernels (as such we need to tag this
> one for stable). The 32bit TSC patch won't come in before 5.4 anyway.
>
> Vitaly, does can you ack this patch? It might require you to re-spin
> your patch.
>

Sure, no problem,

Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>

I, however, was under the impression the patch fixes the issue with the
newly introduced sched clock:

commit b74e1d61dbc614ff35ef3ad9267c61ed06b09051
Author: Tianyu Lan <Tianyu.Lan@microsoft.com>
Date:   Wed Aug 14 20:32:16 2019 +0800

    clocksource/hyperv: Add Hyper-V specific sched clock function

(and Fixes: tag is missing)

and this is not in mainline as of v5.3-rc6. In tip/timers/core Thomas
already picked my "clocksource/drivers/hyperv: Enable TSC page
clocksource on 32bit" which also resolves the issue.

So my question is - which older/stable kernel do you have in mind?

-- 
Vitaly

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

* Re: [PATCH] x86/Hyper-V: Fix build error with CONFIG_HYPERV_TSCPAGE=N
  2019-08-26  7:20     ` Vitaly Kuznetsov
@ 2019-08-26 11:55       ` Thomas Gleixner
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Gleixner @ 2019-08-26 11:55 UTC (permalink / raw)
  To: Vitaly Kuznetsov
  Cc: Sasha Levin, lantianyu1986, Tianyu Lan, linux-hyperv,
	linux-kernel, kys, haiyangz, sthemmin, mingo, bp, hpa, x86,
	daniel.lezcano, michael.h.kelley

On Mon, 26 Aug 2019, Vitaly Kuznetsov wrote:
> Sasha Levin <sashal@kernel.org> writes:
> 
> > On Thu, Aug 22, 2019 at 10:39:46AM +0200, Vitaly Kuznetsov wrote:
> >>lantianyu1986@gmail.com writes:
> >>
> >>> From: Tianyu Lan <Tianyu.Lan@microsoft.com>
> >>>
> >>> Both Hyper-V tsc page and Hyper-V tsc MSR code use variable
> >>> hv_sched_clock_offset for their sched clock callback and so
> >>> define the variable regardless of CONFIG_HYPERV_TSCPAGE setting.
> >>
> >>CONFIG_HYPERV_TSCPAGE is gone after my "x86/hyper-v: enable TSC page
> >>clocksource on 32bit" patch. Do we still have an issue to fix?
> >
> > Yes. Let's get it fixed on older kernels (as such we need to tag this
> > one for stable). The 32bit TSC patch won't come in before 5.4 anyway.
> >
> > Vitaly, does can you ack this patch? It might require you to re-spin
> > your patch.
> >
> 
> Sure, no problem,
> 
> Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> 
> I, however, was under the impression the patch fixes the issue with the
> newly introduced sched clock:
> 
> commit b74e1d61dbc614ff35ef3ad9267c61ed06b09051
> Author: Tianyu Lan <Tianyu.Lan@microsoft.com>
> Date:   Wed Aug 14 20:32:16 2019 +0800
> 
>     clocksource/hyperv: Add Hyper-V specific sched clock function
> 
> (and Fixes: tag is missing)
> 
> and this is not in mainline as of v5.3-rc6. In tip/timers/core Thomas
> already picked my "clocksource/drivers/hyperv: Enable TSC page
> clocksource on 32bit" which also resolves the issue.

No. I folded Sashas fix into the original clocksource patch and then added
yours on top.

Thanks,

	tglx

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22  5:38 [PATCH] x86/Hyper-V: Fix build error with CONFIG_HYPERV_TSCPAGE=N lantianyu1986
2019-08-22  8:39 ` Vitaly Kuznetsov
2019-08-22  9:14   ` Tianyu Lan
2019-08-24 15:12   ` Sasha Levin
2019-08-26  3:31     ` Tianyu Lan
2019-08-26  7:20     ` Vitaly Kuznetsov
2019-08-26 11:55       ` Thomas Gleixner

Linux-HyperV Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hyperv/0 linux-hyperv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hyperv linux-hyperv/ https://lore.kernel.org/linux-hyperv \
		linux-hyperv@vger.kernel.org linux-hyperv@archiver.kernel.org
	public-inbox-index linux-hyperv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hyperv


AGPL code for this site: git clone https://public-inbox.org/ public-inbox