Skip to content

Commit f02146c

Browse files
skoralahgregkh
authored andcommitted
EDAC/mce_amd: Do not load edac_mce_amd module on guests
[ Upstream commit 767f4b6 ] Hypervisors likely do not expose the SMCA feature to the guest and loading this module leads to false warnings. This module should not be loaded in guests to begin with, but people tend to do so, especially when testing kernels in VMs. And then they complain about those false warnings. Do the practical thing and do not load this module when running as a guest to avoid all that complaining. [ bp: Rewrite commit message. ] Suggested-by: Borislav Petkov <bp@suse.de> Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com> Tested-by: Kim Phillips <kim.phillips@amd.com> Link: https://lkml.kernel.org/r/20210628172740.245689-1-Smita.KoralahalliChannabasappa@amd.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f08a656 commit f02146c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎drivers/edac/mce_amd.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,9 @@ static int __init mce_amd_init(void)
12461246
c->x86_vendor != X86_VENDOR_HYGON)
12471247
return -ENODEV;
12481248

1249+
if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
1250+
return -ENODEV;
1251+
12491252
if (boot_cpu_has(X86_FEATURE_SMCA)) {
12501253
xec_mask = 0x3f;
12511254
goto out;

0 commit comments

Comments
 (0)