From 08412b8c707fdbccb7bf2116f0554fe09113cd53 Mon Sep 17 00:00:00 2001 From: "Pratyush Yadav (Google)" Date: Mon, 6 Jul 2026 17:37:49 +0200 Subject: x86/setup: do not include kexec_handover.h from asm/setup.h x86 asm/setup.h includes linux/kexec_handover.h. This is because it is used by setup.c and kaslr.c. But this inclusion is problematic. The header is included in many places, so it results in the KHO header being propagated there. Also, the setup header is used by realmode code. If KHO header includes things like mm.h, it causes a big dump of compilation failures. Nothing in setup.h uses anything from KHO. Remove the header from setup.h, and directly include it in setup.c. which does use things from KHO. Since kaslr.c is a part of the decompressor, avoid including linux headers there directly. Instead, split out struct kho_scratch, which is the only thing the kaslr.c uses, and move it to include/asm-generic/kexec_handover.h. This should also help reduce files recompiled when kexec_handover.h changes. Signed-off-by: Pratyush Yadav (Google) Acked-by: Borislav Petkov (AMD) Link: https://patch.msgid.link/20260706153751.1166003-1-pratyush@kernel.org Signed-off-by: Mike Rapoport (Microsoft) --- arch/x86/boot/compressed/kaslr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/x86/boot') diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c index 8e4bf5365ac6..22267a83e064 100644 --- a/arch/x86/boot/compressed/kaslr.c +++ b/arch/x86/boot/compressed/kaslr.c @@ -32,6 +32,8 @@ #include /* For COMMAND_LINE_SIZE */ #undef _SETUP +#include + extern unsigned long get_cmd_line_ptr(void); /* Simplified build-specific string for starting entropy. */ -- cgit v1.2.3