All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Guo Ren <guoren@kernel.org>
Cc: fangyu.yu@linux.alibaba.com, anup@brainfault.org,
	atish.patra@linux.dev, pjw@kernel.org, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, alex@ghiti.fr, pbonzini@redhat.com,
	jiangyifei@huawei.com, kvm@vger.kernel.org,
	kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, alex.williamson@redhat.com
Subject: Re: [PATCH] RISC-V: KVM: Remove automatic I/O mapping for VM_PFNMAP
Date: Tue, 21 Oct 2025 12:31:25 -0300	[thread overview]
Message-ID: <20251021153125.GA699957@nvidia.com> (raw)
In-Reply-To: <CAJF2gTRwHJsA7jFvAXbqy-6LyfaVTqfsFXgHfAeOZ8M3JNsikg@mail.gmail.com>

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

-- 
kvm-riscv mailing list
kvm-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kvm-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: Guo Ren <guoren@kernel.org>
Cc: fangyu.yu@linux.alibaba.com, anup@brainfault.org,
	atish.patra@linux.dev, pjw@kernel.org, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, alex@ghiti.fr, pbonzini@redhat.com,
	jiangyifei@huawei.com, kvm@vger.kernel.org,
	kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, alex.williamson@redhat.com
Subject: Re: [PATCH] RISC-V: KVM: Remove automatic I/O mapping for VM_PFNMAP
Date: Tue, 21 Oct 2025 12:31:25 -0300	[thread overview]
Message-ID: <20251021153125.GA699957@nvidia.com> (raw)
In-Reply-To: <CAJF2gTRwHJsA7jFvAXbqy-6LyfaVTqfsFXgHfAeOZ8M3JNsikg@mail.gmail.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: Guo Ren <guoren@kernel.org>
Cc: fangyu.yu@linux.alibaba.com, anup@brainfault.org,
	atish.patra@linux.dev, pjw@kernel.org, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, alex@ghiti.fr, pbonzini@redhat.com,
	jiangyifei@huawei.com, kvm@vger.kernel.org,
	kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org, alex.williamson@redhat.com
Subject: Re: [PATCH] RISC-V: KVM: Remove automatic I/O mapping for VM_PFNMAP
Date: Tue, 21 Oct 2025 12:31:25 -0300	[thread overview]
Message-ID: <20251021153125.GA699957@nvidia.com> (raw)
In-Reply-To: <CAJF2gTRwHJsA7jFvAXbqy-6LyfaVTqfsFXgHfAeOZ8M3JNsikg@mail.gmail.com>

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

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2025-10-21 15:31 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-20 13:08 [PATCH] RISC-V: KVM: Remove automatic I/O mapping for VM_PFNMAP fangyu.yu
2025-10-20 13:08 ` fangyu.yu
2025-10-20 13:08 ` fangyu.yu
2025-10-20 19:43 ` Daniel Henrique Barboza
2025-10-20 19:43   ` Daniel Henrique Barboza
2025-10-20 19:43   ` Daniel Henrique Barboza
2025-10-21  1:44   ` fangyu.yu
2025-10-21  1:44     ` fangyu.yu
2025-10-21  1:44     ` fangyu.yu
2025-10-21  2:38 ` kernel test robot
2025-10-21  2:38   ` kernel test robot
2025-10-21  2:38   ` kernel test robot
2025-10-21 15:27 ` Guo Ren
2025-10-21 15:27   ` Guo Ren
2025-10-21 15:27   ` Guo Ren
2025-10-21 15:31   ` Jason Gunthorpe [this message]
2025-10-21 15:31     ` Jason Gunthorpe
2025-10-21 15:31     ` Jason Gunthorpe
2025-10-24  7:31   ` Anup Patel
2025-10-24  7:31     ` Anup Patel
2025-10-24  7:31     ` Anup Patel
2025-10-24 10:03     ` Guo Ren
2025-10-24 10:03       ` Guo Ren
2025-10-24 10:03       ` Guo Ren
2025-10-24  7:29 ` Anup Patel
2025-10-24  7:29   ` Anup Patel
2025-10-24  7:29   ` Anup Patel
2025-10-24 13:31   ` fangyu.yu
2025-10-24 13:31     ` fangyu.yu
2025-10-24 13:31     ` fangyu.yu
2025-10-24 15:25     ` Anup Patel
2025-10-24 15:25       ` Anup Patel
2025-10-24 15:25       ` Anup Patel
2025-10-24 15:57       ` Anup Patel
2025-10-24 15:57         ` Anup Patel
2025-10-24 15:57         ` Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251021153125.GA699957@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=alex@ghiti.fr \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=atish.patra@linux.dev \
    --cc=fangyu.yu@linux.alibaba.com \
    --cc=guoren@kernel.org \
    --cc=jiangyifei@huawei.com \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=pjw@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.