aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2018-05-25 17:42:09 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-06-07 16:22:12 -0400
commit4c5717da1d021cf368eabb3cb1adcaead56c0d1e (patch)
tree40e4abcc6dec6cca1cb8034cfdf0eaf4f67605c3
parentc7d606f560e4c698884697fef503e4abacdd8c25 (diff)
x86/mce: Check for alternate indication of machine check recovery on Skylake
Currently we just check the "CAPID0" register to see whether the CPU can recover from machine checks. But there are also some special SKUs which do not have all advanced RAS features, but do enable machine check recovery for use with NVDIMMs. Add a check for any of bits {8:5} in the "CAPID5" register (each reports some NVDIMM mode available, if any of them are set, then the system supports memory machine check recovery). Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Cc: Ashok Raj <ashok.raj@intel.com> Cc: stable@vger.kernel.org # 4.9 Cc: Dan Williams <dan.j.williams@intel.com> Cc: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/03cbed6e99ddafb51c2eadf9a3b7c8d7a0cc204e.1527283897.git.tony.luck@intel.com
-rw-r--r--arch/x86/kernel/quirks.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 697a4ce04308..736348ead421 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -645,12 +645,19 @@ static void quirk_intel_brickland_xeon_ras_cap(struct pci_dev *pdev)
645/* Skylake */ 645/* Skylake */
646static void quirk_intel_purley_xeon_ras_cap(struct pci_dev *pdev) 646static void quirk_intel_purley_xeon_ras_cap(struct pci_dev *pdev)
647{ 647{
648 u32 capid0; 648 u32 capid0, capid5;
649 649
650 pci_read_config_dword(pdev, 0x84, &capid0); 650 pci_read_config_dword(pdev, 0x84, &capid0);
651 pci_read_config_dword(pdev, 0x98, &capid5);
651 652
652 if ((capid0 & 0xc0) == 0xc0) 653 /*
654 * CAPID0{7:6} indicate whether this is an advanced RAS SKU
655 * CAPID5{8:5} indicate that various NVDIMM usage modes are
656 * enabled, so memory machine check recovery is also enabled.
657 */
658 if ((capid0 & 0xc0) == 0xc0 || (capid5 & 0x1e0))
653 static_branch_inc(&mcsafe_key); 659 static_branch_inc(&mcsafe_key);
660
654} 661}
655DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x0ec3, quirk_intel_brickland_xeon_ras_cap); 662DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x0ec3, quirk_intel_brickland_xeon_ras_cap);
656DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_ras_cap); 663DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_ras_cap);