x86/mmcfg/drhd: Move acpi_mmcfg_init() call before calling acpi_parse_dmar()
authorZhenzhong Duan <zhenzhong.duan@oracle.com>
Tue, 28 Aug 2018 15:13:42 +0000 (17:13 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 28 Aug 2018 15:13:42 +0000 (17:13 +0200)
pci_conf_read8() needs pci mmcfg mapping to work on multiple pci
segments system such as HPE Superdome-Flex.

Move acpi_mmcfg_init() call in acpi_boot_init() before calling
acpi_parse_dmar() so that when pci_conf_read8() is called in
acpi_parse_dev_scope(), we already have the mapping set up.

mmio_ro_ranges initialization is also moved ahead as it's the only
dependency of pci_mmcfg_arch_enable() need to be moved. Also
checked codes between the old and new call sites to ensure we
don't break anything.

Furthermore MMCFG will continue to not work this early (or
more precisely not at all until Dom0 boot has progressed far
enough) if the range(s) isn't/aren't marked reserved in E820.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Tested-by: Gopalasetty, Manoj <manoj.gopalasetty@hpe.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/boot.c
xen/arch/x86/setup.c

index 8e6c96dcf6d848a23178c7b2b2623cdc5d5aaa5c..e89c2e9009e824a5b4b1b7be2f0ccd6a3338800e 100644 (file)
@@ -724,6 +724,8 @@ int __init acpi_boot_init(void)
 
        acpi_table_parse(ACPI_SIG_HPET, acpi_parse_hpet);
 
+       acpi_mmcfg_init();
+
        acpi_dmar_init();
 
        erst_init();
index 261861e1ed66cefb9689a537eadec6b156ca0dd3..dd11815e2ddab9fdd9e471fb65730771ffe46a1d 100644 (file)
@@ -1506,6 +1506,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     generic_apic_probe();
 
+    mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
+                                  RANGESETF_prettyprint_hex);
+
     acpi_boot_init();
 
     if ( smp_found_config )
@@ -1538,9 +1541,6 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     /* Low mappings were only needed for some BIOS table parsing. */
     zap_low_mappings();
 
-    mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
-                                  RANGESETF_prettyprint_hex);
-
     init_apic_mappings();
 
     normalise_cpu_order();
@@ -1611,8 +1611,6 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     vesa_mtrr_init();
 
-    acpi_mmcfg_init();
-
     early_msi_init();
 
     iommu_setup();    /* setup iommu if available */