[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210706050833.9852-1-jinpu.wang@ionos.com>
Date: Tue, 6 Jul 2021 07:08:33 +0200
From: Jack Wang <jinpu.wang@...os.com>
To: linux-edac@...r.kernel.org
Cc: yazen.ghannam@....com, bp@...en8.de, tony.luck@...el.com,
mchehab@...nel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] EDAC/amd64: Do not load EDAC driver when running as a guest
Similar to commit f0a029fff4a5 ("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.
Add a check in each of the Intel EDAC drivers for X86_FEATURE_HYPERVISOR
and simply return -ENODEV in the init routine.
Signed-off-by: Jack Wang <jinpu.wang@...os.com>
---
drivers/edac/amd64_edac.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index f0d8f60acee1..cdb14575ef31 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -3942,6 +3942,9 @@ static int __init amd64_edac_init(void)
if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))
return -EBUSY;
+ if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
+ return -ENODEV;
+
if (!x86_match_cpu(amd64_cpuids))
return -ENODEV;
--
2.25.1
Powered by blists - more mailing lists