improve extended config space verification From: rajesh.shah@intel.com Extend the verification for PCI-X/PCI-Express extended config space pointer. This patch checks whether the MCFG address range is listed as a motherboard resource, per the PCI firmware spec. The old check only looked in int 15 e820 memory map, causing several systems to fail the verification and lose extended config space. x86_64 picks up the verification code from the i386 directory. [AK: Also changed by me to use new type1 heuristic and some cleanups] Cc: gregkh@suse.de Signed-off-by: Rajesh Shah arch/x86_64/pci/mmconfig.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) Index: linux-2.6.18rc6-update/arch/x86_64/pci/mmconfig.c =================================================================== --- linux-2.6.18rc6-update.orig/arch/x86_64/pci/mmconfig.c +++ linux-2.6.18rc6-update/arch/x86_64/pci/mmconfig.c @@ -185,6 +185,17 @@ void __init pci_mmcfg_init(int type) (pci_mmcfg_config[0].base_address == 0)) return; + /* When Type1 access is not available don't check because + we really need MCFG then and it's hopefully ok*/ + if (type == 1 && !is_acpi_reserved(pci_mmcfg_config[0].base_address, + pci_mmcfg_config[0].base_address + + MMCONFIG_APER_MIN)) { + printk(KERN_ERR + "PCI: BIOS Bug: MCFG area at %x not reserved in ACPI\n", + pci_mmcfg_config[0].base_address); + return; + } + /* RED-PEN i386 doesn't do _nocache right now */ pci_mmcfg_virt = kmalloc(sizeof(*pci_mmcfg_virt) * pci_mmcfg_config_num, GFP_KERNEL); if (pci_mmcfg_virt == NULL) {