[RFC PATCH v2 8/9] iommu/arm-smmu-v3: check for domain initialization using pgtbl_ops

From: Michael Shavit
Date: Tue Aug 22 2023 - 06:58:46 EST


In order to remove smmu_domain->smmu in the next commit

Signed-off-by: Michael Shavit <mshavit@xxxxxxxxxx>
---

(no changes since v1)

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 7c9897702bcde..9f8b701771fc3 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -2894,7 +2894,7 @@ static int arm_smmu_enable_nesting(struct iommu_domain *domain)
int ret = 0;

mutex_lock(&smmu_domain->init_mutex);
- if (smmu_domain->smmu)
+ if (smmu_domain->pgtbl_ops)
ret = -EPERM;
else
smmu_domain->stage = ARM_SMMU_DOMAIN_NESTED;
--
2.42.0.rc1.204.g551eb34607-goog