[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210906012052.929174-10-sashal@kernel.org>
Date: Sun, 5 Sep 2021 21:20:15 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>,
Borislav Petkov <bp@...e.de>,
Yazen Ghannam <yazen.ghannam@....com>,
Kim Phillips <kim.phillips@....com>,
Sasha Levin <sashal@...nel.org>, linux-edac@...r.kernel.org
Subject: [PATCH AUTOSEL 5.13 10/46] EDAC/mce_amd: Do not load edac_mce_amd module on guests
From: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>
[ Upstream commit 767f4b620edadac579c9b8b6660761d4285fa6f9 ]
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@...e.de>
Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Reviewed-by: Yazen Ghannam <yazen.ghannam@....com>
Tested-by: Kim Phillips <kim.phillips@....com>
Link: https://lkml.kernel.org/r/20210628172740.245689-1-Smita.KoralahalliChannabasappa@amd.com
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/edac/mce_amd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c
index 5dd905a3f30c..1a1629166aa3 100644
--- a/drivers/edac/mce_amd.c
+++ b/drivers/edac/mce_amd.c
@@ -1176,6 +1176,9 @@ static int __init mce_amd_init(void)
c->x86_vendor != X86_VENDOR_HYGON)
return -ENODEV;
+ if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
+ return -ENODEV;
+
if (boot_cpu_has(X86_FEATURE_SMCA)) {
xec_mask = 0x3f;
goto out;
--
2.30.2
Powered by blists - more mailing lists