Skip to contentSkip to conversation

EDAC/amd64: Do not load EDAC driver when running as a guest

PATCH In review Jack Wang 2 participants 3 messages Jul 6, 2021

Subsystems (2)
lore
Share & tools
lore

Jack Wang

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/edac/amd64_edac.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/edac/amd64_edac.c +3 -0
index f0d8f60acee1..cdb14575ef31 100644
@@ -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;
 
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 6 lines · Jack Wang

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/[email protected]/

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
author
#2 lore raw
Quoted 11 lines · Borislav Petkov
Quoted 6 lines · Jack Wang

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

Quoted 5 lines

Also:

https://lore.kernel.org/linux-edac/[email protected]/

Great if it's already in the queue.

Quoted 5 lines

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Thanks!