x86: Do not include <asm/bootparam.h> in several files
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 12 Jan 2024 09:44:39 +0000 (10:44 +0100)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 30 Jan 2024 14:17:24 +0000 (15:17 +0100)
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
14 files changed:
arch/x86/boot/compressed/acpi.c
arch/x86/boot/compressed/cmdline.c
arch/x86/boot/compressed/efi.c
arch/x86/boot/compressed/pgtable_64.c
arch/x86/boot/compressed/sev.c
arch/x86/include/asm/kexec.h
arch/x86/include/asm/mem_encrypt.h
arch/x86/include/asm/sev.h
arch/x86/include/asm/x86_init.h
arch/x86/kernel/crash.c
arch/x86/kernel/sev-shared.c
arch/x86/platform/pvh/enlighten.c
arch/x86/xen/enlighten_pvh.c
arch/x86/xen/vga.c

index 18d15d1ce87d5993946c31579b006594e9c4e9da..f196b1d1ddf867b62161cb0528872526c82a693f 100644 (file)
@@ -5,6 +5,8 @@
 #include "../string.h"
 #include "efi.h"
 
+#include <asm/bootparam.h>
+
 #include <linux/numa.h>
 
 /*
index c1bb180973ea2a74eaf7b1788faeeba366643daa..e162d7f59cc5bdabfc129f68cb9e4ac79a29bb1e 100644 (file)
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "misc.h"
 
+#include <asm/bootparam.h>
+
 static unsigned long fs;
 static inline void set_fs(unsigned long seg)
 {
index 6edd034b0b30cb2df90937e06d30e125cf88268f..f2e50f9758e6cccebc1f380e6e1ee6e6c484e2a4 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "misc.h"
 
+#include <asm/bootparam.h>
+
 /**
  * efi_get_type - Given a pointer to boot_params, determine the type of EFI environment.
  *
index 51f957b24ba7a2babdd7c89d3b6cf0b070519691..c882e1f67af01c50a20bfe00a32138dc771ee88c 100644 (file)
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "misc.h"
+#include <asm/bootparam.h>
 #include <asm/e820/types.h>
 #include <asm/processor.h>
 #include "pgtable.h"
index 454acd7a2dafff2a0d16cc2a0ddd61745b3fcf36..13beae767e48cd106d5dc264f702f87ccbb408b1 100644 (file)
@@ -12,6 +12,7 @@
  */
 #include "misc.h"
 
+#include <asm/bootparam.h>
 #include <asm/pgtable_types.h>
 #include <asm/sev.h>
 #include <asm/trapnr.h>
index c9f6a6c5de3cf6c72f53a62e25c0c548df85b28e..91ca9a9ee3a2b26a964254202c53ffb5ca544d3a 100644 (file)
@@ -25,7 +25,6 @@
 
 #include <asm/page.h>
 #include <asm/ptrace.h>
-#include <asm/bootparam.h>
 
 struct kimage;
 
index 359ada486fa92da37dfe77b1958a066612a42e4b..c1a8a3408c18114d2439c48a294e67dd3100a68b 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/init.h>
 #include <linux/cc_platform.h>
 
-#include <asm/bootparam.h>
+struct boot_params;
 
 #ifdef CONFIG_X86_MEM_ENCRYPT
 void __init mem_encrypt_init(void);
index 5b4a1ce3d36808b4ae0987547de69a534924d4bf..8dad8b1613bf6479a7d1556873e955aecaffc94a 100644 (file)
@@ -13,7 +13,6 @@
 
 #include <asm/insn.h>
 #include <asm/sev-common.h>
-#include <asm/bootparam.h>
 #include <asm/coco.h>
 
 #define GHCB_PROTOCOL_MIN      1ULL
@@ -22,6 +21,8 @@
 
 #define        VMGEXIT()                       { asm volatile("rep; vmmcall\n\r"); }
 
+struct boot_params;
+
 enum es_result {
        ES_OK,                  /* All good */
        ES_UNSUPPORTED,         /* Requested operation not supported */
index c878616a18b85750c92f764f1895cafb0698dd85..f062715578a0eff6fdedc28642c17bd54aa221fe 100644 (file)
@@ -2,8 +2,6 @@
 #ifndef _ASM_X86_PLATFORM_H
 #define _ASM_X86_PLATFORM_H
 
-#include <asm/bootparam.h>
-
 struct ghcb;
 struct mpc_bus;
 struct mpc_cpu;
index b6b044356f1b40599de1d41a1dfc5405ae2ca00c..fe404c16583a8bfa0c48123caee9b1bb38db70ae 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/vmalloc.h>
 #include <linux/memblock.h>
 
+#include <asm/bootparam.h>
 #include <asm/processor.h>
 #include <asm/hardirq.h>
 #include <asm/nmi.h>
index 1d24ec6799157be4080adc903b38394f8538b35b..fcc6d834e2c482886b84a4560ef82434de987b49 100644 (file)
@@ -9,6 +9,8 @@
  * and is included directly into both code-bases.
  */
 
+#include <asm/setup_data.h>
+
 #ifndef __BOOT_COMPRESSED
 #define error(v)       pr_err(v)
 #define has_cpuflag(f) boot_cpu_has(f)
index 00a92cb2c81474782146b801f56a5d5880c8afb7..944e0290f2c001810a16a2eee3c2e87a31ba48e0 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <xen/hvc-console.h>
 
+#include <asm/bootparam.h>
 #include <asm/io_apic.h>
 #include <asm/hypervisor.h>
 #include <asm/e820/api.h>
index ada3868c02c231d0f10863cabf71a076f003acb5..9e9db601bd52a9bf48a2e5ec4c936c0b7db93b39 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <xen/hvc-console.h>
 
+#include <asm/bootparam.h>
 #include <asm/io_apic.h>
 #include <asm/hypervisor.h>
 #include <asm/e820/api.h>
index d97adab8420f4c248011e87d7c43417ad3b2ca6e..f7547807b0bd7311d375ed572b1b718538ecbf79 100644 (file)
@@ -2,7 +2,6 @@
 #include <linux/screen_info.h>
 #include <linux/init.h>
 
-#include <asm/bootparam.h>
 #include <asm/setup.h>
 
 #include <xen/interface/xen.h>