mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 16:28:58 -04:00
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) <pratyush@kernel.org> Acked-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://patch.msgid.link/20260706153751.1166003-1-pratyush@kernel.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
This commit is contained in:
committed by
Mike Rapoport (Microsoft)
parent
dc59e4fea9
commit
08412b8c70
@@ -14334,6 +14334,7 @@ S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/liveupdate/linux.git
|
||||
F: Documentation/admin-guide/mm/kho.rst
|
||||
F: Documentation/core-api/kho/*
|
||||
F: include/asm-generic/kexec_handover.h
|
||||
F: include/linux/kexec_handover.h
|
||||
F: include/linux/kho/
|
||||
F: include/linux/kho_block.h
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
#include <asm/setup.h> /* For COMMAND_LINE_SIZE */
|
||||
#undef _SETUP
|
||||
|
||||
#include <asm/kexec_handover.h>
|
||||
|
||||
extern unsigned long get_cmd_line_ptr(void);
|
||||
|
||||
/* Simplified build-specific string for starting entropy. */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -69,8 +69,6 @@ extern void x86_ce4100_early_setup(void);
|
||||
static inline void x86_ce4100_early_setup(void) { }
|
||||
#endif
|
||||
|
||||
#include <linux/kexec_handover.h>
|
||||
|
||||
#ifndef _SETUP
|
||||
|
||||
#include <asm/espfix.h>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <linux/init_ohci1394_dma.h>
|
||||
#include <linux/initrd.h>
|
||||
#include <linux/iscsi_ibft.h>
|
||||
#include <linux/kexec_handover.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/panic_notifier.h>
|
||||
#include <linux/pci.h>
|
||||
|
||||
12
include/asm-generic/kexec_handover.h
Normal file
12
include/asm-generic/kexec_handover.h
Normal file
@@ -0,0 +1,12 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __ASM_GENERIC_KEXEC_HANDOVER_H
|
||||
#define __ASM_GENERIC_KEXEC_HANDOVER_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct kho_scratch {
|
||||
phys_addr_t addr;
|
||||
phys_addr_t size;
|
||||
};
|
||||
|
||||
#endif /* __ASM_GENERIC_KEXEC_HANDOVER_H */
|
||||
@@ -5,11 +5,7 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
struct kho_scratch {
|
||||
phys_addr_t addr;
|
||||
phys_addr_t size;
|
||||
};
|
||||
#include <asm-generic/kexec_handover.h>
|
||||
|
||||
struct kho_vmalloc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user