x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 Mar 2021 14:27:22 +0000 (15:27 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 5 Mar 2021 14:27:22 +0000 (15:27 +0100)
commitf6f787de989655747795e216a7ca5d16e8cd7609
tree11104edb4c99f63103d87185073cf632ecc7d778
parenta473bdd81bc109b104a451c71f9402150796a1ff
x86/timer: Fix boot on Intel systems using ITSSPRC static PIT clock gating

Recent Intel client devices have disabled the legacy PIT for powersaving
reasons, breaking compatibility with a traditional IBM PC.  Xen depends on a
legacy timer interrupt to check that the IO-APIC/PIC routing is configured
correctly, and fails to boot with:

  (XEN) *******************************
  (XEN) Panic on CPU 0:
  (XEN) IO-APIC + timer doesn't work!  Boot with apic_verbosity=debug and send report.  Then try booting with the `noapic` option
  (XEN) *******************************

While this setting can be undone by Xen, the details of how to differ by
chipset, and would be very short sighted for battery based devices.  See bit 2
"8254 Static Clock Gating Enable" in:

  https://edc.intel.com/content/www/us/en/design/products-and-solutions/processors-and-chipsets/comet-lake-u/intel-400-series-chipset-on-package-platform-controller-hub-register-database/itss-power-reduction-control-itssprc-offset-3300/

All impacted systems have an HPET, but there is no indication of the absence
of PIT functionality, nor a suitable way to probe for its absence.  As a short
term fix, reconfigure the HPET into legacy replacement mode.  A better
longterm fix would be to avoid the reliance on the timer interrupt entirely.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
master commit: e1de4c196a2eb4fd5063c30a2e115adf144bdeef
master date: 2021-01-27 19:15:19 +0000
xen/arch/x86/hpet.c