From 95c4cc5a585400982ae5b3bf9e3be6de71768376 Mon Sep 17 00:00:00 2001 From: Kevin Brodsky Date: Thu, 12 Dec 2024 08:09:04 +0000 Subject: [PATCH] x86/mm: Reduce header dependencies in Commit: 03b122da74b2 ("x86/sgx: Hook arch_memory_failure() into mainline code") ... added to to provide some helpers. However the following commit: b3fdf9398a16 ("x86/mce: relocate set{clear}_mce_nospec() functions") ... moved the inline definitions someplace else, and now just declares a bunch of mostly self-contained functions. No need for the whole inclusion to declare functions; just remove that include. This helps avoid circular dependency headaches (e.g. if ends up including ). This change requires a couple of include fixups not to break the build: * : including directly relies on having already been included, because the former needs the BAD_STACK/NOT_STACK constants defined in the latter. This is no longer the case when is included from some driver file - just include to stay out of trouble. * sev-guest.c relies on including , so we just need to make that include explicit. [ mingo: Cleaned up the changelog ] Signed-off-by: Kevin Brodsky Signed-off-by: Ingo Molnar Acked-by: David Hildenbrand Link: https://lore.kernel.org/r/20241212080904.2089632-3-kevin.brodsky@arm.com --- arch/x86/include/asm/set_memory.h | 1 - arch/x86/include/asm/smp.h | 2 +- drivers/virt/coco/sev-guest/sev-guest.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/set_memory.h b/arch/x86/include/asm/set_memory.h index 6586d533fe3ad..8d9f1c9aaa4ce 100644 --- a/arch/x86/include/asm/set_memory.h +++ b/arch/x86/include/asm/set_memory.h @@ -2,7 +2,6 @@ #ifndef _ASM_X86_SET_MEMORY_H #define _ASM_X86_SET_MEMORY_H -#include #include #include diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index ca073f40698fa..2ca1da5f16d96 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h @@ -3,10 +3,10 @@ #define _ASM_X86_SMP_H #ifndef __ASSEMBLY__ #include +#include #include #include -#include DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_map); DECLARE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_map); diff --git a/drivers/virt/coco/sev-guest/sev-guest.c b/drivers/virt/coco/sev-guest/sev-guest.c index 264b6523fe52f..ddec5677e247e 100644 --- a/drivers/virt/coco/sev-guest/sev-guest.c +++ b/drivers/virt/coco/sev-guest/sev-guest.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include -- 2.50.1