Re: [PATCH v2] x86/setup: do not include kexec_handover.h from asm/setup.h

From: Borislav Petkov

Date: Fri Jul 03 2026 - 11:33:21 EST


On Fri, Jul 03, 2026 at 04:37:03PM +0200, Pratyush Yadav wrote:
> From: "Pratyush Yadav (Google)" <pratyush@xxxxxxxxxx>
>
> 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
> compliation failures.

Use a spellchecker.

> 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 change should also help reduce files recompiled when

Avoid having "This patch" or "This commit" in the commit message. It is
tautologically useless.

Also, do

$ git grep 'This patch' Documentation/process

for more details.

> kexec_handover.h changes.
>
> Signed-off-by: Pratyush Yadav (Google) <pratyush@xxxxxxxxxx>
> ---
>
> Notes:
> Thomas/Ingo/Borislav/Dave, is it okay if we take this patch through the

See my reply to Mike about using the generic-y infrastructure.

Thx.

--
Regards/Gruss,
Boris.

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