]>
Commit | Line | Data |
---|---|---|
3686fc90 GKH |
1 | From 4c5717da1d021cf368eabb3cb1adcaead56c0d1e Mon Sep 17 00:00:00 2001 |
2 | From: Tony Luck <tony.luck@intel.com> | |
3 | Date: Fri, 25 May 2018 14:42:09 -0700 | |
4 | Subject: x86/mce: Check for alternate indication of machine check recovery on Skylake | |
5 | ||
6 | From: Tony Luck <tony.luck@intel.com> | |
7 | ||
8 | commit 4c5717da1d021cf368eabb3cb1adcaead56c0d1e upstream. | |
9 | ||
10 | Currently we just check the "CAPID0" register to see whether the CPU | |
11 | can recover from machine checks. | |
12 | ||
13 | But there are also some special SKUs which do not have all advanced | |
14 | RAS features, but do enable machine check recovery for use with NVDIMMs. | |
15 | ||
16 | Add a check for any of bits {8:5} in the "CAPID5" register (each | |
17 | reports some NVDIMM mode available, if any of them are set, then | |
18 | the system supports memory machine check recovery). | |
19 | ||
20 | Signed-off-by: Tony Luck <tony.luck@intel.com> | |
21 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | |
22 | Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com> | |
23 | Cc: Ashok Raj <ashok.raj@intel.com> | |
24 | Cc: stable@vger.kernel.org # 4.9 | |
25 | Cc: Dan Williams <dan.j.williams@intel.com> | |
26 | Cc: Borislav Petkov <bp@suse.de> | |
27 | Link: https://lkml.kernel.org/r/03cbed6e99ddafb51c2eadf9a3b7c8d7a0cc204e.1527283897.git.tony.luck@intel.com | |
28 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
29 | ||
30 | --- | |
31 | arch/x86/kernel/quirks.c | 11 +++++++++-- | |
32 | 1 file changed, 9 insertions(+), 2 deletions(-) | |
33 | ||
34 | --- a/arch/x86/kernel/quirks.c | |
35 | +++ b/arch/x86/kernel/quirks.c | |
36 | @@ -645,12 +645,19 @@ static void quirk_intel_brickland_xeon_r | |
37 | /* Skylake */ | |
38 | static void quirk_intel_purley_xeon_ras_cap(struct pci_dev *pdev) | |
39 | { | |
40 | - u32 capid0; | |
41 | + u32 capid0, capid5; | |
42 | ||
43 | pci_read_config_dword(pdev, 0x84, &capid0); | |
44 | + pci_read_config_dword(pdev, 0x98, &capid5); | |
45 | ||
46 | - if ((capid0 & 0xc0) == 0xc0) | |
47 | + /* | |
48 | + * CAPID0{7:6} indicate whether this is an advanced RAS SKU | |
49 | + * CAPID5{8:5} indicate that various NVDIMM usage modes are | |
50 | + * enabled, so memory machine check recovery is also enabled. | |
51 | + */ | |
52 | + if ((capid0 & 0xc0) == 0xc0 || (capid5 & 0x1e0)) | |
53 | static_branch_inc(&mcsafe_key); | |
54 | + | |
55 | } | |
56 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x0ec3, quirk_intel_brickland_xeon_ras_cap); | |
57 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_ras_cap); |