qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: Eric Auger <eric.auger@redhat.com>,
	eric.auger.pro@gmail.com, qemu-devel@nongnu.org,
	zhenzhong.duan@intel.com, alex.williamson@redhat.com,
	jgg@nvidia.com, nicolinc@nvidia.com, joao.m.martins@oracle.com,
	peterx@redhat.com, kevin.tian@intel.com, yi.l.liu@intel.com,
	yi.y.sun@intel.com, chao.p.peng@intel.com,
	mjrosato@linux.ibm.com, aik@ozlabs.ru
Subject: Re: [PATCH v4 00/15] Prerequisite changes for IOMMUFD support
Date: Wed, 4 Oct 2023 21:58:36 +0200	[thread overview]
Message-ID: <81ead96c-e7e7-2d38-db77-264d7aee924a@redhat.com> (raw)
In-Reply-To: <20231004154518.334760-1-eric.auger@redhat.com>

On 10/4/23 17:43, Eric Auger wrote:
> Hi All,
> 
> With the agreement of Zhenzhong, here is a v3 respin of the IOMMUFD
> prerequisite series. This applies on top of vfio-next:
> https://github.com/legoater/qemu/, branch vfio-next.
> 
> Per Cédric's suggestion, the IOMMUFD patchset v1[1] is now split
> into two series, this prerequisite series and the new IOMMUFD backend
> introduction support series. Hopefully this will ease the review.
> 
> The main purpose of this series is to make "common.c" group agnostic:
> all group related code are moved into container.c. Then we are prepared
> for next series, abstract base container, adding new backend, etc.
> 
> This series can be found at
> https://github.com/eauger/qemu/tree/prereq_v4
> 
> Test done:
> - PCI device were tested
> - device hotplug test
> - with or without vIOMMU
> - VFIO migration with a E800 net card(no dirty sync support) passthrough
> - platform and ccw were only compile-tested due to environment limit
> 
> Zhenzhong, Yi, Eric

LGTM, I did a small adjustment in vfio_detach_device() in patches 13+15.

Applied to vfio-next.

Thanks,

C.


