iommu/arm-smmu-v3: Move CD table to arm_smmu_master
authorMichael Shavit <mshavit@google.com>
Fri, 15 Sep 2023 13:17:37 +0000 (21:17 +0800)
committerWill Deacon <will@kernel.org>
Thu, 12 Oct 2023 16:08:17 +0000 (17:08 +0100)
commit10e4968cd511e3125cf62574aee950c4012c161a
tree3ac79eb5083f0ff725ea03c603a58e43c356462e
parent24503148c545f08c10de73cc3a3779f1ee7a8fa0
iommu/arm-smmu-v3: Move CD table to arm_smmu_master

With this change, each master will now own its own CD table instead of
sharing one with other masters attached to the same domain. Attaching a
stage 1 domain installs CD entries into the master's CD table. SVA
writes its CD entries into each master's CD table if the domain is
shared across masters.

Also add the device to the devices list before writing the CD to the
table so that SVA will know that the CD needs to be re-written to this
device's CD table as well if it decides to update the CD's ASID
concurrently with this function.

Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Michael Shavit <mshavit@google.com>
Link: https://lore.kernel.org/r/20230915211705.v8.6.Ice063dcf87d1b777a72e008d9e3406d2bcf6d876@changeid
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h