Re: [PATCH] vfio: Request THP-aligned mmap for device fds

From: Lorenzo Stoakes

Date: Mon Jun 22 2026 - 11:51:04 EST


On Fri, Jun 19, 2026 at 04:04:18PM +0100, Ryan Roberts wrote:
> On 18/06/2026 15:55, Lorenzo Stoakes wrote:
> > +cc Ryan for contPMD
> >
> >>
> >>> And maybe there's a CONTPMD architecture we should also consider?
> >>
> >> ARM HW supports "CONTPMD" but I suppose it is not implemented..
> >
> > Maybe Ryan has thoughts?
>
> Sorry not quite sure what you're asking so will give a generic answer:
>
> Arm arch does indeed support CONTPMD at level 2 in the same way that it supports
> CONTPTE at level 3, as follows:
>
> +-----------+-----------+-----------+-----------+-----------+
> | Page Size | CONTPTE | PMD | CONTPMD | PUD |
> +-----------+-----------+-----------+-----------+-----------+
> | 4KB | 64KB | 2MB | 32MB | 1GB |
> | 16KB | 2MB | 32MB | 1GB | |
> | 64KB | 2MB | 512MB | 16GB | |
> +-----------+-----------+-----------+-----------+-----------+
>
> For HugeTLB, Linux/arm64 support all of the listed sizes today. For !HugeTLB
> (i.e. THP, large file filos) Linux/arm64 supports CONTPTE and PMD only. We could
> (and probably would) extend to support CONTPMD once THP PUDs are supported.
>
> Not sure if that answers the question?

Thanks, that's really useful!

I think Jason's concern was that we'd have to account for contpmd here, but
that'd only be w.r.t. THP rather than hugetlb, so we're safe for now I think!

I guess this would be a new >PMD sized mTHP size which... I really hope we have
the THP code in better shape once we come to that :)

>
> Thanks,
> Ryan
>
> >
> >>
> >> Jason
> >
> > Thanks, Lorenzo
>

Cheers, Lorenzo