aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/pci/mmconfig-shared.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 602c172d3bd5..02642773c29d 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -15,6 +15,7 @@
15#include <linux/acpi.h> 15#include <linux/acpi.h>
16#include <linux/sfi_acpi.h> 16#include <linux/sfi_acpi.h>
17#include <linux/bitmap.h> 17#include <linux/bitmap.h>
18#include <linux/dmi.h>
18#include <linux/sort.h> 19#include <linux/sort.h>
19#include <asm/e820.h> 20#include <asm/e820.h>
20#include <asm/pci_x86.h> 21#include <asm/pci_x86.h>
@@ -527,18 +528,31 @@ reject:
527 528
528static int __initdata known_bridge; 529static int __initdata known_bridge;
529 530
530static int acpi_mcfg_64bit_base_addr __initdata = FALSE;
531
532/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ 531/* The physical address of the MMCONFIG aperture. Set from ACPI tables. */
533struct acpi_mcfg_allocation *pci_mmcfg_config; 532struct acpi_mcfg_allocation *pci_mmcfg_config;
534int pci_mmcfg_config_num; 533int pci_mmcfg_config_num;
535 534
536static int __init acpi_mcfg_oem_check(struct acpi_table_mcfg *mcfg) 535static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
536 struct acpi_mcfg_allocation *cfg)
537{ 537{
538 int year;
539
540 if (cfg->address < 0xFFFFFFFF)
541 return 0;
542
538 if (!strcmp(mcfg->header.oem_id, "SGI")) 543 if (!strcmp(mcfg->header.oem_id, "SGI"))
539 acpi_mcfg_64bit_base_addr = TRUE; 544 return 0;
540 545
541 return 0; 546 if (mcfg->header.revision >= 1) {
547 if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) &&
548 year >= 2010)
549 return 0;
550 }
551
552 printk(KERN_ERR PREFIX "MCFG region for %04x:%02x-%02x at %#llx "
553 "is above 4GB, ignored\n", cfg->pci_segment,
554 cfg->start_bus_number, cfg->end_bus_number, cfg->address);
555 return -EINVAL;
542} 556}
543 557
544static int __init pci_parse_mcfg(struct acpi_table_header *header) 558static int __init pci_parse_mcfg(struct acpi_table_header *header)
@@ -574,13 +588,8 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header)
574 588
575 memcpy(pci_mmcfg_config, &mcfg[1], config_size); 589 memcpy(pci_mmcfg_config, &mcfg[1], config_size);
576 590
577 acpi_mcfg_oem_check(mcfg);
578
579 for (i = 0; i < pci_mmcfg_config_num; ++i) { 591 for (i = 0; i < pci_mmcfg_config_num; ++i) {
580 if ((pci_mmcfg_config[i].address > 0xFFFFFFFF) && 592 if (acpi_mcfg_check_entry(mcfg, &pci_mmcfg_config[i])) {
581 !acpi_mcfg_64bit_base_addr) {
582 printk(KERN_ERR PREFIX
583 "MMCONFIG not in low 4GB of memory\n");
584 kfree(pci_mmcfg_config); 593 kfree(pci_mmcfg_config);
585 pci_mmcfg_config_num = 0; 594 pci_mmcfg_config_num = 0;
586 return -ENODEV; 595 return -ENODEV;