archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.13 10/46] EDAC/mce_amd: Do not load edac_mce_amd module on guests
       [not found] <>
@ 2021-09-06  1:20 ` Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2021-09-06  1:20 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Smita Koralahalli, Borislav Petkov, Yazen Ghannam, Kim Phillips,
	Sasha Levin, linux-edac

From: Smita Koralahalli <>

[ 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

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 <>
Signed-off-by: Smita Koralahalli <>
Signed-off-by: Borislav Petkov <>
Reviewed-by: Yazen Ghannam <>
Tested-by: Kim Phillips <>
Signed-off-by: Sasha Levin <>
 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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-06  1:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <>
2021-09-06  1:20 ` [PATCH AUTOSEL 5.13 10/46] EDAC/mce_amd: Do not load edac_mce_amd module on guests Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).