diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c index 170f9783c5..aa9ab1a2e3 100644 --- a/xen/arch/x86/acpi/boot.c +++ b/xen/arch/x86/acpi/boot.c @@ -748,8 +748,6 @@ int __init acpi_boot_init(void) acpi_table_parse(ACPI_SIG_HPET, acpi_parse_hpet); - acpi_mmcfg_init(); - erst_init(); acpi_hest_init(); diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 2148dde05f..a123f94e85 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1802,6 +1802,12 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p) */ setup_system_domains(); + /* + * Initialize PCI (create segment 0, setup MMCFG access) ahead of IOMMU + * setup, as devices in segment > 0 must also be discoverable. + */ + acpi_mmcfg_init(); + /* * IOMMU-related ACPI table parsing has to happen before APIC probing, for * check_x2apic_preenabled() to be able to observe respective findings, in diff --git a/xen/arch/x86/x86_64/mmconfig-shared.c b/xen/arch/x86/x86_64/mmconfig-shared.c index b3b2da7362..7818ae5c3f 100644 --- a/xen/arch/x86/x86_64/mmconfig-shared.c +++ b/xen/arch/x86/x86_64/mmconfig-shared.c @@ -403,6 +403,9 @@ void __init acpi_mmcfg_init(void) pci_segments_init(); + if ( acpi_disabled ) + return; + /* MMCONFIG disabled */ if ((pci_probe & PCI_PROBE_MMCONF) == 0) return;