archive mirror
 help / color / mirror / Atom feed
From: Jack Wang <>
Subject: [PATCH] EDAC/amd64: Do not load EDAC driver when running as a guest
Date: Tue,  6 Jul 2021 07:08:33 +0200	[thread overview]
Message-ID: <> (raw)

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 <>
 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;

             reply	other threads:[~2021-07-06  5:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06  5:08 Jack Wang [this message]
2021-07-06  5:33 ` Borislav Petkov
2021-07-06  5:38   ` Jinpu Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] EDAC/amd64: Do not load EDAC driver when running as a guest' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).