Re: [PATCH v5] iommu/io-pgtable-arm: Add support for contiguous hint bit
From: Vijayanand Jitta
Date: Tue Dec 01 2026 - 04:34:40 EST
On 10/9/2026 10:02 PM, Jason Gunthorpe wrote:
> On Fri, Oct 09, 2026 at 04:37:08PM +0100, Robin Murphy wrote:
>
>> range size being unmapped, so even if the total gathered size exceeds a
>> single command, we still wouldn't split it _within_ any single one of those
>> ranges, only at a boundary between two unrelated ones.
>
> The question revolves on when the iopgtable path flushes gathers.
>
> If the gather only holds a single page size and always starts aligned
> to that size then the RIL splitting algorithm won't cause an issue.
>
> It isn't a question of allowing CONTs to be split, it is about when
> consecutive unmaps can merge into a single gather. iommupt is very
> general here so it can create gathers with mixed up page sizes and
> trigger the problem.
>
> For iopgtable we have several layers of logic splitting and flushing
> things. I keep forgetting about this bit in iommu_iotlb_gather_add_page():
>
> /*
> * If the new page is disjoint from the current range or is mapped at
> * a different granularity, then sync the TLB so that the gather
> * structure can be rewritten.
> */
> if ((gather->pgsize && gather->pgsize != size) ||
>
> I didn't try to do a full analysis that it really is enough for this
> series, but if size here is the PTE size including the CONT effect
> then it seems like it could be OK. The gather has to be aligned and
> has to have a single CONT size within it.
>
> My original reply was mostly to be taken as 'RIL alone isn't enough',
> meaning write an explanation someplace why it is safe under the
> current system. The commit messages for the SVA and my later fixup for
> iommupt explain the general concept and problem..
>
> Regards,
> Jason
Thanks, I rechecked the current ARM LPAE path. Partial unmaps of a tagged CONT
group are rejected before PTE changes; a complete unmap submits adjacent tlb_add_page()
callbacks at the underlying PTE granule (16 × 4 KiB for a 64 KiB group). Thus
iommu_iotlb_gather_add_page() cannot sync partway through the group: any granularity-change
or disjoint-range sync occurs before adding its first callback.
So, I see this errata is already handled in case of io-pgtable as Robin mentioned.
Thanks,
Vijay