From: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
To: Jason Gunthorpe <jgg@ziepe.ca>, Robin Murphy <robin.murphy@arm.com>
Cc: Daniel Mentz <danielmentz@google.com>,
Will Deacon <will@kernel.org>,
"Joerg Roedel (AMD)" <joro@8bytes.org>,
linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org,
Prakash Gupta <prakash.gupta@oss.qualcomm.com>
Subject: Re: [PATCH v5] iommu/io-pgtable-arm: Add support for contiguous hint bit
Date: Tue, 1 Dec 2026 15:04:12 +0530 [thread overview]
Message-ID: <501b7274-601f-454d-829d-82b1d0dc8ae2@oss.qualcomm.com> (raw)
In-Reply-To: <20261009163232.GB14213@ziepe.ca>
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
next prev parent reply other threads:[~2026-12-01 9:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 11:14 Vijayanand Jitta
2026-09-24 0:15 ` Jason Gunthorpe
2026-09-24 18:49 ` Daniel Mentz
2026-09-24 22:53 ` Jason Gunthorpe
2026-10-09 10:09 ` Vijayanand Jitta
2026-10-09 15:37 ` Robin Murphy
2026-10-09 16:32 ` Jason Gunthorpe
2026-12-01 9:34 ` Vijayanand Jitta [this message]
2026-09-24 20:36 ` Daniel Mentz
2026-09-24 22:55 ` Jason Gunthorpe
2026-10-09 10:11 ` Vijayanand Jitta
2026-10-09 10:11 ` Vijayanand Jitta
2026-10-09 18:57 ` Robin Murphy
2026-12-01 9:39 ` Vijayanand Jitta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=501b7274-601f-454d-829d-82b1d0dc8ae2@oss.qualcomm.com \
--to=vijayanand.jitta@oss.qualcomm.com \
--cc=danielmentz@google.com \
--cc=iommu@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=prakash.gupta@oss.qualcomm.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®