AMD/IOMMU: ensure suitable ordering of DTE modifications
authorJan Beulich <jbeulich@suse.com>
Tue, 20 Oct 2020 12:39:56 +0000 (14:39 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Oct 2020 12:39:56 +0000 (14:39 +0200)
commita279fcbb4f1a9c623dcb0a8f5d86c6a4123cf741
treecbc1713d424804d19cc4da68721080dadbb04a1e
parentf7ab0c1a8ce47d6362134cc99354874bcad2fc12
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>
master commit: 0514a3a25fb9ebff5d75cc8f00a9229385300858
master date: 2020-10-20 14:23:12 +0200
xen/drivers/passthrough/amd/iommu_map.c
xen/drivers/passthrough/amd/pci_amd_iommu.c