Re: Re: [PATCH] RISC-V: KVM: Remove automatic I/O mapping for VM_PFNMAP

From: Anup Patel
Date: Fri Oct 24 2025 - 11:57:32 EST


On Fri, Oct 24, 2025 at 8:55 PM Anup Patel <anup@xxxxxxxxxxxxxx> wrote:
>
> On Fri, Oct 24, 2025 at 7:01 PM <fangyu.yu@xxxxxxxxxxxxxxxxx> wrote:
> >
> > >> From: Fangyu Yu <fangyu.yu@xxxxxxxxxxxxxxxxx>
> > >>
> > >> As of commit aac6db75a9fc ("vfio/pci: Use unmap_mapping_range()"),
> > >> vm_pgoff may no longer guaranteed to hold the PFN for VM_PFNMAP
> > >> regions. Using vma->vm_pgoff to derive the HPA here may therefore
> > >> produce incorrect mappings.
> > >>
> > >> Instead, I/O mappings for such regions can be established on-demand
> > >> during g-stage page faults, making the upfront ioremap in this path
> > >> is unnecessary.
> > >>
> > >> Fixes: 9d05c1fee837 ("RISC-V: KVM: Implement stage2 page table programming")
> > >> Signed-off-by: Fangyu Yu <fangyu.yu@xxxxxxxxxxxxxxxxx>
> > >
> > >LGTM.
> > >
> > >Queued it as fix for Linux-6.18
> > >
> > >Reviewed-by: Anup Patel <anup@xxxxxxxxxxxxxx>
> > >
> > >Thanks,
> > >Anup
> > >
> >
> > Hi Anup:
> >
> > Thanks for the review.
> >
> > Please note that this patch has two build warnings, and I have fixed
> > on patch V2:
> > https://lore.kernel.org/linux-riscv/20251021142131.78796-1-fangyu.yu@xxxxxxxxxxxxxxxxx/
> >
>
> Can you send a separate patch with Fixes tag to this patch?
>
> You can base the patch on riscv_kvm_next branch at:
> https://github.com/kvm-riscv/linux.git
>

For some reason, your v2 patch never showed up in my inbox :(

No need for a separate patch. I have picked your v2.

Regards,
Anup