AMD/IOMMU: respect AtsDisabled device flag
authorJan Beulich <jbeulich@suse.com>
Fri, 15 Oct 2021 10:46:42 +0000 (12:46 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 15 Oct 2021 10:46:42 +0000 (12:46 +0200)
commit246a0cd415af377d26576dd9962ee78c0f83f1f9
treec423e0a783985117ea1d28110a3224a68d108b40
parent6f81a70baf839a94732a6b9dd2eaf11e1aa2eff2
AMD/IOMMU: respect AtsDisabled device flag

IVHD entries may specify that ATS is to be blocked for a device or range
of devices. Honor firmware telling us so.

While adding respective checks I noticed that the 2nd conditional in
amd_iommu_setup_domain_device() failed to check the IOMMU's capability.
Add the missing part of the condition there, as no good can come from
enabling ATS on a device when the IOMMU is not capable of dealing with
ATS requests.

For actually using ACPI_IVHD_ATS_DISABLED, make its expansion no longer
exhibit UB.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
xen/drivers/passthrough/amd/iommu.h
xen/drivers/passthrough/amd/iommu_acpi.c
xen/drivers/passthrough/amd/pci_amd_iommu.c
xen/include/acpi/actbl2.h