Re: [PATCH] iommu/io-pgtable-arm: Add support for contiguous hint bit

From: Jason Gunthorpe

Date: Sat Jul 18 2026 - 19:09:31 EST


On Sat, Jul 18, 2026 at 08:11:35PM +0000, Mostafa Saleh wrote:
> On Wed, Jul 15, 2026 at 09:28:30AM -0300, Jason Gunthorpe wrote:
> > On Wed, Jul 15, 2026 at 01:03:22PM +0100, Will Deacon wrote:
> >
> > > From what I can tell, the fiddly parts for iommupt will be:
> > >
> > > 1. Hardware bugs / quirks. Some of the simpler ones could probably be
> > > handled but for the more invasive stuff like the Mali format
> > > format, io-pgtable will probably need to hang around. Perhaps
> > > it becomes io-pgtable-mali.c?
> >
> > I briefly looked at Mali a while back and it didn't seem so bad, but
> > that was for a GPU driver not the iommu so a bit different
> > issue. Exactly what the GPU drivers should be doing is less clear to
> > me, they don't really fit well with the iommu focused interface (eg
> > the memory preload issues/etc).
> >
> > > 2. The pKVM work from Mostafa. We'll probably end up with something
> > > separate at EL2 for this (ideally, just reusing the CPU page-table
> > > code when it learns about BBML3).
> >
> > Yeah, I'm not sure here, it isn't great that is adding another user
> > and open coding some of the logic (eg smmu_pgsize_idmap). It would be
> > much better if it could just use all the existing flow more directly
> > somehow.
>
> I was under the impression that io-pgtable-arm will remain the same,
> but if it is going to be removed (or at least the LPAE format) I need
> to figure out an alternative for pKVM:

I wasn't going to suggest you change anything with your series at this
point, just opining it is "not great", but I wouldn't object to
merging it as you've constructed it right now.

> - Compile iommupt for the hypervisor (similar to what we do with
> io-pgtable-arm in the SMMUv3 pKVM series which compiles in both)
> I am not sure how easy is that for iommupt, I have the SMMUv3
> iommupt series on my review list, I will check that.

It is probably similarish, I thought your new version was pretty clean
when I glanced at it.

> - Write a small IO page table implementation just for the hypervisor,
> that's not ideal as it would benefit also from features as CONTPTE.

You can do this pretty easially with the generic_pt and you can write
the thing exactly as you need. I wouldn't do this unless there was a
big mismatch with what iommu_domain provides.

Jason