diff options
Diffstat (limited to 'arch/x86/pci/mmconfig-shared.c')
-rw-r--r-- | arch/x86/pci/mmconfig-shared.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 326198a4434e..676e5e04e4d4 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c | |||
@@ -610,6 +610,32 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header) | |||
610 | return 0; | 610 | return 0; |
611 | } | 611 | } |
612 | 612 | ||
613 | #ifdef CONFIG_ACPI_APEI | ||
614 | extern int (*arch_apei_filter_addr)(int (*func)(__u64 start, __u64 size, | ||
615 | void *data), void *data); | ||
616 | |||
617 | static int pci_mmcfg_for_each_region(int (*func)(__u64 start, __u64 size, | ||
618 | void *data), void *data) | ||
619 | { | ||
620 | struct pci_mmcfg_region *cfg; | ||
621 | int rc; | ||
622 | |||
623 | if (list_empty(&pci_mmcfg_list)) | ||
624 | return 0; | ||
625 | |||
626 | list_for_each_entry(cfg, &pci_mmcfg_list, list) { | ||
627 | rc = func(cfg->res.start, resource_size(&cfg->res), data); | ||
628 | if (rc) | ||
629 | return rc; | ||
630 | } | ||
631 | |||
632 | return 0; | ||
633 | } | ||
634 | #define set_apei_filter() (arch_apei_filter_addr = pci_mmcfg_for_each_region) | ||
635 | #else | ||
636 | #define set_apei_filter() | ||
637 | #endif | ||
638 | |||
613 | static void __init __pci_mmcfg_init(int early) | 639 | static void __init __pci_mmcfg_init(int early) |
614 | { | 640 | { |
615 | pci_mmcfg_reject_broken(early); | 641 | pci_mmcfg_reject_broken(early); |
@@ -644,6 +670,8 @@ void __init pci_mmcfg_early_init(void) | |||
644 | else | 670 | else |
645 | acpi_sfi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg); | 671 | acpi_sfi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg); |
646 | __pci_mmcfg_init(1); | 672 | __pci_mmcfg_init(1); |
673 | |||
674 | set_apei_filter(); | ||
647 | } | 675 | } |
648 | } | 676 | } |
649 | 677 | ||