mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
EDAC/Intel: Do not load EDAC driver when running as a guest
[ Upstream commit f0a029fff4 ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
950a739905
commit
f5a90d44a1
@@ -263,6 +263,9 @@ static int __init i10nm_init(void)
|
|||||||
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
|
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
|
if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
id = x86_match_cpu(i10nm_cpuids);
|
id = x86_match_cpu(i10nm_cpuids);
|
||||||
if (!id)
|
if (!id)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|||||||
@@ -1554,6 +1554,9 @@ static int __init pnd2_init(void)
|
|||||||
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
|
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
|
if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
id = x86_match_cpu(pnd2_cpuids);
|
id = x86_match_cpu(pnd2_cpuids);
|
||||||
if (!id)
|
if (!id)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|||||||
@@ -3510,6 +3510,9 @@ static int __init sbridge_init(void)
|
|||||||
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
|
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
|
if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
id = x86_match_cpu(sbridge_cpuids);
|
id = x86_match_cpu(sbridge_cpuids);
|
||||||
if (!id)
|
if (!id)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|||||||
@@ -656,6 +656,9 @@ static int __init skx_init(void)
|
|||||||
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
|
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
|
if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
id = x86_match_cpu(skx_cpuids);
|
id = x86_match_cpu(skx_cpuids);
|
||||||
if (!id)
|
if (!id)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|||||||
Reference in New Issue
Block a user