Subject: [PATCH] x86, pci: move boot_params back to __initdata Don't waste 4k for 8 bytes. Also I don't see the reason why DTB could only have one entry but SETUP_UP data have multiple. diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h index dba7805..54358f8 100644 --- a/arch/x86/include/asm/pci.h +++ b/arch/x86/include/asm/pci.h @@ -183,4 +183,6 @@ struct pci_setup_rom { uint8_t romdata[0]; }; +extern u64 pa_data_setup_pci; + #endif /* _ASM_X86_PCI_H */ diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 2bd40fd..8062f25 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -143,7 +143,11 @@ int default_check_phys_apicid_present(int phys_apicid) } #endif +#ifndef CONFIG_DEBUG_BOOT_PARAMS +struct boot_params __initdata boot_params; +#else struct boot_params boot_params; +#endif /* * Machine setup.. @@ -414,6 +418,8 @@ static void __init reserve_initrd(void) } #endif /* CONFIG_BLK_DEV_INITRD */ +u64 pa_data_setup_pci; + static void __init parse_setup_data(void) { struct setup_data *data; @@ -442,6 +448,10 @@ static void __init parse_setup_data(void) case SETUP_DTB: add_dtb(pa_data); break; + case SETUP_PCI: + if (!setup_data_pci) + pa_data_setup_pci = pa_data; + break; default: break; } diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 47584f4..4e16651 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -613,12 +613,8 @@ int pcibios_add_device(struct pci_dev *dev) { struct setup_data *data; struct pci_setup_rom *rom; - u64 pa_data; + u64 pa_data = pa_data_setup_pci; - if (boot_params.hdr.version < 0x0209) - return 0; - - pa_data = boot_params.hdr.setup_data; while (pa_data) { data = phys_to_virt(pa_data);