linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Drake <drake@endlessm.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
	"Li, Aubrey" <aubrey.li@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Endless Linux Upstreaming Team <linux@endlessm.com>,
	Jiri Slaby <jslaby@suse.cz>
Subject: Re: [PATCH] x86/apic: Handle missing global clockevent gracefully
Date: Mon, 12 Aug 2019 14:16:02 +0800	[thread overview]
Message-ID: <CAD8Lp46FgT6yoW9a4Yt8t=bVWzZbYHjw-Dqdk6Pvd2xzxfGHLQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1908091443030.21433@nanos.tec.linutronix.de>

On Fri, Aug 9, 2019 at 8:54 PM Thomas Gleixner <tglx@linutronix.de> wrote:
> Some newer machines do not advertise legacy timers. The kernel can handle
> that situation if the TSC and the CPU frequency are enumerated by CPUID or
> MSRs and the CPU supports TSC deadline timer. If the CPU does not support
> TSC deadline timer the local APIC timer frequency has to be known as well.
>
> Some Ryzens machines do not advertize legacy timers, but there is no
> reliable way to determine the bus frequency which feeds the local APIC
> timer when the machine allows overclocking of that frequency.
>
> As there is no legacy timer the local APIC timer calibration crashes due to
> a NULL pointer dereference when accessing the not installed global clock
> event device.
>
> Switch the calibration loop to a non interrupt based one, which polls
> either TSC (frequency known) or jiffies. The latter requires a global
> clockevent. As the machines which do not have a global clockevent installed
> have a known TSC frequency this is a non issue. For older machines where
> TSC frequency is not known, there is no known case where the legacy timers
> do not exist as that would have been reported long ago.

This solves the problem I described in the thread:
    setup_boot_APIC_clock() NULL dereference during early boot on
reduced hardware platforms

Thanks for your quick support!

> Note: Only lightly tested, but of course not on an affected machine.
>
>       If that works reliably, then this needs some exhaustive testing
>       on a wide range of systems so we can risk backports to stable
>       kernels.

I can do a bit of testing on other platforms too. Are there any
specific tests I should run, other than checking that the system boots
and doesn't have any timer watchdog complaints in the log?

Thanks
Daniel

  parent reply	other threads:[~2019-08-12  6:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01  6:24 setup_boot_APIC_clock() NULL dereference during early boot on reduced hardware platforms Daniel Drake
2019-08-01  7:16 ` Aubrey Li
2019-08-01  7:35   ` Thomas Gleixner
2019-08-01  7:56     ` Aubrey Li
2019-08-01  8:13       ` Thomas Gleixner
2019-08-01  8:21         ` Li, Aubrey
2019-08-01 10:13           ` Thomas Gleixner
2019-08-01 15:44             ` Lendacky, Thomas
2019-08-08 20:36               ` Thomas Gleixner
2019-08-08 21:01                 ` Lendacky, Thomas
2019-08-08 21:08                   ` Thomas Gleixner
2019-08-08 21:36                     ` Lendacky, Thomas
2019-08-09 12:54                       ` [PATCH] x86/apic: Handle missing global clockevent gracefully Thomas Gleixner
2019-08-09 12:59                         ` Jiri Slaby
2019-08-09 13:58                         ` Lendacky, Thomas
2019-08-09 19:40                           ` Thomas Gleixner
2019-08-12  6:16                         ` Daniel Drake [this message]
2019-08-12  7:03                           ` Jiri Slaby
2019-08-15  5:02                           ` Daniel Drake
2019-08-12  7:46                         ` Li, Aubrey
2019-08-12 12:24                           ` Thomas Gleixner
2019-08-12 12:59                             ` Aubrey Li
2019-08-12 17:11                               ` Thomas Gleixner
2019-08-19 10:37                         ` [tip:x86/urgent] " tip-bot for Thomas Gleixner
2019-08-01  9:00   ` setup_boot_APIC_clock() NULL dereference during early boot on reduced hardware platforms Daniel Drake
2019-08-01 10:17     ` Thomas Gleixner
2019-08-01  7:27 ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD8Lp46FgT6yoW9a4Yt8t=bVWzZbYHjw-Dqdk6Pvd2xzxfGHLQ@mail.gmail.com' \
    --to=drake@endlessm.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=aubrey.li@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@endlessm.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --subject='Re: [PATCH] x86/apic: Handle missing global clockevent gracefully' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox