qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Leon Romanovsky" <leon@kernel.org>
To: "Vivek Kasireddy" <vivek.kasireddy@intel.com>, qemu-devel@nongnu.org
Cc: "Alex Williamson" <alex.williamson@redhat.com>,
	"Cédric Le Goater" <clg@redhat.com>
Subject: Re: [PATCH v2 06/10] linux-headers: Update vfio.h to include VFIO_DEVICE_FEATURE_DMA_BUF
Date: Sun, 09 Nov 2025 08:49:28 +0200	[thread overview]
Message-ID: <e546604c-d4fe-49f7-af50-faff53cde07b@app.fastmail.com> (raw)
In-Reply-To: <20251109053801.2267149-7-vivek.kasireddy@intel.com>



On Sun, Nov 9, 2025, at 07:33, Vivek Kasireddy wrote:
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Cédric Le Goater <clg@redhat.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
>  linux-headers/linux/vfio.h | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
> index 4d96d1fc12..bc11ca3663 100644
> --- a/linux-headers/linux/vfio.h
> +++ b/linux-headers/linux/vfio.h
> @@ -1478,6 +1478,31 @@ struct vfio_device_feature_bus_master {
>  };
>  #define VFIO_DEVICE_FEATURE_BUS_MASTER 10
> 
> +/**
> + * Upon VFIO_DEVICE_FEATURE_GET create a dma_buf fd for the
> + * regions selected.
> + *
> + * open_flags are the typical flags passed to open(2), eg O_RDWR, O_CLOEXEC,
> + * etc. offset/length specify a slice of the region to create the dmabuf from.
> + * nr_ranges is the total number of (P2P DMA) ranges that comprise the dmabuf.
> + *
> + * Return: The fd number on success, -1 and errno is set on failure.
> + */
> +#define VFIO_DEVICE_FEATURE_DMA_BUF 11
> +
> +struct vfio_region_dma_range {
> +	__u64 offset;
> +	__u64 length;
> +};
> +
> +struct vfio_device_feature_dma_buf {
> +	__u32	region_index;
> +	__u32	open_flags;
> +	__u32   flags;
> +	__u32   nr_ranges;
> +	struct vfio_region_dma_range dma_ranges[];

Not important comment at all, but in last versions of UAPI, this line is
struct vfio_region_dma_range dma_ranges[] __counted_by(nr_ranges);
https://lore.kernel.org/kvm/20251106-dmabuf-vfio-v7-10-2503bf390699@nvidia.com/T/#Z2e.:..:20251106-dmabuf-vfio-v7-10-2503bf390699::40nvidia.com:1include:uapi:linux:vfio.h

> +};
> +
>  /* -------- API for Type1 VFIO IOMMU -------- */
> 
>  /**
> -- 
> 2.50.1


  reply	other threads:[~2025-11-09  6:51 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-09  5:33 [PATCH v2 00/10] vfio: Implement VFIO_DEVICE_FEATURE_DMA_BUF and use it in virtio-gpu Vivek Kasireddy
2025-11-09  5:33 ` [PATCH v2 01/10] virtio-gpu: Recreate the resource's dmabuf if new backing is attached Vivek Kasireddy
2025-11-10  4:59   ` Akihiko Odaki
2025-11-09  5:33 ` [PATCH v2 02/10] virtio-gpu: Find hva for Guest's DMA addr associated with a ram device Vivek Kasireddy
2025-11-10  5:00   ` Akihiko Odaki
2025-11-11  4:45   ` Akihiko Odaki
2025-11-12  4:30     ` Kasireddy, Vivek
2025-11-12  8:14       ` Akihiko Odaki
2025-11-13  3:39         ` Kasireddy, Vivek
2025-11-13  4:08           ` Akihiko Odaki
2025-11-17  4:14             ` Kasireddy, Vivek
2025-11-17  6:56               ` Akihiko Odaki
2025-11-18  5:26                 ` Kasireddy, Vivek
2025-11-18  5:37                   ` Akihiko Odaki
2025-11-19  5:42                     ` Kasireddy, Vivek
2025-11-19  5:55                       ` Akihiko Odaki
2025-11-21  6:56                         ` Kasireddy, Vivek
2025-11-21  7:08                           ` Akihiko Odaki
2025-11-09  5:33 ` [PATCH v2 03/10] vfio: Document vfio_device_get_region_info() Vivek Kasireddy
2025-11-09  5:33 ` [PATCH v2 04/10] vfio/region: Add a helper to get region index from memory region Vivek Kasireddy
2025-11-09  5:33 ` [PATCH v2 05/10] vfio/device: Add a helper to lookup VFIODevice " Vivek Kasireddy
2025-11-09  5:33 ` [PATCH v2 06/10] linux-headers: Update vfio.h to include VFIO_DEVICE_FEATURE_DMA_BUF Vivek Kasireddy
2025-11-09  6:49   ` Leon Romanovsky [this message]
2025-11-17  9:02     ` Cédric Le Goater
2025-11-09  5:33 ` [PATCH v2 07/10] vfio/device: Add support for VFIO_DEVICE_FEATURE_DMA_BUF Vivek Kasireddy
2025-11-09  5:33 ` [PATCH v2 08/10] virtio-gpu: Rename udmabuf files and helpers to dmabuf Vivek Kasireddy
2025-11-10  5:00   ` Akihiko Odaki
2025-11-09  5:33 ` [PATCH v2 09/10] virtio-gpu-dmabuf: Introduce qemu_iovec_same_memory_regions() Vivek Kasireddy
2025-11-10  5:19   ` Akihiko Odaki
2025-11-12  4:24     ` Kasireddy, Vivek
2025-11-12  8:21       ` Akihiko Odaki
2025-11-13  3:14         ` Kasireddy, Vivek
2025-11-13  3:28           ` Akihiko Odaki
2025-11-09  5:33 ` [PATCH v2 10/10] virtio-gpu-dmabuf: Create dmabuf for blobs associated with VFIO devices Vivek Kasireddy
2025-11-10  4:55   ` Akihiko Odaki
2025-11-12  4:26     ` Kasireddy, Vivek
2025-11-12  8:17       ` Akihiko Odaki
2025-11-13  3:17         ` Kasireddy, Vivek
2025-11-13  3:31           ` Akihiko Odaki
2025-11-17  4:19             ` Kasireddy, Vivek
2025-11-17  7:13               ` Akihiko Odaki
2025-11-18  5:22                 ` Kasireddy, Vivek
2025-11-18  6:02                   ` Akihiko Odaki
2025-11-19  5:33                     ` Kasireddy, Vivek
2025-11-17  9:04 ` [PATCH v2 00/10] vfio: Implement VFIO_DEVICE_FEATURE_DMA_BUF and use it in virtio-gpu Cédric Le Goater

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=e546604c-d4fe-49f7-af50-faff53cde07b@app.fastmail.com \
    --to=leon@kernel.org \
    --cc=alex.williamson@redhat.com \
    --cc=clg@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vivek.kasireddy@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).