Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>,
	David Airlie <airlied@gmail.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Ankit Agrawal <ankita@nvidia.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Brett Creeley <brett.creeley@amd.com>,
	dri-devel@lists.freedesktop.org,
	Eric Auger <eric.auger@redhat.com>,
	Eric Farman <farman@linux.ibm.com>,
	Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	intel-gfx@lists.freedesktop.org,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	kvm@vger.kernel.org, Kirti Wankhede <kwankhede@nvidia.com>,
	linux-s390@vger.kernel.org, Longfang Liu <liulongfang@huawei.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Nikhil Agarwal <nikhil.agarwal@amd.com>,
	Nipun Gupta <nipun.gupta@amd.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	Halil Pasic <pasic@linux.ibm.com>,
	qat-linux@intel.com, Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Simona Vetter <simona@ffwll.ch>,
	Shameer Kolothum <skolothumtho@nvidia.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Tvrtko Ursulin <tursulin@ursulin.net>,
	virtualization@lists.linux.dev,
	Vineeth Vijayan <vneethv@linux.ibm.com>,
	Yishai Hadas <yishaih@nvidia.com>,
	Zhenyu Wang <zhenyuw.linux@gmail.com>,
	Zhi Wang <zhi.wang.linux@gmail.com>,
	Kevin Tian <kevin.tian@intel.com>,
	patches@lists.linux.dev, Pranjal Shrivastava <praan@google.com>,
	Mostafa Saleh <smostafa@google.com>
Subject: Re: [PATCH v2 00/22] vfio: Give VFIO_DEVICE_GET_REGION_INFO its own op
Date: Fri, 21 Nov 2025 09:24:53 -0700	[thread overview]
Message-ID: <20251121092453.6f151e0b.alex@shazbot.org> (raw)
In-Reply-To: <0-v2-2a9e24d62f1b+e10a-vfio_get_region_info_op_jgg@nvidia.com>

On Fri,  7 Nov 2025 13:41:16 -0400
Jason Gunthorpe <jgg@nvidia.com> wrote:

> There is alot of duplicated code in the drivers for processing
> VFIO_DEVICE_GET_REGION_INFO. Introduce a new op get_region_info_caps()
> which provides a struct vfio_info_cap and handles the cap chain logic
> to write the caps back to userspace and remove all of this duplication
> from drivers.
> 
> This is done in two steps, the first is a largely mechanical introduction
> of the get_region_info(). These patches are best viewed with the diff
> option to ignore whitespace (-b) as most of the lines are re-indending
> things.
> 
> Then drivers are updated to remove the duplicate cap related code. Some
> drivers are converted to use vfio_info_add_capability() instead of open
> coding a version of it.
> 
> This is on github: https://github.com/jgunthorpe/linux/commits/vfio_get_region_info_op
> 
> v2:
>  - Rename
>     hisi_acc_vfio_get_region -> hisi_acc_vfio_ioctl_get_region
>     vfio_fsl_mc_get_region_info -> vfio_fsl_mc_ioctl_get_region_info
>     intel_vgpu_get_region_info -> intel_vgpu_ioctl_get_region_info
>     mbochs_get_region_info -> mbochs_ioctl_get_region_info
>     intel_vgpu_get_region_info -> intel_vgpu_ioctl_get_region_info
>     vfio_ccw_mdev_get_region_info -> vfio_ccw_mdev_ioctl_get_region_info
>     hisi_acc_vfio_get_region -> hisi_acc_vfio_ioctl_get_region
>     vfio_fsl_mc_get_region_info -> vfio_fsl_mc_ioctl_get_region_info
>  - Consistently free caps.buf in vfio_get_region_info()
> v1: https://patch.msgid.link/r/0-v1-679a6fa27d31+209-vfio_get_region_info_op_jgg@nvidia.com

Applied to vfio next branch for v6.19.  Thanks,

Alex

      parent reply	other threads:[~2025-11-24 15:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 17:41 [PATCH v2 00/22] vfio: Give VFIO_DEVICE_GET_REGION_INFO its own op Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 01/22] vfio: Provide a get_region_info op Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 02/22] vfio/hisi: Convert to the " Jason Gunthorpe
2025-11-24  1:39   ` liulongfang
2025-11-24  2:45     ` Alex Williamson
2025-11-28  8:52       ` liulongfang
2025-11-07 17:41 ` [PATCH v2 03/22] vfio/virtio: " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 04/22] vfio/nvgrace: " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 05/22] vfio/pci: Fill in the missing get_region_info ops Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 06/22] vfio/mtty: Provide a get_region_info op Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 07/22] vfio/mdpy: " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 08/22] vfio/mbochs: " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 09/22] vfio/platform: " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 10/22] vfio/fsl: " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 11/22] vfio/cdx: " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 12/22] vfio/ccw: " Jason Gunthorpe
2025-11-07 20:03   ` Eric Farman
2025-11-07 17:41 ` [PATCH v2 13/22] vfio/gvt: " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 14/22] vfio: Require drivers to implement get_region_info Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 15/22] vfio: Add get_region_info_caps op Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 16/22] vfio/mbochs: Convert mbochs to use vfio_info_add_capability() Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 17/22] vfio/gvt: Convert to get_region_info_caps Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 18/22] vfio/ccw: " Jason Gunthorpe
2025-11-07 20:03   ` Eric Farman
2025-11-07 17:41 ` [PATCH v2 19/22] vfio/pci: Convert all PCI drivers " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 20/22] vfio/platform: Convert " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 21/22] vfio: Move the remaining drivers " Jason Gunthorpe
2025-11-07 17:41 ` [PATCH v2 22/22] vfio: Remove the get_region_info op Jason Gunthorpe
2025-11-07 20:16 ` ✗ Fi.CI.BUILD: failure for vfio: Give VFIO_DEVICE_GET_REGION_INFO its own op (rev2) Patchwork
2025-11-21 16:24 ` Alex Williamson [this message]

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=20251121092453.6f151e0b.alex@shazbot.org \
    --to=alex@shazbot.org \
    --cc=agordeev@linux.ibm.com \
    --cc=airlied@gmail.com \
    --cc=alex.williamson@redhat.com \
    --cc=ankita@nvidia.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=brett.creeley@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric.auger@redhat.com \
    --cc=farman@linux.ibm.com \
    --cc=giovanni.cabiddu@intel.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jgg@nvidia.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=liulongfang@huawei.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=nikhil.agarwal@amd.com \
    --cc=nipun.gupta@amd.com \
    --cc=oberpar@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=patches@lists.linux.dev \
    --cc=praan@google.com \
    --cc=qat-linux@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=skolothumtho@nvidia.com \
    --cc=smostafa@google.com \
    --cc=svens@linux.ibm.com \
    --cc=tursulin@ursulin.net \
    --cc=virtualization@lists.linux.dev \
    --cc=vneethv@linux.ibm.com \
    --cc=yishaih@nvidia.com \
    --cc=zhenyuw.linux@gmail.com \
    --cc=zhi.wang.linux@gmail.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