Skip to content

Commit 103bf75

Browse files
Thomas Zimmermannbp3tk0v
authored andcommitted
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
1 parent 785ddc8 commit 103bf75

File tree

14 files changed

+16
-6
lines changed

14 files changed

+16
-6
lines changed

arch/x86/boot/compressed/acpi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "../string.h"
66
#include "efi.h"
77

8+
#include <asm/bootparam.h>
9+
810
#include <linux/numa.h>
911

1012
/*

arch/x86/boot/compressed/cmdline.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include "misc.h"
33

4+
#include <asm/bootparam.h>
5+
46
static unsigned long fs;
57
static inline void set_fs(unsigned long seg)
68
{

arch/x86/boot/compressed/efi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include "misc.h"
99

10+
#include <asm/bootparam.h>
11+
1012
/**
1113
* efi_get_type - Given a pointer to boot_params, determine the type of EFI environment.
1214
*

arch/x86/boot/compressed/pgtable_64.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include "misc.h"
3+
#include <asm/bootparam.h>
34
#include <asm/e820/types.h>
45
#include <asm/processor.h>
56
#include "pgtable.h"

arch/x86/boot/compressed/sev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313
#include "misc.h"
1414

15+
#include <asm/bootparam.h>
1516
#include <asm/pgtable_types.h>
1617
#include <asm/sev.h>
1718
#include <asm/trapnr.h>

arch/x86/include/asm/kexec.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#include <asm/page.h>
2727
#include <asm/ptrace.h>
28-
#include <asm/bootparam.h>
2928

3029
struct kimage;
3130

arch/x86/include/asm/mem_encrypt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <linux/init.h>
1616
#include <linux/cc_platform.h>
1717

18-
#include <asm/bootparam.h>
18+
struct boot_params;
1919

2020
#ifdef CONFIG_X86_MEM_ENCRYPT
2121
void __init mem_encrypt_init(void);

arch/x86/include/asm/sev.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#include <asm/insn.h>
1515
#include <asm/sev-common.h>
16-
#include <asm/bootparam.h>
1716
#include <asm/coco.h>
1817

1918
#define GHCB_PROTOCOL_MIN 1ULL
@@ -22,6 +21,8 @@
2221

2322
#define VMGEXIT() { asm volatile("rep; vmmcall\n\r"); }
2423

24+
struct boot_params;
25+
2526
enum es_result {
2627
ES_OK, /* All good */
2728
ES_UNSUPPORTED, /* Requested operation not supported */

arch/x86/include/asm/x86_init.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#ifndef _ASM_X86_PLATFORM_H
33
#define _ASM_X86_PLATFORM_H
44

5-
#include <asm/bootparam.h>
6-
75
struct ghcb;
86
struct mpc_bus;
97
struct mpc_cpu;

arch/x86/kernel/crash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/vmalloc.h>
2727
#include <linux/memblock.h>
2828

29+
#include <asm/bootparam.h>
2930
#include <asm/processor.h>
3031
#include <asm/hardirq.h>
3132
#include <asm/nmi.h>

0 commit comments

Comments
 (0)