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

x86/setup: Move internal setup_data structures into setup_data.h

Move struct_efi_setup_data in order to unify duplicated definition of
the data structure in a single place. Also silence clang's warnings
about GNU extensions in real-mode code which might occur from the
changed includes.

[ 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>
Link: https://lore.kernel.org/r/20240112095000.8952-3-tzimmermann@suse.de

authored by

Thomas Zimmermann and committed by
Borislav Petkov (AMD)
2afa7994 efd7def0

+35 -31
+3
arch/x86/Makefile
··· 53 53 REALMODE_CFLAGS += -Wno-address-of-packed-member 54 54 REALMODE_CFLAGS += $(cc_stack_align4) 55 55 REALMODE_CFLAGS += $(CLANG_FLAGS) 56 + ifdef CONFIG_CC_IS_CLANG 57 + REALMODE_CFLAGS += -Wno-gnu 58 + endif 56 59 export REALMODE_CFLAGS 57 60 58 61 # BITS is used as extension for files which are available in a 32 bit
-9
arch/x86/boot/compressed/efi.h
··· 97 97 u32 tables; 98 98 } efi_system_table_32_t; 99 99 100 - /* kexec external ABI */ 101 - struct efi_setup_data { 102 - u64 fw_vendor; 103 - u64 __unused; 104 - u64 tables; 105 - u64 smbios; 106 - u64 reserved[8]; 107 - }; 108 - 109 100 struct efi_unaccepted_memory { 110 101 u32 version; 111 102 u32 unit_size;
-9
arch/x86/include/asm/efi.h
··· 143 143 void arch_efi_call_virt_setup(void); 144 144 void arch_efi_call_virt_teardown(void); 145 145 146 - /* kexec external ABI */ 147 - struct efi_setup_data { 148 - u64 fw_vendor; 149 - u64 __unused; 150 - u64 tables; 151 - u64 smbios; 152 - u64 reserved[8]; 153 - }; 154 - 155 146 extern u64 efi_setup; 156 147 157 148 #ifdef CONFIG_EFI
-13
arch/x86/include/asm/pci.h
··· 10 10 #include <linux/numa.h> 11 11 #include <asm/io.h> 12 12 #include <asm/memtype.h> 13 - #include <asm/setup_data.h> 14 13 15 14 struct pci_sysdata { 16 15 int domain; /* PCI domain */ ··· 122 123 cpumask_of_node(node); 123 124 } 124 125 #endif 125 - 126 - struct pci_setup_rom { 127 - struct setup_data data; 128 - uint16_t vendor; 129 - uint16_t devid; 130 - uint64_t pcilen; 131 - unsigned long segment; 132 - unsigned long bus; 133 - unsigned long device; 134 - unsigned long function; 135 - uint8_t romdata[]; 136 - }; 137 126 138 127 #endif /* _ASM_X86_PCI_H */
+32
arch/x86/include/asm/setup_data.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + #ifndef _ASM_X86_SETUP_DATA_H 3 + #define _ASM_X86_SETUP_DATA_H 4 + 5 + #include <uapi/asm/setup_data.h> 6 + 7 + #ifndef __ASSEMBLY__ 8 + 9 + struct pci_setup_rom { 10 + struct setup_data data; 11 + uint16_t vendor; 12 + uint16_t devid; 13 + uint64_t pcilen; 14 + unsigned long segment; 15 + unsigned long bus; 16 + unsigned long device; 17 + unsigned long function; 18 + uint8_t romdata[]; 19 + }; 20 + 21 + /* kexec external ABI */ 22 + struct efi_setup_data { 23 + u64 fw_vendor; 24 + u64 __unused; 25 + u64 tables; 26 + u64 smbios; 27 + u64 reserved[8]; 28 + }; 29 + 30 + #endif /* __ASSEMBLY__ */ 31 + 32 + #endif /* _ASM_X86_SETUP_DATA_H */