]> xenbits.xensource.com Git - xen.git/commit
xen/arm: p2m: Free the p2m entry after flushing the IOMMU TLBs
authorJulien Grall <julien.grall@arm.com>
Fri, 9 Aug 2019 12:59:15 +0000 (13:59 +0100)
committerJulien Grall <julien.grall@arm.com>
Wed, 2 Oct 2019 08:21:17 +0000 (09:21 +0100)
commit671878779741b38c5f2363adceef8de2ce0b3945
tree83470ff35987850e6534cbee6116c68e2dc5132c
parent057a2956212a29377c0f2f6d38e5bec787fb78e4
xen/arm: p2m: Free the p2m entry after flushing the IOMMU TLBs

When freeing a p2m entry, all the sub-tree behind it will also be freed.
This may include intermediate page-tables or any l3 entry requiring to
drop a reference (e.g for foreign pages). As soon as pages are freed,
they may be re-used by Xen or another domain. Therefore it is necessary
to flush *all* the TLBs beforehand.

While CPU TLBs will be flushed before freeing the pages, this is not
the case for IOMMU TLBs. This can be solved by moving the IOMMU TLBs
flush earlier in the code.

This wasn't considered as a security issue as device passthrough on Arm
is not security supported.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Tested-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/arm/p2m.c