> [1] https://lore.kernel.org/all/20230830103754.36461-1-zhenzhong.duan@intel.com/t/#u
> 
> Changelog:
> 
> v4:
> - include qemu/error-report.h in helpers.c
> - in ap.c, fix the wrongly added
>    vfio_detach_device(vbasedev) and g_free(vbasedev->name);
>    also added error_prepend
> - simplified vbasedev setting in ccw.c
> - vfio_detach_device: dropped check on
>    !vbasedev->container
> - container.c: restore dropped comment
> 
> v3:
> - rebased on vfio-next as suggested by Cedric
> - added vfio/common: Propagate KVM_SET_DEVICE_ATTR error if any
> - collected Cedric's R-b
> - Fix some error paths in vfio/cpi which now properly detach the device
>    and also free the vbasedev->name
> - Fix vfio/ccw migration (hopefully) [Matthew inputs]
> - Split [PATCH v2 11/12] vfio/common: Introduce two kinds of VFIO device lists
>    into 3 patches
> 
> v2:
> - Refine patch description per Eric
> - return errno and errp in vfio_kvm_device_[add/del]_fd per Eric
> - make memory listener register/deregister in seperate patch per Eric
> - Include the .h file first per Cédric
> - Add trace event in vfio_attach_device per Cédric
> - drop the change to vfio_viommu_preset by refactor per Cédric
> - Introduce global VFIO device list and per container list per Alex
> 
> Note changelog below are from full IOMMUFD series:
> 
> v1:
> - Alloc hwpt instead of using auto hwpt
> - elaborate iommufd code per Nicolin
> - consolidate two patches and drop as.c
> - typo error fix and function rename
> 
> rfcv4:
> - rebase on top of v8.0.3
> - Add one patch from Yi which is about vfio device add in kvm
> - Remove IOAS_COPY optimization and focus on functions in this patchset
> - Fix wrong name issue reported and fix suggested by Matthew
> - Fix compilation issue reported and fix sugggsted by Nicolin
> - Use query_dirty_bitmap callback to replace get_dirty_bitmap for better
> granularity
> - Add dev_iter_next() callback to avoid adding so many callback
>    at container scope, add VFIODevice.hwpt to support that
> - Restore all functions back to common from container whenever possible,
>    mainly migration and reset related functions
> - Add --enable/disable-iommufd config option, enabled by default in linux
> - Remove VFIODevice.hwpt_next as it's redundant with VFIODevice.next
> - Adapt new VFIO_DEVICE_PCI_HOT_RESET uAPI for IOMMUFD backed device
> - vfio_kvm_device_add/del_group call vfio_kvm_device_add/del_fd to remove
> redundant code
> - Add FD passing support for vfio device backed by IOMMUFD
> - Fix hot unplug resource leak issue in vfio_legacy_detach_device()
> - Fix FD leak in vfio_get_devicefd()
> 
> rfcv3:
> - rebase on top of v7.2.0
> - Fix the compilation with CONFIG_IOMMUFD unset by using true classes for
>    VFIO backends
> - Fix use after free in error path, reported by Alister
> - Split common.c in several steps to ease the review
> 
> rfcv2:
> - remove the first three patches of rfcv1
> - add open cdev helper suggested by Jason
> - remove the QOMification of the VFIOContainer and simply use standard ops
> (David)
> - add "-object iommufd" suggested by Alex
> 
> Thanks
> Zhenzhong
> 
> 
> Eric Auger (7):
>    scripts/update-linux-headers: Add iommufd.h
>    vfio/common: Propagate KVM_SET_DEVICE_ATTR error if any
>    vfio/common: Introduce vfio_container_add|del_section_window()
>    vfio/pci: Introduce vfio_[attach/detach]_device
>    vfio/platform: Use vfio_[attach/detach]_device
>    vfio/ap: Use vfio_[attach/detach]_device
>    vfio/ccw: Use vfio_[attach/detach]_device
> 
> Yi Liu (2):
>    vfio/common: Move IOMMU agnostic helpers to a separate file
>    vfio/common: Move legacy VFIO backend code into separate container.c
> 
> Zhenzhong Duan (6):
>    linux-headers: Add iommufd.h
>    vfio/common: Extract out vfio_kvm_device_[add/del]_fd
>    vfio/common: Move VFIO reset handler registration to a group agnostic
>      function
>    vfio/common: Introduce a per container device list
>    vfio/common: Store the parent container in VFIODevice
>    vfio/common: Introduce a global VFIODevice list
> 
>   include/hw/vfio/vfio-common.h   |   60 +-
>   linux-headers/linux/iommufd.h   |  444 ++++++++
>   hw/vfio/ap.c                    |   69 +-
>   hw/vfio/ccw.c                   |  122 +-
>   hw/vfio/common.c                | 1851 ++-----------------------------
>   hw/vfio/container.c             | 1157 +++++++++++++++++++
>   hw/vfio/helpers.c               |  612 ++++++++++
>   hw/vfio/pci.c                   |   67 +-
>   hw/vfio/platform.c              |   43 +-
>   hw/vfio/meson.build             |    2 +
>   hw/vfio/trace-events            |    4 +-
>   scripts/update-linux-headers.sh |    3 +-
>   12 files changed, 2458 insertions(+), 1976 deletions(-)
>   create mode 100644 linux-headers/linux/iommufd.h
>   create mode 100644 hw/vfio/container.c
>   create mode 100644 hw/vfio/helpers.c
> 



  parent reply	other threads:[~2023-10-04 19:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04 15:43 [PATCH v4 00/15] Prerequisite changes for IOMMUFD support Eric Auger
2023-10-04 15:43 ` [PATCH v4 01/15] scripts/update-linux-headers: Add iommufd.h Eric Auger
2023-10-04 15:43 ` [PATCH v4 02/15] linux-headers: " Eric Auger
2023-10-04 15:43 ` [PATCH v4 03/15] vfio/common: Move IOMMU agnostic helpers to a separate file Eric Auger
2023-10-04 15:43 ` [PATCH v4 04/15] vfio/common: Propagate KVM_SET_DEVICE_ATTR error if any Eric Auger
2023-10-04 15:43 ` [PATCH v4 05/15] vfio/common: Introduce vfio_container_add|del_section_window() Eric Auger
2023-10-04 15:43 ` [PATCH v4 06/15] vfio/common: Extract out vfio_kvm_device_[add/del]_fd Eric Auger
2023-10-04 15:43 ` [PATCH v4 07/15] vfio/pci: Introduce vfio_[attach/detach]_device Eric Auger
2023-10-04 15:43 ` [PATCH v4 08/15] vfio/platform: Use vfio_[attach/detach]_device Eric Auger
2023-10-04 15:43 ` [PATCH v4 09/15] vfio/ap: " Eric Auger
2023-10-04 15:43 ` [PATCH v4 10/15] vfio/ccw: " Eric Auger
2023-10-08 10:21   ` Duan, Zhenzhong
2023-10-08 17:45     ` Eric Auger
2023-10-09  1:25       ` Duan, Zhenzhong
2023-10-09  8:14         ` Eric Auger
2023-10-09  8:25           ` Duan, Zhenzhong
2023-10-04 15:43 ` [PATCH v4 11/15] vfio/common: Move VFIO reset handler registration to a group agnostic function Eric Auger
2023-10-04 15:43 ` [PATCH v4 12/15] vfio/common: Introduce a per container device list Eric Auger
2023-10-04 15:44 ` [PATCH v4 13/15] vfio/common: Store the parent container in VFIODevice Eric Auger
2023-10-04 17:05   ` Cédric Le Goater
2023-10-04 15:44 ` [PATCH v4 14/15] vfio/common: Introduce a global VFIODevice list Eric Auger
2023-10-04 17:05   ` Cédric Le Goater
2023-10-04 15:44 ` [PATCH v4 15/15] vfio/common: Move legacy VFIO backend code into separate container.c Eric Auger
2023-10-04 19:58 ` Cédric Le Goater [this message]
2023-10-05  6:55   ` [PATCH v4 00/15] Prerequisite changes for IOMMUFD support Eric Auger

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=81ead96c-e7e7-2d38-db77-264d7aee924a@redhat.com \
    --to=clg@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=chao.p.peng@intel.com \
    --cc=eric.auger.pro@gmail.com \
    --cc=eric.auger@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=joao.m.martins@oracle.com \
    --cc=kevin.tian@intel.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=nicolinc@nvidia.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yi.l.liu@intel.com \
    --cc=yi.y.sun@intel.com \
    --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).