]> git.ipfire.org Git - thirdparty/linux.git/commit
vfio: Adapt drivers to use the core helper vfio_check_precopy_ioctl
authorYishai Hadas <yishaih@nvidia.com>
Tue, 17 Mar 2026 16:17:50 +0000 (18:17 +0200)
committerAlex Williamson <alex@shazbot.org>
Thu, 19 Mar 2026 18:32:09 +0000 (12:32 -0600)
commitc995498636c704641c9e809c31b59445b48f7adc
treeed6e9484b07d1922246bc1201df4822d3d596bcd
parent50ff3f404617c5d15832fec3711978104c4c9efd
vfio: Adapt drivers to use the core helper vfio_check_precopy_ioctl

Introduce a core helper function for VFIO_MIG_GET_PRECOPY_INFO and adapt
all drivers to use it.

It centralizes the common code and ensures that output flags are cleared
on entry, in case user opts in to VFIO_DEVICE_FEATURE_MIG_PRECOPY_INFOv2.
This preventing any unintended echoing of userspace data back to
userspace.

Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://lore.kernel.org/r/20260317161753.18964-4-yishaih@nvidia.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
drivers/vfio/pci/mlx5/main.c
drivers/vfio/pci/qat/main.c
drivers/vfio/pci/virtio/migrate.c
include/linux/vfio.h
samples/vfio-mdev/mtty.c