iommu/arm-smmu-v3: Link domains and devices
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Wed, 17 Apr 2019 18:24:46 +0000 (19:24 +0100)
committerWill Deacon <will.deacon@arm.com>
Tue, 23 Apr 2019 11:23:13 +0000 (12:23 +0100)
commit2a7e62f51696ad476b7fb8157d73307e20257df7
tree09e6551cb4354b84ff10ae222abed026a06e4b83
parent8be39a1a04c1491a6a408c1549dfd4e191f3a287
iommu/arm-smmu-v3: Link domains and devices

When removing a mapping from a domain, we need to send an invalidation to
all devices that might have stored it in their Address Translation Cache
(ATC). In addition when updating the context descriptor of a live domain,
we'll need to send invalidations for all devices attached to it.

Maintain a list of devices in each domain, protected by a spinlock. It is
updated every time we attach or detach devices to and from domains.

It needs to be a spinlock because we'll invalidate ATC entries from
within hardirq-safe contexts, but it may be possible to relax the read
side with RCU later.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu-v3.c