AMD/IOMMU: ensure suitable ordering of DTE modifications
authorJan Beulich <jbeulich@suse.com>
Tue, 20 Oct 2020 12:23:12 +0000 (14:23 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Oct 2020 12:23:12 +0000 (14:23 +0200)
commit0514a3a25fb9ebff5d75cc8f00a9229385300858
tree8b2fa52b133cecf454799a141bbfd1dd997510f4
parent3b055121c5410e2c3105d6d06aa24ca0d58868cd
AMD/IOMMU: ensure suitable ordering of DTE modifications

DMA and interrupt translation should be enabled only after other
applicable DTE fields have been written. Similarly when disabling
translation or when moving a device between domains, translation should
first be disabled, before other entry fields get modified. Note however
that the "moving" aspect doesn't apply to the interrupt remapping side,
as domain specifics are maintained in the IRTEs here, not the DTE. We
also never disable interrupt remapping once it got enabled for a device
(the respective argument passed is always the immutable iommu_intremap).

This is part of XSA-347.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
xen/drivers/passthrough/amd/iommu_map.c
xen/drivers/passthrough/amd/pci_amd_iommu.c