* [PATCH v2] iommu/arm-smmu-v3: Add a check to avoid invalid iotlb sync
@ 2021-03-30 12:58 chenxiang
2021-03-30 14:18 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: chenxiang @ 2021-03-30 12:58 UTC (permalink / raw)
To: robin.murphy, will; +Cc: iommu, linuxarm
From: Xiang Chen <chenxiang66@hisilicon.com>
It may send a invalid tlb sync for smmuv3 if iotlb_gather is not valid
(iotlb_gather->pgsize = 0). So add a check to avoid invalid iotlb sync
for it.
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 3 +++
1 file changed, 3 insertions(+)
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 8594b4a..941ba54 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -2305,6 +2305,9 @@ static void arm_smmu_iotlb_sync(struct iommu_domain *domain,
{
struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
+ if (!gather->pgsize)
+ return;
+
arm_smmu_tlb_inv_range_domain(gather->start,
gather->end - gather->start + 1,
gather->pgsize, true, smmu_domain);
--
2.8.1
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] iommu/arm-smmu-v3: Add a check to avoid invalid iotlb sync
2021-03-30 12:58 [PATCH v2] iommu/arm-smmu-v3: Add a check to avoid invalid iotlb sync chenxiang
@ 2021-03-30 14:18 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2021-03-30 14:18 UTC (permalink / raw)
To: chenxiang, robin.murphy
Cc: catalin.marinas, iommu, kernel-team, linuxarm, Will Deacon
On Tue, 30 Mar 2021 20:58:26 +0800, chenxiang wrote:
> It may send a invalid tlb sync for smmuv3 if iotlb_gather is not valid
> (iotlb_gather->pgsize = 0). So add a check to avoid invalid iotlb sync
> for it.
Applied to will (for-joerg/arm-smmu/updates), thanks!
[1/1] iommu/arm-smmu-v3: Add a check to avoid invalid iotlb sync
https://git.kernel.org/will/c/6cc7e5a9c6b0
Cheers,
--
Will
https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-30 14:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 12:58 [PATCH v2] iommu/arm-smmu-v3: Add a check to avoid invalid iotlb sync chenxiang
2021-03-30 14:18 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).