* [PATCH] EDAC/amd64: Do not load EDAC driver when running as a guest
@ 2021-07-06 5:08 Jack Wang
2021-07-06 5:33 ` Borislav Petkov
0 siblings, 1 reply; 3+ messages in thread
From: Jack Wang @ 2021-07-06 5:08 UTC (permalink / raw)
To: linux-edac; +Cc: yazen.ghannam, bp, tony.luck, mchehab, linux-kernel
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@ionos.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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] EDAC/amd64: Do not load EDAC driver when running as a guest
2021-07-06 5:08 [PATCH] EDAC/amd64: Do not load EDAC driver when running as a guest Jack Wang
@ 2021-07-06 5:33 ` Borislav Petkov
2021-07-06 5:38 ` Jinpu Wang
0 siblings, 1 reply; 3+ messages in thread
From: Borislav Petkov @ 2021-07-06 5:33 UTC (permalink / raw)
To: Jack Wang; +Cc: linux-edac, yazen.ghannam, tony.luck, mchehab, linux-kernel
On Tue, Jul 06, 2021 at 07:08:33AM +0200, Jack Wang wrote:
> 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.
Did you even read this sentence before leaving it in the commit message
or you simply copied the commit message of f0a029fff4a5 blindly?
Also:
https://lore.kernel.org/linux-edac/20210628172740.245689-1-Smita.KoralahalliChannabasappa@amd.com/
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] EDAC/amd64: Do not load EDAC driver when running as a guest
2021-07-06 5:33 ` Borislav Petkov
@ 2021-07-06 5:38 ` Jinpu Wang
0 siblings, 0 replies; 3+ messages in thread
From: Jinpu Wang @ 2021-07-06 5:38 UTC (permalink / raw)
To: Borislav Petkov; +Cc: linux-edac, yazen.ghannam, Luck, Tony, mchehab, open list
On Tue, Jul 6, 2021 at 7:34 AM Borislav Petkov <bp@alien8.de> wrote:
>
> On Tue, Jul 06, 2021 at 07:08:33AM +0200, Jack Wang wrote:
> > 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.
>
> Did you even read this sentence before leaving it in the commit message
> or you simply copied the commit message of f0a029fff4a5 blindly?
sorry, I notice the patch for Intel, and feel we should do the same
for AMD, hence post the patch.
I forgot to adapt the content of the commit message. -.-
>
> Also:
>
> https://lore.kernel.org/linux-edac/20210628172740.245689-1-Smita.KoralahalliChannabasappa@amd.com/
>
Great if it's already in the queue.
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-06 5:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 5:08 [PATCH] EDAC/amd64: Do not load EDAC driver when running as a guest Jack Wang
2021-07-06 5:33 ` Borislav Petkov
2021-07-06 5:38 ` Jinpu Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.