AMD/IOMMU: correct shattering of super pages
authorJan Beulich <jbeulich@suse.com>
Mon, 26 Oct 2020 13:38:35 +0000 (14:38 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 26 Oct 2020 13:38:35 +0000 (14:38 +0100)
commit2a758376f9e2bd277b6067952517a301da87dc86
tree8b131545b346a77bae1a604d57636c343daa01da
parent92abe1481c1181b95c7f91846bd1d77f37ee5c5e
AMD/IOMMU: correct shattering of super pages

Fill the new page table _before_ installing into a live page table
hierarchy, as installing a blank page first risks I/O faults on
sub-ranges of the original super page which aren't part of the range
for which mappings are being updated.

While at it also do away with mapping and unmapping the same fresh
intermediate page table page once per entry to be written.

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