summaryrefslogtreecommitdiffstats
path: root/drivers/edac/skx_base.c
diff options
context:
space:
mode:
authorLuck, Tony <tony.luck@intel.com>2021-06-15 19:44:19 +0200
committerTony Luck <tony.luck@intel.com>2021-06-18 03:23:14 +0200
commitf0a029fff4a50eb01648810a77ba1873e829fdd4 (patch)
tree4dcfcf68d9881200894ea621a81b611c9e7e354e /drivers/edac/skx_base.c
parentEDAC/igen6: Add Intel Alder Lake SoC support (diff)
downloadlinux-f0a029fff4a50eb01648810a77ba1873e829fdd4.tar.xz
linux-f0a029fff4a50eb01648810a77ba1873e829fdd4.zip
EDAC/Intel: Do not load EDAC driver when running as a guest
There's little to no point in loading an EDAC driver running in a guest: 1) The CPU model reported by CPUID may not represent actual h/w 2) The hypervisor likely does not pass in access to memory controller devices 3) Hypervisors generally do not pass corrected error details to guests Add a check in each of the Intel EDAC drivers for X86_FEATURE_HYPERVISOR and simply return -ENODEV in the init routine. Acked-by: Borislav Petkov <bp@suse.de> Signed-off-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/r/20210615174419.GA1087688@agluck-desk2.amr.corp.intel.com
Diffstat (limited to 'drivers/edac/skx_base.c')
-rw-r--r--drivers/edac/skx_base.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/edac/skx_base.c b/drivers/edac/skx_base.c
index 6a4f0b27c654..4dbd46575bfb 100644
--- a/drivers/edac/skx_base.c
+++ b/drivers/edac/skx_base.c
@@ -656,6 +656,9 @@ static int __init skx_init(void)
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
return -EBUSY;
+ if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
+ return -ENODEV;
+
id = x86_match_cpu(skx_cpuids);
if (!id)
return -ENODEV;