On 3/2/26 13:54, Jason Gunthorpe wrote:
> On Mon, Mar 02, 2026 at 11:07:41AM +0100, Christian König wrote:
>
>> As far as I know background is that on x86 pte_special() only works
>> on true leave pte but not pmd/pud.
>
> This is not the case, there are pmd and pud_special as well, protected
> by CONFIG_xx
>
> The arch should not define CONFIG_ARCH_SUPPORTS_PMD_PFNMAP if
> vmf_insert_pfn_pmd() doesn't result in pmd_special() working, for
> example.
>
> eg:
>
> vmf_insert_pfn_pmd()
> insert_pmd()
>
> if (fop.is_folio) {
> // Not Taken
> } else {
> entry = pmd_mkhuge(pfn_pmd(fop.pfn, prot));
> entry = pmd_mkspecial(entry);
>
> This stuff was all put together by Peter specifically for VFIO to use,
> AFAIK it is correct.
Oh that is really nice to know, thanks for that information. It means we could
give that approach another try.
> IDK what Thomas was using, but if you tried to do huge faults before
> all of this was built it definitely would not work right as it only
> supported a folio backed path.
Yeah Thomas tried that like ~6years ago and my educated guess is that the whole
infrastructure was just not there at that time.
Christian.
>
> Jason