]> xenbits.xensource.com Git - xen.git/commit
gnttab: bypass IOMMU (un)mapping when a domain is (un)mapping its own grant
authorJan Beulich <jbeulich@suse.com>
Fri, 5 Mar 2021 14:34:53 +0000 (15:34 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 5 Mar 2021 14:34:53 +0000 (15:34 +0100)
commit9b6054a63ebae032cd14dc610ed6d7c21e7e7a2f
tree3d807c596aa0f9adfecc7d48d5d7627c63ad937b
parent4a505ed5c4b7b333e22fb485ddfa5a19029045ad
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>
master commit: e8185c5f01c68f7d29d23a4a91bc1be1ff2cc1ca
master date: 2021-02-18 13:16:59 +0100
xen/common/grant_table.c