x86/IOMMU: mark IOMMU / intremap not in use when ACPI tables are missing
authorJan Beulich <jbeulich@suse.com>
Fri, 19 Nov 2021 08:41:09 +0000 (09:41 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 19 Nov 2021 08:41:09 +0000 (09:41 +0100)
commitcdcdc28b2ad4a53131f8843bc95fb9aa50a81191
tree0e0e4d933cf789ee4108c1ad02e0bbc331527c2d
parent3d031d9e79481768abf93c1aab30116806eb604f
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>
master commit: 46c4061cd2bf69e8039021af615c2bdb94e50088
master date: 2021-11-04 14:44:01 +0100
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