All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] i8253: Fix PIT shutdown quirk on Hyper-V
@ 2018-11-01 17:30 Michael Kelley
  2018-11-02  7:40   ` Juergen Gross
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Kelley @ 2018-11-01 17:30 UTC (permalink / raw)
  To: virtualization, linux-kernel, tglx, daniel.lezcano, jgross,
	akataria, olaf, apw, vkuznets, jasowang, marcelo.cerri,
	KY Srinivasan
  Cc: Michael Kelley

pit_shutdown() doesn't work on Hyper-V because of a quirk in the
PIT emulation. This problem exists in all versions of Hyper-V and
had not been noticed previously. When the counter register is set
to zero, the emulated PIT continues to interrupt @18.2 HZ.

So add a test for running on Hyper-V, and use that test to skip
setting the counter register when running on Hyper-V.

This patch replaces a previously proposed patch with a different
approach. This new approach follows comments from Thomas Gleixner.

Michael Kelley (2):
  include/linux/hypervisor.h: Add test for running on Hyper-V
  i8253: Fix PIT shutdown quirk on Hyper-V

 drivers/clocksource/i8253.c | 14 ++++++++++++--
 include/linux/hypervisor.h  | 11 +++++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)

-- 
1.8.3.1


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

* Re: [PATCH 0/2] i8253: Fix PIT shutdown quirk on Hyper-V
  2018-11-01 17:30 [PATCH 0/2] i8253: Fix PIT shutdown quirk on Hyper-V Michael Kelley
@ 2018-11-02  7:40   ` Juergen Gross
  0 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2018-11-02  7:40 UTC (permalink / raw)
  To: Michael Kelley, virtualization, linux-kernel, tglx,
	daniel.lezcano, akataria, olaf, apw, vkuznets, jasowang,
	marcelo.cerri, KY Srinivasan

On 01/11/2018 18:30, Michael Kelley wrote:
> pit_shutdown() doesn't work on Hyper-V because of a quirk in the
> PIT emulation. This problem exists in all versions of Hyper-V and
> had not been noticed previously. When the counter register is set
> to zero, the emulated PIT continues to interrupt @18.2 HZ.
> 
> So add a test for running on Hyper-V, and use that test to skip
> setting the counter register when running on Hyper-V.
> 
> This patch replaces a previously proposed patch with a different
> approach. This new approach follows comments from Thomas Gleixner.

Did you consider using a static_key instead? You could set it in
ms_hyperv_init_platform(). This would enable you to support future
Hyper-V versions which don't require avoiding to set the count to zero.


Juergen


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

* Re: [PATCH 0/2] i8253: Fix PIT shutdown quirk on Hyper-V
@ 2018-11-02  7:40   ` Juergen Gross
  0 siblings, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2018-11-02  7:40 UTC (permalink / raw)
  To: Michael Kelley, virtualization, linux-kernel, tglx,
	daniel.lezcano, akataria, olaf, apw, vkuznets, jasowang,
	marcelo.cerri, KY Srinivasan

On 01/11/2018 18:30, Michael Kelley wrote:
> pit_shutdown() doesn't work on Hyper-V because of a quirk in the
> PIT emulation. This problem exists in all versions of Hyper-V and
> had not been noticed previously. When the counter register is set
> to zero, the emulated PIT continues to interrupt @18.2 HZ.
> 
> So add a test for running on Hyper-V, and use that test to skip
> setting the counter register when running on Hyper-V.
> 
> This patch replaces a previously proposed patch with a different
> approach. This new approach follows comments from Thomas Gleixner.

Did you consider using a static_key instead? You could set it in
ms_hyperv_init_platform(). This would enable you to support future
Hyper-V versions which don't require avoiding to set the count to zero.


Juergen

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

* Re: [PATCH 0/2] i8253: Fix PIT shutdown quirk on Hyper-V
  2018-11-02  7:40   ` Juergen Gross
