qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: John Levon <levon@movementarian.org>
Cc: Zhenzhong Duan <zhenzhong.duan@intel.com>,
	qemu-devel@nongnu.org, alex.williamson@redhat.com,
	eric.auger@redhat.com, joao.m.martins@oracle.com
Subject: Re: [PATCH 1/2] vfio/container: Support unmap all in one ioctl()
Date: Wed, 1 Oct 2025 08:58:43 +0200	[thread overview]
Message-ID: <d715d9dd-a613-4406-93c1-507d1470619f@redhat.com> (raw)
In-Reply-To: <aNxT1w0BbMH6pJ0J@movementarian.org>

On 10/1/25 00:04, John Levon wrote:
> On Tue, Sep 30, 2025 at 05:26:59PM +0200, Cédric Le Goater wrote:
> 
>>> -        }
>>> +        ret = ioctl(container->fd, VFIO_CHECK_EXTENSION, VFIO_UNMAP_ALL);
>>
>> Could we introduce an helper to test 'unmap_all' support in the host
>> kernel ? The result would be something like :
>>
>>    if (unmap_all) {
>>          if (vfio_legacy_has_unmap_all(VFIO_IOMMU_LEGACY(bcontainer))) {
>>              flags = VFIO_DMA_UNMAP_FLAG_ALL;
>>          } else {
>>              /* The unmap ioctl doesn't accept a full 64-bit span. */
>>              Int128 llsize = int128_rshift(int128_2_64(), 1);
>>              ...
>>          }
>>    }
> 
> For reference/consideration, the previous approach taken in the vfio-user
> series:
> 
> https://lore.kernel.org/qemu-devel/20250219144858.266455-4-john.levon@nutanix.com/
> 
> @@ -533,6 +562,11 @@ static bool vfio_legacy_setup(VFIOContainerBase *bcontainer, Error **errp)
>       vfio_get_info_iova_range(info, bcontainer);
>   
>       vfio_get_iommu_info_migration(container, info);
> +
> +    ret = ioctl(container->fd, VFIO_CHECK_EXTENSION, VFIO_UNMAP_ALL);
> +
> +    container->unmap_all_supported = (ret != 0);
> 
> (I dropped this particular change as part of getting merged.)
Yes. I’m reconsidering now.

Should we introduce a VFIOContainerBase attribute/flag 'unmap_all_supported',
set in the vioc->setup handler ?

Thanks,

C.



  reply	other threads:[~2025-10-01  7:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24  7:02 [PATCH 0/2] Optimize unmap_all with one ioctl() Zhenzhong Duan
2025-09-24  7:02 ` [PATCH 1/2] vfio/container: Support unmap all in " Zhenzhong Duan
2025-09-30 15:26   ` Cédric Le Goater
2025-09-30 22:04     ` John Levon
2025-10-01  6:58       ` Cédric Le Goater [this message]
2025-10-08 10:18         ` Duan, Zhenzhong
2025-10-08 13:01           ` Cédric Le Goater
2025-10-08 13:11             ` John Levon
2025-10-08 13:26               ` Cédric Le Goater
2025-10-08 10:17     ` Duan, Zhenzhong
2025-09-24  7:02 ` [PATCH 2/2] vfio/iommufd: " Zhenzhong Duan

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=d715d9dd-a613-4406-93c1-507d1470619f@redhat.com \
    --to=clg@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=joao.m.martins@oracle.com \
    --cc=levon@movementarian.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhenzhong.duan@intel.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;
as well as URLs for NNTP newsgroup(s).