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

Jason Gunthorpe jgg at nvidia.com
Tue Oct 21 08:31:25 PDT 2025


On Tue, Oct 21, 2025 at 08:27:50AM -0700, Guo Ren wrote:
> On Mon, Oct 20, 2025 at 6:08 AM <fangyu.yu at linux.alibaba.com> wrote:
> >
> > From: Fangyu Yu <fangyu.yu at linux.alibaba.com>
> >
> > 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.

Assuming things about vm_pgoff is certainly incorrect. Handling it
during a normal fault by looking up the actual PTE seems OK to me too.

Jason



More information about the kvm-riscv mailing list