iommu/arm: Don't allow the same micro-TLB to be shared between domains
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Mon, 17 Feb 2020 15:05:35 +0000 (17:05 +0200)
committerJulien Grall <julien@xen.org>
Thu, 27 Feb 2020 22:12:52 +0000 (22:12 +0000)
commit90d19e6f53a47f8f7f2154c67f03adc192c0d760
treea6075ee1493228ee0c7541c0c34e6ce77029ea49
parentfedd1f6f4115bc5f1695ad0be1719532f31d74de
iommu/arm: Don't allow the same micro-TLB to be shared between domains

For the IPMMU-VMSA we need to prevent the use cases where devices
which use the same micro-TLB are assigned to different Xen domains
(micro-TLB cannot be shared between multiple Xen domains, since it
points to the context bank to use for the page walk).

As each Xen domain uses individual context bank pointed by context_id,
we can potentially recognize that use case by comparing current and new
context_id for the already enabled micro-TLB and prevent different
context bank from being set.

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Julien Grall <julien@xen.org>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
xen/drivers/passthrough/arm/ipmmu-vmsa.c