@ 2018-11-03 17:22     ` Thomas Gleixner
  -1 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2018-11-03 17:22 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Michael Kelley, virtualization, linux-kernel, daniel.lezcano,
	akataria, olaf, apw, vkuznets, jasowang, marcelo.cerri,
	KY Srinivasan

On Fri, 2 Nov 2018, Juergen Gross wrote:
> On 01/11/2018 18:30, Michael Kelley wrote:
> > pit_shutdown() doesn't work on Hyper-V because of a quirk in the
> > PIT emulation. This problem exists in all versions of Hyper-V and
> > had not been noticed previously. When the counter register is set
> > to zero, the emulated PIT continues to interrupt @18.2 HZ.
> > 
> > So add a test for running on Hyper-V, and use that test to skip
> > setting the counter register when running on Hyper-V.
> > 
> > This patch replaces a previously proposed patch with a different
> > approach. This new approach follows comments from Thomas Gleixner.
> 
> Did you consider using a static_key instead? You could set it in
> ms_hyperv_init_platform(). This would enable you to support future
> Hyper-V versions which don't require avoiding to set the count to zero.

Duh. Now that you say it it's more than obvious. Instead of checking for
running on hyperv have a quirk check in that function and set it from
hyperv. Not necessarily a static key required as this is not a fast path,
so a simple ro_after_init marked variable is good enough

Michael, sorry for guiding you down the wrong road. Juergens idea is much
better.

If you redo that, could you please make sure, that your mail series is
properly threaded? i.e. the 1..n/n mails contain a

	 Reference: <message_id_of_0/n>

Thanks,

	tglx



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

* Re: [PATCH 0/2] i8253: Fix PIT shutdown quirk on Hyper-V
@ 2018-11-03 17:22     ` Thomas Gleixner
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2018-11-03 17:22 UTC (permalink / raw)
  To: Juergen Gross
  Cc: olaf, daniel.lezcano, linux-kernel, virtualization,
	marcelo.cerri, apw, akataria, Michael Kelley

On Fri, 2 Nov 2018, Juergen Gross wrote:
> On 01/11/2018 18:30, Michael Kelley wrote:
> > pit_shutdown() doesn't work on Hyper-V because of a quirk in the
> > PIT emulation. This problem exists in all versions of Hyper-V and
> > had not been noticed previously. When the counter register is set
> > to zero, the emulated PIT continues to interrupt @18.2 HZ.
> > 
> > So add a test for running on Hyper-V, and use that test to skip
> > setting the counter register when running on Hyper-V.
> > 
> > This patch replaces a previously proposed patch with a different
> > approach. This new approach follows comments from Thomas Gleixner.
> 
> Did you consider using a static_key instead? You could set it in
> ms_hyperv_init_platform(). This would enable you to support future
> Hyper-V versions which don't require avoiding to set the count to zero.

Duh. Now that you say it it's more than obvious. Instead of checking for
running on hyperv have a quirk check in that function and set it from
hyperv. Not necessarily a static key required as this is not a fast path,
so a simple ro_after_init marked variable is good enough

Michael, sorry for guiding you down the wrong road. Juergens idea is much
better.

If you redo that, could you please make sure, that your mail series is
properly threaded? i.e. the 1..n/n mails contain a

	 Reference: <message_id_of_0/n>

Thanks,

	tglx

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

* RE: [PATCH 0/2] i8253: Fix PIT shutdown quirk on Hyper-V
  2018-11-03 17:22     ` Thomas Gleixner
  (?)
@ 2018-11-04  3:39     ` Michael Kelley
  -1 siblings, 0 replies; 6+ messages in thread
From: Michael Kelley @ 2018-11-04  3:39 UTC (permalink / raw)
  To: Thomas Gleixner, Juergen Gross
  Cc: virtualization, linux-kernel, daniel.lezcano, akataria, olaf,
	apw, vkuznets, jasowang, marcelo.cerri, KY Srinivasan

From: Thomas Gleixner <tglx@linutronix.de>  Sent: Saturday, November 3, 2018 10:22 AM
>
> > Did you consider using a static_key instead? You could set it in
> > ms_hyperv_init_platform(). This would enable you to support future
> > Hyper-V versions which don't require avoiding to set the count to zero.
> 
> Duh. Now that you say it it's more than obvious. Instead of checking for
> running on hyperv have a quirk check in that function and set it from
> hyperv. Not necessarily a static key required as this is not a fast path,
> so a simple ro_after_init marked variable is good enough
> 
> Michael, sorry for guiding you down the wrong road. Juergens idea is much
> better.

Thanks.  Will send a new patch set shortly.

> 
> If you redo that, could you please make sure, that your mail series is
> properly threaded? i.e. the 1..n/n mails contain a
> 
> 	 Reference: <message_id_of_0/n>
> 
Argh.  Caused by a one-time foul up.  I'll make sure not to do that again.

Michael


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

end of thread, other threads:[~2018-11-04  3:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01 17:30 [PATCH 0/2] i8253: Fix PIT shutdown quirk on Hyper-V Michael Kelley
2018-11-02  7:40 ` Juergen Gross
2018-11-02  7:40   ` Juergen Gross
2018-11-03 17:22   ` Thomas Gleixner
2018-11-03 17:22     ` Thomas Gleixner
2018-11-04  3:39     ` Michael Kelley

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.