From: Kunkun Jiang jiangkunkun@huawei.com
virt inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I61SPO CVE: NA
--------------------------------
This reverts commit 21d56f9c91a0a1b55cc7e5933974d6afcef7b001.
Signed-off-by: Kunkun Jiang jiangkunkun@huawei.com Reviewed-by: Keqian Zhu zhukeqian1@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- drivers/iommu/io-pgtable-arm.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c index 0969224aff7b..34f6366dcc6c 100644 --- a/drivers/iommu/io-pgtable-arm.c +++ b/drivers/iommu/io-pgtable-arm.c @@ -980,6 +980,10 @@ static int arm_lpae_sync_dirty_log(struct io_pgtable_ops *ops, if (WARN_ON(iaext)) return -EINVAL;
+ if (data->iop.fmt != ARM_64_LPAE_S1 && + data->iop.fmt != ARM_32_LPAE_S1) + return -EINVAL; + return __arm_lpae_sync_dirty_log(data, iova, size, lvl, ptep, bitmap, base_iova, bitmap_pgshift); } @@ -1072,6 +1076,10 @@ static int arm_lpae_clear_dirty_log(struct io_pgtable_ops *ops, if (WARN_ON(iaext)) return -EINVAL;
+ if (data->iop.fmt != ARM_64_LPAE_S1 && + data->iop.fmt != ARM_32_LPAE_S1) + return -EINVAL; + return __arm_lpae_clear_dirty_log(data, iova, size, lvl, ptep, bitmap, base_iova, bitmap_pgshift); }