summaryrefslogtreecommitdiff
path: root/xen/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-10-20 12:50:15 +0200
committerJan Beulich <jbeulich@suse.com>2021-10-20 12:50:15 +0200
commitc12731493ae39640c4e44d9fe2029c3165f9f429 (patch)
treef393fbb11a3afa245207bf6f449d96607face867 /xen/include
parent6d187caae50284625af8799a79712c7a4c6a9a59 (diff)
x86/hpet: Use another crystalball to evaluate HPET usability
On recent Intel systems the HPET stops working when the system reaches PC10 idle state. The approach of adding PCI ids to the early quirks to disable HPET on these systems is a whack a mole game which makes no sense. Check for PC10 instead and force disable HPET if supported. The check is overbroad as it does not take ACPI, mwait-idle enablement and command line parameters into account. That's fine as long as there is at least PMTIMER available to calibrate the TSC frequency. The decision can be overruled by adding "clocksource=hpet" on the Xen command line. Remove the related PCI quirks for affected Coffee Lake systems as they are not longer required. That should also cover all other systems, i.e. Ice Lake, Tiger Lake, and newer generations, which are most likely affected by this as well. Fixes: Yet another hardware trainwreck Reported-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> [Linux commit: 6e3cd95234dc1eda488f4f487c281bac8fef4d9b] I have to admit that the purpose of checking CPUID5_ECX_INTERRUPT_BREAK is unclear to me, but I didn't want to diverge in technical aspects from the Linux commit. In mwait_pc10_supported(), besides some cosmetic adjustments, avoid UB from shifting left a signed 4-bit constant by 28 bits. Pull in Linux'es MSR_PKG_CST_CONFIG_CONTROL. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Diffstat (limited to 'xen/include')
-rw-r--r--xen/include/asm-x86/msr-index.h12
-rw-r--r--xen/include/asm-x86/mwait.h3
2 files changed, 10 insertions, 5 deletions
diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h
index 90c0589cd6..ab68ef2681 100644
--- a/xen/include/asm-x86/msr-index.h
+++ b/xen/include/asm-x86/msr-index.h
@@ -46,6 +46,13 @@
#define MSR_CORE_CAPABILITIES 0x000000cf
#define CORE_CAPS_SPLITLOCK_DETECT (_AC(1, ULL) << 5)
+#define MSR_PKG_CST_CONFIG_CONTROL 0x000000e2
+#define NHM_C3_AUTO_DEMOTE (_AC(1, ULL) << 25)
+#define NHM_C1_AUTO_DEMOTE (_AC(1, ULL) << 26)
+#define ATM_LNC_C6_AUTO_DEMOTE (_AC(1, ULL) << 25)
+#define SNB_C3_AUTO_UNDEMOTE (_AC(1, ULL) << 27)
+#define SNB_C1_AUTO_UNDEMOTE (_AC(1, ULL) << 28)
+
#define MSR_ARCH_CAPABILITIES 0x0000010a
#define ARCH_CAPS_RDCL_NO (_AC(1, ULL) << 0)
#define ARCH_CAPS_IBRS_ALL (_AC(1, ULL) << 1)
@@ -179,11 +186,6 @@
#define MSR_IA32_A_PERFCTR0 0x000004c1
#define MSR_FSB_FREQ 0x000000cd
-#define MSR_NHM_SNB_PKG_CST_CFG_CTL 0x000000e2
-#define NHM_C3_AUTO_DEMOTE (1UL << 25)
-#define NHM_C1_AUTO_DEMOTE (1UL << 26)
-#define ATM_LNC_C6_AUTO_DEMOTE (1UL << 25)
-
#define MSR_MTRRcap 0x000000fe
#define MTRRcap_VCNT 0x000000ff
diff --git a/xen/include/asm-x86/mwait.h b/xen/include/asm-x86/mwait.h
index ba9c0ea096..f377d9fdca 100644
--- a/xen/include/asm-x86/mwait.h
+++ b/xen/include/asm-x86/mwait.h
@@ -1,6 +1,8 @@
#ifndef __ASM_X86_MWAIT_H__
#define __ASM_X86_MWAIT_H__
+#include <xen/types.h>
+
#define MWAIT_SUBSTATE_MASK 0xf
#define MWAIT_CSTATE_MASK 0xf
#define MWAIT_SUBSTATE_SIZE 4
@@ -12,5 +14,6 @@
#define MWAIT_ECX_INTERRUPT_BREAK 0x1
void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
+bool mwait_pc10_supported(void);
#endif /* __ASM_X86_MWAIT_H__ */