x86/IOMMU: mark IOMMU / intremap not in use when ACPI tables are missing
authorJan Beulich <jbeulich@suse.com>
Thu, 4 Nov 2021 13:44:01 +0000 (14:44 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 4 Nov 2021 13:44:01 +0000 (14:44 +0100)
commit46c4061cd2bf69e8039021af615c2bdb94e50088
treed37f7f94018abe4f109544806c0a3bd729354aa4
parentf7f4a523927fa4c7598e4647a16bc3e3cf8009d0
x86/IOMMU: mark IOMMU / intremap not in use when ACPI tables are missing

x2apic_bsp_setup() gets called ahead of iommu_setup(), and since x2APIC
mode (physical vs clustered) depends on iommu_intremap, that variable
needs to be set to off as soon as we know we can't / won't enable
interrupt remapping, i.e. in particular when parsing of the respective
ACPI tables failed. Move the turning off of iommu_intremap from AMD
specific code into acpi_iommu_init(), accompanying it by clearing of
iommu_enable.

Take the opportunity and also fully skip ACPI table parsing logic on
VT-d when both "iommu=off" and "iommu=no-intremap" are in effect anyway,
like was already the case for AMD.

The tag below only references the commit uncovering a pre-existing
anomaly.

Fixes: d8bd82327b0f ("AMD/IOMMU: obtain IVHD type to use earlier")
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
xen/drivers/passthrough/amd/pci_amd_iommu.c
xen/drivers/passthrough/vtd/dmar.c
xen/drivers/passthrough/x86/iommu.c
xen/include/asm-x86/acpi.h