linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: William Tu <witu@nvidia.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: linux-mm@kvack.org, weizhang@nvidia.com
Subject: Re: [PATCH] vfio: add dma map/unmap support for noiommu
Date: Wed, 7 May 2025 08:19:20 -0700	[thread overview]
Message-ID: <37c870f2-208d-4633-91ab-54e3a24a858b@nvidia.com> (raw)
In-Reply-To: <20250505171615.GQ2260709@nvidia.com>



On 5/5/25 10:16 AM, Jason Gunthorpe wrote:
> 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
Hi Jason,
Thanks for the feedback. Will drop this one and use the correct API.
William


  reply	other threads:[~2025-05-07 15:19 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
2025-05-07 15:19   ` William Tu [this message]
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=37c870f2-208d-4633-91ab-54e3a24a858b@nvidia.com \
    --to=witu@nvidia.com \
    --cc=jgg@nvidia.com \
    --cc=linux-mm@kvack.org \
    --cc=weizhang@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