x86/x2APIC: defer probe until after IOMMU ACPI table parsing
authorJan Beulich <jbeulich@suse.com>
Fri, 3 Dec 2021 10:36:10 +0000 (11:36 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 Dec 2021 10:36:10 +0000 (11:36 +0100)
commit3950f2485bbc983c5c9f66ef9637395e975a2bec
treef3eb7ad42fa062605762c07ab93b321182851ebe
parentd159edac73cf887fc899326edddd00133c1d206c
x86/x2APIC: defer probe until after IOMMU ACPI table parsing

While commit 46c4061cd2bf ("x86/IOMMU: mark IOMMU / intremap not in use
when ACPI tables are missing") deals with apic_x2apic_probe() as called
from x2apic_bsp_setup(), the check_x2apic_preenabled() path is similarly
affected: The call needs to occur after acpi_iommu_init(), such that
iommu_intremap getting disabled there can be properly taken into account
by apic_x2apic_probe().

Note that, for the time being (further cleanup patches following),
reversing the order of the calls to generic_apic_probe() and
acpi_boot_init() is not an option:
- acpi_process_madt() calls clustered_apic_check() and hence relies on
  genapic to have got filled before,
- generic_bigsmp_probe() (called from acpi_process_madt()) needs to
  occur after generic_apic_probe(),
- acpi_parse_madt() (called from acpi_process_madt()) calls
  acpi_madt_oem_check(), which wants to be after generic_apic_probe().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/acpi/boot.c
xen/arch/x86/setup.c
xen/drivers/passthrough/x86/iommu.c