]> xenbits.xensource.com Git - people/tklengyel/xen.git/commit
gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant
authorJan Beulich <jbeulich@suse.com>
Thu, 18 Feb 2021 12:16:59 +0000 (13:16 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 18 Feb 2021 12:16:59 +0000 (13:16 +0100)
commite8185c5f01c68f7d29d23a4a91bc1be1ff2cc1ca
tree94bc58028b5862f9c05fca6b2a6812c339b78891
parentb339e3a976b1680f57051adabcb98281198f7eac
gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant

Mappings for a domain's own pages should already be present in the
IOMMU. While installing the same mapping again is merely redundant (and
inefficient), removing the mapping when the grant mapping gets removed
is outright wrong in this case: The mapping was there before the map, so
should remain in place after unmapping.

This affects
- Arm Dom0 in the direct mapped case,
- x86 PV Dom0 in the "iommu=dom0-strict" / "dom0-iommu=strict" case,
- all x86 PV DomU-s, including driver domains.

See the code comment for why it's the original domain and not the page
owner that gets compared against.

Reported-by: Rahul Singh <Rahul.Singh@arm.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/common/grant_table.c