[PATCH 3/7] iommu/arm-smmu-v3-iommufd: Fix error path in arm_vsmmu_cache_invalidate()

Mostafa Saleh smostafa at google.com
Tue Sep 1 01:47:25 PDT 2026


On Fri, Aug 28, 2026 at 11:27:22AM -0300, Jason Gunthorpe wrote:
> > arm_vsmmu_cache_invalidate() issues commands in batch size.
> > However, if arm_vsmmu_convert_user_cmd() fails, it will return to the
> > user that it processed "cur - cmds" which may be part of a batch not
> > issued yet.
> > 
> > Fix this by calculating the returned entry_num solely based on the
> > "last" that tracks the last batch that was successfully issued.
> > 
> > Also, fix the number of commands for early failing condition.
> > 
> > Fixes: d68beb276ba2 ("iommu/arm-smmu-v3: Support IOMMU_HWPT_INVALIDATE using a VIOMMU object")
> > Reported-by: Sashiko <>
> > Signed-off-by: Mostafa Saleh <smostafa at google.com>
> 
> Nicolin's series fixes this and the other sashiko note about over
> allocation:
> 
> https://lore.kernel.org/all/cover.1785258826.git.nicolinc@nvidia.com/
> 

I see, I will add it to my review list. Hopefully I can get to it by
this week.

Thanks,
Mostafa

> I think it is in good shape, I would rather merge it than hack on this
> further.
> 
> -- 
> Jason



More information about the linux-arm-kernel mailing list