Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: Do not include <asm/bootparam.h> in several files

Remove the include statement for <asm/bootparam.h> from several files
that don't require it and limit the exposure of those definitions within
the Linux kernel code.

[ bp: Massage commit message. ]

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20240112095000.8952-5-tzimmermann@suse.de

authored by

Thomas Zimmermann and committed by
Borislav Petkov (AMD)
103bf75f 785ddc8b

+16 -6
+2
arch/x86/boot/compressed/acpi.c
··· 5 5 #include "../string.h" 6 6 #include "efi.h" 7 7 8 + #include <asm/bootparam.h> 9 + 8 10 #include <linux/numa.h> 9 11 10 12 /*
+2
arch/x86/boot/compressed/cmdline.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include "misc.h" 3 3 4 + #include <asm/bootparam.h> 5 + 4 6 static unsigned long fs; 5 7 static inline void set_fs(unsigned long seg) 6 8 {
+2
arch/x86/boot/compressed/efi.c
··· 7 7 8 8 #include "misc.h" 9 9 10 + #include <asm/bootparam.h> 11 + 10 12 /** 11 13 * efi_get_type - Given a pointer to boot_params, determine the type of EFI environment. 12 14 *
+1
arch/x86/boot/compressed/pgtable_64.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include "misc.h" 3 + #include <asm/bootparam.h> 3 4 #include <asm/e820/types.h> 4 5 #include <asm/processor.h> 5 6 #include "pgtable.h"
+1
arch/x86/boot/compressed/sev.c
··· 12 12 */ 13 13 #include "misc.h" 14 14 15 + #include <asm/bootparam.h> 15 16 #include <asm/pgtable_types.h> 16 17 #include <asm/sev.h> 17 18 #include <asm/trapnr.h>
-1
arch/x86/include/asm/kexec.h
··· 25 25 26 26 #include <asm/page.h> 27 27 #include <asm/ptrace.h> 28 - #include <asm/bootparam.h> 29 28 30 29 struct kimage; 31 30
+1 -1
arch/x86/include/asm/mem_encrypt.h
··· 15 15 #include <linux/init.h> 16 16 #include <linux/cc_platform.h> 17 17 18 - #include <asm/bootparam.h> 18 + struct boot_params; 19 19 20 20 #ifdef CONFIG_X86_MEM_ENCRYPT 21 21 void __init mem_encrypt_init(void);
+2 -1
arch/x86/include/asm/sev.h
··· 13 13 14 14 #include <asm/insn.h> 15 15 #include <asm/sev-common.h> 16 - #include <asm/bootparam.h> 17 16 #include <asm/coco.h> 18 17 19 18 #define GHCB_PROTOCOL_MIN 1ULL ··· 20 21 #define GHCB_DEFAULT_USAGE 0ULL 21 22 22 23 #define VMGEXIT() { asm volatile("rep; vmmcall\n\r"); } 24 + 25 + struct boot_params; 23 26 24 27 enum es_result { 25 28 ES_OK, /* All good */
-2
arch/x86/include/asm/x86_init.h
··· 2 2 #ifndef _ASM_X86_PLATFORM_H 3 3 #define _ASM_X86_PLATFORM_H 4 4 5 - #include <asm/bootparam.h> 6 - 7 5 struct ghcb; 8 6 struct mpc_bus; 9 7 struct mpc_cpu;
+1
arch/x86/kernel/crash.c
··· 26 26 #include <linux/vmalloc.h> 27 27 #include <linux/memblock.h> 28 28 29 + #include <asm/bootparam.h> 29 30 #include <asm/processor.h> 30 31 #include <asm/hardirq.h> 31 32 #include <asm/nmi.h>
+2
arch/x86/kernel/sev-shared.c
··· 9 9 * and is included directly into both code-bases. 10 10 */ 11 11 12 + #include <asm/setup_data.h> 13 + 12 14 #ifndef __BOOT_COMPRESSED 13 15 #define error(v) pr_err(v) 14 16 #define has_cpuflag(f) boot_cpu_has(f)
+1
arch/x86/platform/pvh/enlighten.c
··· 3 3 4 4 #include <xen/hvc-console.h> 5 5 6 + #include <asm/bootparam.h> 6 7 #include <asm/io_apic.h> 7 8 #include <asm/hypervisor.h> 8 9 #include <asm/e820/api.h>
+1
arch/x86/xen/enlighten_pvh.c
··· 4 4 5 5 #include <xen/hvc-console.h> 6 6 7 + #include <asm/bootparam.h> 7 8 #include <asm/io_apic.h> 8 9 #include <asm/hypervisor.h> 9 10 #include <asm/e820/api.h>
-1
arch/x86/xen/vga.c
··· 2 2 #include <linux/screen_info.h> 3 3 #include <linux/init.h> 4 4 5 - #include <asm/bootparam.h> 6 5 #include <asm/setup.h> 7 6 8 7 #include <xen/interface/xen.h>