From: Jason Gunthorpe <jgg@nvidia.com>
To: William Tu <witu@nvidia.com>
Cc: linux-mm@kvack.org, weizhang@nvidia.com
Subject: Re: [PATCH] vfio: add dma map/unmap support for noiommu
Date: Mon, 5 May 2025 14:16:15 -0300 [thread overview]
Message-ID: <20250505171615.GQ2260709@nvidia.com> (raw)
In-Reply-To: <20250503004821.16980-1-witu@nvidia.com>
On Fri, May 02, 2025 at 05:48:21PM -0700, William Tu wrote:
> Currently when using noiommu, the VFIO uAPI does not support
> VFIO_IOMMU_MAP_DMA, causing userspace VFIO program to use
> s.t like /proc/self/pagemap to get the physical address.
> The patch adds the support for dma map and unmap operation
> for noiommu.
We are not changing vfio container code in significant ways now, new
features need to go through iommufd and use an access to do this.
> + while (remaining_pages > 0) {
> + unsigned long pages_to_unmap = min(remaining_pages, chunk_size);
> +
> + ret = get_user_pages_remote(mm, current_vaddr, pages_to_unmap,
> + FOLL_GET, pages, NULL);
> + if (ret > 0) {
This doesn't work anyhow because there is no guarentee that the 2nd
get_user_pages will return the same things, and that is the wrong API
to use anyhow.
Jason
next prev parent reply other threads:[~2025-05-05 17:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-03 0:48 William Tu
2025-05-05 17:16 ` Jason Gunthorpe [this message]
2025-05-07 15:19 ` William Tu
2025-05-06 8:21 ` kernel test robot
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=20250505171615.GQ2260709@nvidia.com \
--to=jgg@nvidia.com \
--cc=linux-mm@kvack.org \
--cc=weizhang@nvidia.com \
--cc=witu@nvidia.com \
/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