xen/arm: smmuv1: Add a stream map entry iterator
authorRahul Singh <rahul.singh@arm.com>
Mon, 22 Mar 2021 16:11:38 +0000 (16:11 +0000)
committerJulien Grall <jgrall@amazon.com>
Thu, 1 Apr 2021 16:12:05 +0000 (17:12 +0100)
commite1d96fa2832d458ec6405b41a7202063421f5dc3
tree8e404bfedf4543f3293016605ca4eee2fef97c2d
parent06d1f7a278ddf4344efbb28c3360901b5a79ab75
xen/arm: smmuv1: Add a stream map entry iterator

Backport commit d3097e39302083d58922a3d1032d7d59a63d263d
"iommu/arm-smmu: Add a stream map entry iterator" from the Linux kernel.

This patch is the preparatory work to fix the stream match conflict
when two devices have the same stream-id.

Original commit message:
    iommu/arm-smmu: Add a stream map entry iterator

    We iterate over the SMEs associated with a master config quite a lot in
    various places, and are about to do so even more. Let's wrap the idiom
    in a handy iterator macro before the repetition gets out of hand.

Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/drivers/passthrough/arm/smmu.c