From b22a06ea6ff96075d4a443fb4f318f41a9823e08 Mon Sep 17 00:00:00 2001 From: Keqian Zhu Date: Tue, 8 Mar 2022 22:06:03 +0800 Subject: [PATCH] iommu/smmuv3: Remove the S1 mapping restriction of dirty log virt inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4WK5B CVE: NA ------------------------------ The previous patch extended dirty log feature for SMMUv3 nested mode, but forget to remove the S1 mapping restriction. Fixes: 97e11307edcc (iommu/arm-smmu-v3: Using HTTU with SMMU STE and stage 2 TTD) Signed-off-by: Keqian Zhu Tested-by: Kunkun Jiang Reviewed-by: Kunkun Jiang Reviewed-by: Zenghui Yu Signed-off-by: Zheng Zengkai --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 f6868511ad01..e463fd31d268 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -3533,7 +3533,7 @@ static int arm_smmu_switch_dirty_log(struct iommu_domain *domain, bool enable, if (!(smmu->features & ARM_SMMU_FEAT_HD)) return -ENODEV; - if (smmu_domain->stage != ARM_SMMU_DOMAIN_S1) + if (smmu_domain->stage == ARM_SMMU_DOMAIN_BYPASS) return -EINVAL; if (enable) { @@ -3574,7 +3574,7 @@ static int arm_smmu_sync_dirty_log(struct iommu_domain *domain, if (!(smmu->features & ARM_SMMU_FEAT_HD)) return -ENODEV; - if (smmu_domain->stage != ARM_SMMU_DOMAIN_S1) + if (smmu_domain->stage == ARM_SMMU_DOMAIN_BYPASS) return -EINVAL; if (!ops || !ops->sync_dirty_log) { @@ -3603,7 +3603,7 @@ static int arm_smmu_clear_dirty_log(struct iommu_domain *domain, if (!(smmu->features & ARM_SMMU_FEAT_HD)) return -ENODEV; - if (smmu_domain->stage != ARM_SMMU_DOMAIN_S1) + if (smmu_domain->stage == ARM_SMMU_DOMAIN_BYPASS) return -EINVAL; if (!ops || !ops->clear_dirty_log) { -- GitLab