From: Alex Williamson <alex@shazbot.org>
To: Mukesh R <mrathor@linux.microsoft.com>
Cc: alex.williamson@redhat.com, joe@perches.com, kvm@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"wei.liu@kernel.org" <wei.liu@kernel.org>
Subject: Re: [RFC] Making vma_to_pfn() public (due to vm_pgoff change)
Date: Mon, 27 Oct 2025 20:17:11 -0600 [thread overview]
Message-ID: <20251027201711.65e82a4f@shazbot.org> (raw)
In-Reply-To: <a9b8a3ee-b35b-5c45-5042-2466607abcd0@linux.microsoft.com>
On Mon, 27 Oct 2025 14:21:56 -0700
Mukesh R <mrathor@linux.microsoft.com> wrote:
> Hi Alex,
>
> This regards vfio passthru support on hyperv running linux as dom0 aka
> root. At a high level, cloud hypervisor uses vfio for set up as usual,
> then maps the mmio ranges via the hyperv linux driver ioctls.
>
> Over a year ago, when working on this I had used vm_pgoff to get the pfn
> for the mmio, that was 5.15 and early 6.x kernels. Now that I am porting
> to 6.18 for upstreaming, I noticed:
>
> commit aac6db75a9fc
> Author: Alex Williamson <alex.williamson@redhat.com>
> vfio/pci: Use unmap_mapping_range()
>
> changed the behavior and vm_pgoff is no longer holding the pfn. In light
> of that, I wondered if the following minor change, making vma_to_pfn()
> public (after renaming it), would be acceptable to you.
How do you know the device is using vfio_pci_core_mmap() with these
semantics for vm_pgoff versus something like nvgrace_gpu_mmap() that
uses vm_pgoff more like you're expecting? vma_to_pfn() is specific to
the vfio-pci-core semantics, it's not portable to expose for other use
cases. Thanks,
Alex
next prev parent reply other threads:[~2025-10-28 2:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 21:21 [RFC] Making vma_to_pfn() public (due to vm_pgoff change) Mukesh R
2025-10-28 2:17 ` Alex Williamson [this message]
2025-10-28 17:58 ` Mukesh R
2025-10-29 20:44 ` Jason Gunthorpe
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=20251027201711.65e82a4f@shazbot.org \
--to=alex@shazbot.org \
--cc=alex.williamson@redhat.com \
--cc=joe@perches.com \
--cc=kvm@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mrathor@linux.microsoft.com \
--cc=wei.liu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox