From: Pratyush Yadav <pratyush@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: Pratyush Yadav <pratyush@kernel.org>,
Thomas Gleixner <tglx@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
Mike Rapoport <rppt@kernel.org>,
linux-kernel@vger.kernel.org, x86@kernel.org,
kexec@lists.infradead.org
Subject: Re: [PATCH v2] x86/setup: do not include kexec_handover.h from asm/setup.h
Date: Fri, 03 Jul 2026 18:23:33 +0200 [thread overview]
Message-ID: <2vxzjyrcf3ei.fsf@kernel.org> (raw)
In-Reply-To: <20260703153044.GCakfVpO_egX4B9y_1@fat_crate.local> (Borislav Petkov's message of "Fri, 3 Jul 2026 08:30:44 -0700")
On Fri, Jul 03 2026, Borislav Petkov wrote:
> On Fri, Jul 03, 2026 at 04:37:03PM +0200, Pratyush Yadav wrote:
>> From: "Pratyush Yadav (Google)" <pratyush@kernel.org>
>>
>> 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.
>
>> 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
>
>> kexec_handover.h changes.
>>
>> Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
>> ---
>>
>> 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.
To double check I got your point correctly, is this what you mean?
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index ac02aed8757b..22267a83e064 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -32,7 +32,7 @@
#include <asm/setup.h> /* For COMMAND_LINE_SIZE */
#undef _SETUP
-#include <asm-generic/kexec_handover.h>
+#include <asm/kexec_handover.h>
extern unsigned long get_cmd_line_ptr(void);
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index 078fd2c0d69d..47ef8cb482e3 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -15,3 +15,4 @@ generic-y += fprobe.h
generic-y += mcs_spinlock.h
generic-y += mmzone.h
generic-y += ring_buffer.h
+generic-y += kexec_handover.h
--
Regards,
Pratyush Yadav
next prev parent reply other threads:[~2026-07-03 16:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 14:37 [PATCH v2] x86/setup: do not include kexec_handover.h from asm/setup.h Pratyush Yadav
2026-07-03 15:30 ` Borislav Petkov
2026-07-03 16:23 ` Pratyush Yadav [this message]
2026-07-03 17:38 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2vxzjyrcf3ei.fsf@kernel.org \
--to=pratyush@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pasha.tatashin@soleen.com \
--cc=rppt@kernel.org \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.