timer fixes
Linus,
Please pull the latest timers-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-for-linus
# HEAD: e0748539e3d594dd26f0d27a270f14720b22a406 x86/intel: Disable HPET on Intel Ice Lake platforms
Add HPET quirks for the Intel "Coffee Lake H" and "Ice Lake" platforms.
Thanks,
Ingo
------------------>
Kai-Heng Feng (2):
x86/intel: Disable HPET on Intel Coffee Lake H platforms x86/intel: Disable HPET on Intel Ice Lake platforms
arch/x86/kernel/early-quirks.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/x86/kernel/early-quirks.c +4 -0
@@ -710,8 +710,12 @@ static struct chipset early_qrk[] __initdata = {*/ {PCI_VENDOR_ID_INTEL ,0x0f00 , PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, force_disable_hpet}, + { PCI_VENDOR_ID_INTEL, 0x3e20, + PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, force_disable_hpet}, { PCI_VENDOR_ID_INTEL, 0x3ec4, PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, force_disable_hpet}, + { PCI_VENDOR_ID_INTEL, 0x8a12, + PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, force_disable_hpet}, { PCI_VENDOR_ID_BROADCOM, 0x4331, PCI_CLASS_NETWORK_OTHER, PCI_ANY_ID, 0, apple_airport_reset}, {}
Quoted 2 lines · Ingo Molnar
Add HPET quirks for the Intel "Coffee Lake H" and "Ice Lake" platforms.
Is there any reason we don't force-disable HPET by default if there are alternatives?
I think that's what Microsoft did, which is why it's so broken on so many platforms - it's often simply not used.
Linus
Quoted 6 lines · Linus Torvalds
Quoted 2 lines · Ingo Molnar
Add HPET quirks for the Intel "Coffee Lake H" and "Ice Lake" platforms.
Is there any reason we don't force-disable HPET by default if there are alternatives?
What alternatives are there? That is, we normally only use HPET to double check nobody messed up the TSC.
Now it (fingers crossed) seems to be getting better in that more recent firmware is less likely to wreck TSC, but we're still running this on plenty of old machines where TSC really isn't all that sane.
We can't just blindly trust TSC across everything x86.
Quoted 3 lines · Peter Zijlstra
What alternatives are there? That is, we normally only use HPET to double check nobody messed up the TSC.
The thing is HPET seems to be _less_ reliable than the TSC we're checking these days.
If that's the only use-case for HPET, we should just stop doing it.
Quoted 1 line
We can't just blindly trust TSC across everything x86.
No, but we can trust it when it's a modern CPU.
The HPET seems to get disabled on all the modern platforms, why do we even have it enabled by default?
We should do the HPET cross-check only when we know the TSC might be unreliable, I suspect.
Linus
Quoted 5 lines · Linus Torvalds
Quoted 3 lines · Peter Zijlstra
What alternatives are there? That is, we normally only use HPET to double check nobody messed up the TSC.
Quoted 8 lines
The thing is HPET seems to be _less_ reliable than the TSC we're checking these days.
If that's the only use-case for HPET, we should just stop doing it.
Quoted 1 line
We can't just blindly trust TSC across everything x86.
No, but we can trust it when it's a modern CPU.
Pray.. the TSC MSR is still writable from SMM, so BIOS monkeys could still do what they've been doing for decades. Which is try and 'hide' SMM latency by taking the TSC timestamp on SMM entry and writing the timestamp back into the TSC MSR on exit.
Yes, ever since TSC_ADJUST we can better recover from it, but we still need to first detect it went sideways and by then time has been observed buggered and any recovery is basically too late :/
Granted, this is happening less (at least, I really do hope so).
Also, what consititutes a 'modern' CPU?
Quoted 2 lines
The HPET seems to get disabled on all the modern platforms, why do we even have it enabled by default?
These new ones yeah, cuz they wrecked HPET in PC10 :/
Quoted 2 lines
We should do the HPET cross-check only when we know the TSC might be unreliable, I suspect.
But how do we know? Ever since Nehalem TSC has basically been good hardware wise -- there's a few exception on large (>4) socket machines, but nobody has those anyway.
It has always been the BIOS messing it up. Now, the reason I think it has gotten better is because Windows is now also relying on TSC (like we've been doing forever).
Maybe I'm too scarred by too much TSC wreckage over the years...
Quoted 3 lines · Peter Zijlstra
Pray.. the TSC MSR is still writable from SMM, so BIOS monkeys could still do what they've been doing for decades.
Sure. And the HPET is unreliable, so the checking causes issues.
Which one should we worry about?
Quoted 1 line
Also, what consititutes a 'modern' CPU?
I think anything that has TSC_STABLE set should likely be considered more reliable than HPET.
Or whatever the bit is called. The "doesn't stop in idle" thing.
Quoted 4 lines
Quoted 2 lines
The HPET seems to get disabled on all the modern platforms, why do we even have it enabled by default?
These new ones yeah, cuz they wrecked HPET in PC10 :/
That's my point. HPET isn't _used_ by Windows, so it gets no testing, so it will continue to have bugs.
At least the TSC is used.
I do agree about the whole SMM issue, but it seems less of a pain than the HPET issue.
Linus
Quoted 8 lines · Linus Torvalds
Quoted 3 lines · Peter Zijlstra
Pray.. the TSC MSR is still writable from SMM, so BIOS monkeys could still do what they've been doing for decades.
Sure. And the HPET is unreliable, so the checking causes issues.
Which one should we worry about?
I'm just waiting for the system that messes up the TSC and doesn't have HPET/PIT _at_all_ :-/
But yes, I get your point.
Quoted 6 lines
Quoted 1 line
Also, what consititutes a 'modern' CPU?
I think anything that has
TSC_STABLEset should likely be considered more reliable than HPET.Or whatever the bit is called. The "doesn't stop in idle" thing.
The doesn't stop on idle thing is CONSTANT_TSC, and that has been set since Nehalem, and there are a metric ton of systems still failing due to the described SMM 'feature'.
Perhaps we can go with TSC_KNOWN_FREQ, which relies on CPUID.15h to tell us the actual TSC frequency, but I'm not sure all modern systems actually fill out that leaf :/
The systems that completely got rid of the HPET/PIT pretty much must fill that out, otherwise there's just no way we can recover the TSC frequency.
I'm going to have to wait for Thomas to chime in though; I only occasionally poke at this stuff ;-)
The pull request you sent on Tue, 17 Dec 2019 12:55:47 +0100:
The pull request you sent on Tue, 17 Dec 2019 12:55:47 +0100:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gittimers-urgent-for-linus
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/2abf193275768ac89f5d93eec7bcacb238168151
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.wiki.kernel.org/userdoc/prtracker