[Intel-gfx] [PATCH v15 26/26] docs: vfio: Add vfio device cdev description

2023-07-18 Thread Yi Liu
This gives notes for userspace applications on device cdev usage. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- Documentation/driver-api/vfio.rst | 139 ++ 1 file changed, 139 insertions(+) diff --git a/Documentation/driver-api

[Intel-gfx] [PATCH v15 25/26] vfio: Compile vfio_group infrastructure optionally

2023-07-18 Thread Yi Liu
Tested-by: Terrence Xu Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/iommu/iommufd/Kconfig | 4 +- drivers/vfio/Kconfig | 15 ++ drivers/vfio/Makefile | 2 +- drivers/vfio/vfio.h | 89 --- include/linux/vfio.h

[Intel-gfx] [PATCH v15 22/26] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-07-18 Thread Yi Liu
Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Terrence Xu Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/device_cdev.c | 107 + drivers/vfio/vfio.h| 13 + drivers/vfio

[Intel-gfx] [PATCH v15 21/26] vfio: Avoid repeated user pointer cast in vfio_device_fops_unl_ioctl()

2023-07-18 Thread Yi Liu
This adds a local variable to store the user pointer cast result from arg. It avoids the repeated casts in the code when more ioctls are added. Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/vfio_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[Intel-gfx] [PATCH v15 23/26] vfio: Add VFIO_DEVICE_[AT|DE]TACH_IOMMUFD_PT

2023-07-18 Thread Yi Liu
Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Terrence Xu Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/device_cdev.c | 58 ++ drivers/vfio/vfio.h| 5 drivers/vfio/vfio_main.c

[Intel-gfx] [PATCH v15 24/26] vfio: Move the IOMMU_CAP_CACHE_COHERENCY check in __vfio_register_dev()

2023-07-18 Thread Yi Liu
for the physical devices that do not have IOMMU if the group code is not compiled as the cdev interface does not support such devices. Suggested-by: Jason Gunthorpe Reviewed-by: Jason Gunthorpe Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/group.c | 10

[Intel-gfx] [PATCH v15 17/26] vfio: Move device_del() before waiting for the last vfio_device registration refcount

2023-07-18 Thread Yi Liu
refcount increment while the device is going to be unregistered. Reviewed-by: Jason Gunthorpe Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/vfio_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c

[Intel-gfx] [PATCH v15 20/26] iommufd: Add iommufd_ctx_from_fd()

2023-07-18 Thread Yi Liu
It's common to get a reference to the iommufd context from a given file descriptor. So adds an API for it. Existing users of this API are compiled only when IOMMUFD is enabled, so no need to have a stub for the IOMMUFD disabled case. Signed-off-by: Yi Liu --- drivers/iommu/iommufd/main.c | 24

[Intel-gfx] [PATCH v15 15/26] vfio-iommufd: Add detach_ioas support for emulated VFIO devices

2023-07-18 Thread Yi Liu
This prepares for adding DETACH ioctl for emulated VFIO devices. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi

[Intel-gfx] [PATCH v15 19/26] vfio: Test kvm pointer in _vfio_device_get_kvm_safe()

2023-07-18 Thread Yi Liu
This saves some lines when adding the kvm get logic for the vfio_device cdev path. This also renames _vfio_device_get_kvm_safe() to be vfio_device_get_kvm_safe(). Suggested-by: Jason Gunthorpe Reviewed-by: Jason Gunthorpe Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio

[Intel-gfx] [PATCH v15 09/26] vfio: Make vfio_df_open() single open for device cdev path

2023-07-18 Thread Yi Liu
colin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/group.c | 2 ++ drivers/vfio/vfio.h | 1 + drivers/vfio/vfio_main.c | 7 +++ 3 files changed, 10 insertions(+) diff --git a/dr

[Intel-gfx] [PATCH v15 16/26] vfio: Move vfio_device_group_unregister() to be the first operation in unregister

2023-07-18 Thread Yi Liu
-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/vfio_main.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index c71c0d1a079f..6d45caa1f9a0 100644 --- a/drivers/vfio/vfio_main.c +++ b/drivers/vfio/vfio_main.c

[Intel-gfx] [PATCH v15 13/26] vfio-iommufd: Add detach_ioas support for physical VFIO devices

2023-07-18 Thread Yi Liu
This prepares for adding DETACH ioctl for physical VFIO devices. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi

[Intel-gfx] [PATCH v15 08/26] vfio: Add cdev_device_open_cnt to vfio_group

2023-07-18 Thread Yi Liu
Duan Signed-off-by: Yi Liu --- drivers/vfio/group.c | 33 + drivers/vfio/vfio.h | 3 +++ 2 files changed, 36 insertions(+) diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c index 088dd34c8931..2751d61689c4 100644 --- a/drivers/vfio/group.c +++ b/drivers

[Intel-gfx] [PATCH v15 07/26] vfio: Block device access via device fd until device is opened

2023-07-18 Thread Yi Liu
thorpe Reviewed-by: Eric Auger Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/group.c | 11 ++- drivers/vfio/vfio.h | 1 + driver

[Intel-gfx] [PATCH v15 05/26] kvm/vfio: Accept vfio device file from userspace

2023-07-18 Thread Yi Liu
-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- Documentation/virt/kvm/devices/vfio.rst | 47 - include/uapi/linux/kvm.h| 13 +-- virt/kvm/vfio.c | 12 +++ 3 files changed, 47 insertions(+), 25 deletions

[Intel-gfx] [PATCH v15 12/26] vfio: Record devid in vfio_device_file

2023-07-18 Thread Yi Liu
Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/iommufd.c | 12 +++- drivers/vfio/vfio.h | 10 +- drivers/vfio/vfio_main.c | 6 +++--- 3 files changed, 15 insertions(+), 13

[Intel-gfx] [PATCH v15 18/26] vfio: Add cdev for vfio_device

2023-07-18 Thread Yi Liu
um Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/Kconfig | 12 drivers/vfio/Makefile | 1 + drivers/vfio/device_cdev.c | 63 ++ drivers/vfio/vfio.h| 54 drivers/vfio/vfio_mai

[Intel-gfx] [PATCH v15 14/26] iommufd/device: Add iommufd_access_detach() API

2023-07-18 Thread Yi Liu
rick. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu --- drivers/iommu/iommu

[Intel-gfx] [PATCH v15 11/26] vfio-iommufd: Split bind/attach into two steps

2023-07-18 Thread Yi Liu
-off-by: Yi Liu --- drivers/vfio/group.c | 17 + drivers/vfio/iommufd.c | 35 +-- drivers/vfio/vfio.h| 9 + 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c index b8b77daf7aa6

[Intel-gfx] [PATCH v15 10/26] vfio-iommufd: Move noiommu compat validation out of vfio_iommufd_bind()

2023-07-18 Thread Yi Liu
Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/group.c | 13 + drivers/vfio/iommufd.c | 22 -- drivers/vfio/vfio.h| 9 + 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/drivers

[Intel-gfx] [PATCH v15 04/26] kvm/vfio: Prepare for accepting vfio device fd

2023-07-18 Thread Yi Liu
Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- virt/kvm/vfio.c | 115 1 file changed, 58 insertions(+), 57 deletions(-) diff --git a/virt/kvm/vfio.c b/virt/kvm/vfio.c index b33c7b8488b3..8f7fa07e8170 100644

[Intel-gfx] [PATCH v15 06/26] vfio: Pass struct vfio_device_file * to vfio_device_open/close()

2023-07-18 Thread Yi Liu
Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/group.c | 20 ++-- drivers/vfio/vfio.h | 8 drivers/vfio/vfio_main.c | 25 +++-- 3 files changed, 33 insertions(+), 20

[Intel-gfx] [PATCH v15 03/26] vfio: Accept vfio device file in the KVM facing kAPI

2023-07-18 Thread Yi Liu
-by: Yi Liu --- drivers/vfio/vfio.h | 3 +++ drivers/vfio/vfio_main.c | 36 +++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/vfio.h b/drivers/vfio/vfio.h index b1e327a85a32..332528af0846 100644 --- a/drivers/vfio/vfio.h +++ b

[Intel-gfx] [PATCH v15 02/26] vfio: Refine vfio file kAPIs for KVM

2023-07-18 Thread Yi Liu
-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/group.c | 53 +--- drivers/vfio/vfio.h

[Intel-gfx] [PATCH v15 01/26] vfio: Allocate per device file structure

2023-07-18 Thread Yi Liu
Tian Reviewed-by: Eric Auger Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/group.c | 13 +++-- drivers

[Intel-gfx] [PATCH v15 00/26] Add vfio_device cdev for iommufd support

2023-07-18 Thread Yi Liu
ct and device file reference. (JasonG) - Address comments from KevinT - Remained the ioctl for detach, needs to Alex's taste (https://lore.kernel.org/kvm/bn9pr11mb5276be9f4b0613ee859317028c...@bn9pr11mb5276.namprd11.prod.outlook.com/) rfc: https://lore.kernel.org/kvm/20221219084718.9342-1-y

[Intel-gfx] [PATCH v10 10/10] vfio/pci: Allow passing zero-length fd array in VFIO_DEVICE_PCI_HOT_RESET

2023-07-18 Thread Yi Liu
Gunthorpe Tested-by: Yanting Jiang Tested-by: Zhenzhong Duan Signed-off-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 61 ++-- include/uapi/linux/vfio.h| 21 +++ 2 files changed, 71 insertions(+), 11 deletions

[Intel-gfx] [PATCH v10 07/10] vfio: Add helper to search vfio_device in a dev_set

2023-07-18 Thread Yi Liu
the return of vfio_pci_try_zap_and_vma_lock_cb(). However, it makes more sense to return -ENODEV. Suggested-by: Alex Williamson Reviewed-by: Jason Gunthorpe Tested-by: Yanting Jiang Tested-by: Terrence Xu Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 6 +- dr

[Intel-gfx] [PATCH v10 09/10] vfio/pci: Copy hot-reset device info to userspace in the devices loop

2023-07-18 Thread Yi Liu
to userspace. Suggested-by: Jason Gunthorpe Tested-by: Yanting Jiang Tested-by: Zhenzhong Duan Signed-off-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 93 1 file changed, 33 insertions(+), 60 deletions(-) diff --git

[Intel-gfx] [PATCH v10 04/10] iommufd: Add iommufd_ctx_has_group()

2023-07-18 Thread Yi Liu
-by: Jason Gunthorpe Tested-by: Yanting Jiang Tested-by: Terrence Xu Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/iommu/iommufd/device.c | 30 ++ include/linux/iommufd.h| 2 ++ 2 files changed, 32 insertions(+) diff --git a/drivers/iommu/iommufd

[Intel-gfx] [PATCH v10 06/10] vfio: Mark cdev usage in vfio_device

2023-07-18 Thread Yi Liu
Jiang Tested-by: Terrence Xu Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- include/linux/vfio.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/linux/vfio.h b/include/linux/vfio.h index 2c137ea94a3e..2a45853773a6 100644 --- a/include/linux/vfio.h +++ b/include/linux

[Intel-gfx] [PATCH v10 03/10] iommufd: Reserve all negative IDs in the iommufd xarray

2023-07-18 Thread Yi Liu
Duan Signed-off-by: Yi Liu --- drivers/iommu/iommufd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/iommufd/main.c b/drivers/iommu/iommufd/main.c index 3fbe636c3d8a..32ce7befc8dd 100644 --- a/drivers/iommu/iommufd/main.c +++ b/drivers/iommu/iommufd/main.c

[Intel-gfx] [PATCH v10 02/10] vfio/pci: Move the existing hot reset logic to be a helper

2023-07-18 Thread Yi Liu
Jiang Tested-by: Terrence Xu Tested-by: Zhenzhong Duan Signed-off-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 55 +++- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio

[Intel-gfx] [PATCH v10 05/10] iommufd: Add helper to retrieve iommufd_ctx and devid

2023-07-18 Thread Yi Liu
This is needed by the vfio-pci driver to report affected devices in the hot-reset for a given device. Reviewed-by: Jason Gunthorpe Tested-by: Yanting Jiang Tested-by: Terrence Xu Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu --- drivers/iommu/iommufd/device.c | 12 include

[Intel-gfx] [PATCH v10 08/10] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-07-18 Thread Yi Liu
virtue of being directly bound to the same iommufd context as the calling device, or implicitly owned via a shared IOMMU group. Suggested-by: Jason Gunthorpe Suggested-by: Alex Williamson Reviewed-by: Jason Gunthorpe Tested-by: Yanting Jiang Tested-by: Zhenzhong Duan Signed-off-by: Yi Liu

[Intel-gfx] [PATCH v10 01/10] vfio/pci: Update comment around group_fd get in vfio_pci_ioctl_pci_hot_reset()

2023-07-18 Thread Yi Liu
This suits more on what the code does. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Reviewed-by: Eric Auger Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers

[Intel-gfx] [PATCH v10 00/10] Enhance vfio PCI hot reset for vfio cdev device

2023-07-18 Thread Yi Liu
tch 10 to introduce a new _INFO ioctl for the usage of device fd passing usage in cdev path (Jason, Alex) v1: https://lore.kernel.org/kvm/20230316124156.12064-1-yi.l@intel.com/ Regards, Yi Liu Yi Liu (10): vfio/pci: Update comment around group_fd get in vfio_pci_ioctl_pci_hot

[Intel-gfx] [PATCH v14 26/26] docs: vfio: Add vfio device cdev description

2023-07-10 Thread Yi Liu
This gives notes for userspace applications on device cdev usage. Reviewed-by: Kevin Tian Signed-off-by: Yi Liu --- Documentation/driver-api/vfio.rst | 139 ++ 1 file changed, 139 insertions(+) diff --git a/Documentation/driver-api/vfio.rst b/Documentation/driver

[Intel-gfx] [PATCH v14 23/26] vfio: Add VFIO_DEVICE_[AT|DE]TACH_IOMMUFD_PT

2023-07-10 Thread Yi Liu
Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Terrence Xu Signed-off-by: Yi Liu --- drivers/vfio/device_cdev.c | 58 ++ drivers/vfio/vfio.h| 5 drivers/vfio/vfio_main.c | 15 +- include/uapi/linux/vfio.h | 44

[Intel-gfx] [PATCH v14 24/26] vfio: Move the IOMMU_CAP_CACHE_COHERENCY check in __vfio_register_dev()

2023-07-10 Thread Yi Liu
for the physical devices that do not have IOMMU if the group code is not compiled as the cdev interface does not support such devices. Suggested-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/group.c | 10 -- drivers/vfio/vfio_main.c | 11 +++ 2 files changed, 11

[Intel-gfx] [PATCH v14 20/26] iommufd: Add iommufd_ctx_from_fd()

2023-07-10 Thread Yi Liu
It's common to get a reference to the iommufd context from a given file descriptor. So adds an API for it. Existing users of this API are compiled only when IOMMUFD is enabled, so no need to have a stub for the IOMMUFD disabled case. Signed-off-by: Yi Liu --- drivers/iommu/iommufd/main.c | 23

[Intel-gfx] [PATCH v14 21/26] vfio: Avoid repeated user pointer cast in vfio_device_fops_unl_ioctl()

2023-07-10 Thread Yi Liu
This adds a local variable to store the user pointer cast result from arg. It avoids the repeated casts in the code when more ioctls are added. Signed-off-by: Yi Liu --- drivers/vfio/vfio_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/vfio_main.c b

[Intel-gfx] [PATCH v14 12/26] vfio: Record devid in vfio_device_file

2023-07-10 Thread Yi Liu
Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/iommufd.c | 12 +++- drivers/vfio/vfio.h | 10 +- drivers/vfio/vfio_main.c | 6 +++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git

[Intel-gfx] [PATCH v14 22/26] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-07-10 Thread Yi Liu
Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Terrence Xu Signed-off-by: Yi Liu --- drivers/vfio/device_cdev.c | 107 + drivers/vfio/vfio.h| 13 + drivers/vfio/vfio_main.c | 5 ++ include

[Intel-gfx] [PATCH v14 25/26] vfio: Compile vfio_group infrastructure optionally

2023-07-10 Thread Yi Liu
Tested-by: Terrence Xu Signed-off-by: Yi Liu --- drivers/iommu/iommufd/Kconfig | 4 +- drivers/vfio/Kconfig | 15 ++ drivers/vfio/Makefile | 2 +- drivers/vfio/vfio.h | 89 --- include/linux/vfio.h | 25 -- 5 files

[Intel-gfx] [PATCH v14 18/26] vfio: Add cdev for vfio_device

2023-07-10 Thread Yi Liu
Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/Kconfig | 12 drivers/vfio/Makefile | 1 + drivers/vfio/device_cdev.c | 63 ++ drivers/v

[Intel-gfx] [PATCH v14 11/26] vfio-iommufd: Split bind/attach into two steps

2023-07-10 Thread Yi Liu
This aligns the bind/attach logic with the coming vfio device cdev support. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers

[Intel-gfx] [PATCH v14 14/26] iommufd/device: Add iommufd_access_detach() API

2023-07-10 Thread Yi Liu
rick. Reviewed-by: Kevin Tian Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu --- drivers/iommu/iommufd/device.c | 74 +++

[Intel-gfx] [PATCH v14 19/26] vfio: Test kvm pointer in _vfio_device_get_kvm_safe()

2023-07-10 Thread Yi Liu
This saves some lines when adding the kvm get logic for the vfio_device cdev path. This also renames _vfio_device_get_kvm_safe() to be vfio_device_get_kvm_safe(). Suggested-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/group.c | 7 +-- drivers/vfio/vfio.h | 6

[Intel-gfx] [PATCH v14 10/26] vfio-iommufd: Move noiommu compat validation out of vfio_iommufd_bind()

2023-07-10 Thread Yi Liu
Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 13 + drivers/vfio/iommufd.c | 22 -- drivers/vfio/vfio.h| 9 + 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/drivers/vfio/group.c b/drivers/vfio

[Intel-gfx] [PATCH v14 16/26] vfio: Move vfio_device_group_unregister() to be the first operation in unregister

2023-07-10 Thread Yi Liu
-by: Yi Liu --- drivers/vfio/vfio_main.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index c71c0d1a079f..6d45caa1f9a0 100644 --- a/drivers/vfio/vfio_main.c +++ b/drivers/vfio/vfio_main.c @@ -332,6 +332,12 @@ void

[Intel-gfx] [PATCH v14 17/26] vfio: Move device_del() before waiting for the last vfio_device registration refcount

2023-07-10 Thread Yi Liu
refcount increment while the device is going to be unregistered. Signed-off-by: Yi Liu --- drivers/vfio/vfio_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index 6d45caa1f9a0..294bb5ecfc1c 100644 --- a/drivers

[Intel-gfx] [PATCH v14 13/26] vfio-iommufd: Add detach_ioas support for physical VFIO devices

2023-07-10 Thread Yi Liu
This prepares for adding DETACH ioctl for physical VFIO devices. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- Documentation

[Intel-gfx] [PATCH v14 15/26] vfio-iommufd: Add detach_ioas support for emulated VFIO devices

2023-07-10 Thread Yi Liu
This prepares for adding DETACH ioctl for emulated VFIO devices. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/gpu/drm

[Intel-gfx] [PATCH v14 05/26] kvm/vfio: Accept vfio device file from userspace

2023-07-10 Thread Yi Liu
-by: Shameer Kolothum Signed-off-by: Yi Liu --- Documentation/virt/kvm/devices/vfio.rst | 47 - include/uapi/linux/kvm.h| 13 +-- virt/kvm/vfio.c | 12 +++ 3 files changed, 47 insertions(+), 25 deletions(-) diff --git

[Intel-gfx] [PATCH v14 08/26] vfio: Add cdev_device_open_cnt to vfio_group

2023-07-10 Thread Yi Liu
devices within the same group may be opened via different paths. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Reviewed-by: Eric Auger Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu

[Intel-gfx] [PATCH v14 09/26] vfio: Make vfio_df_open() single open for device cdev path

2023-07-10 Thread Yi Liu
colin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 2 ++ drivers/vfio/vfio.h | 1 + drivers/vfio/vfio_main.c | 7 +++ 3 files changed, 10 insertions(+) diff --git a/drivers/vfio/group.c b/dr

[Intel-gfx] [PATCH v14 04/26] kvm/vfio: Prepare for accepting vfio device fd

2023-07-10 Thread Yi Liu
Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- virt/kvm/vfio.c | 115 1 file changed, 58 insertions(+), 57 deletions(-) diff --git a/virt/kvm/vfio.c b/virt/kvm/vfio.c index b33c7b8488b3..8f7fa07e8170 100644 --- a/virt/kvm/vfio.c +++ b

[Intel-gfx] [PATCH v14 07/26] vfio: Block device access via device fd until device is opened

2023-07-10 Thread Yi Liu
thorpe Reviewed-by: Eric Auger Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 11 ++- drivers/vfio/vfio.h | 1 + drivers/vfio/vfio_main.

[Intel-gfx] [PATCH v14 06/26] vfio: Pass struct vfio_device_file * to vfio_device_open/close()

2023-07-10 Thread Yi Liu
Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 20 ++-- drivers/vfio/vfio.h | 8 drivers/vfio/vfio_main.c | 25 +++-- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git

[Intel-gfx] [PATCH v14 03/26] vfio: Accept vfio device file in the KVM facing kAPI

2023-07-10 Thread Yi Liu
will be set to vfio_device after device file is bound to iommufd in the cdev path. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers

[Intel-gfx] [PATCH v14 02/26] vfio: Refine vfio file kAPIs for KVM

2023-07-10 Thread Yi Liu
-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 53 +--- drivers/vfio/vfio.h | 3 +++ drivers/vfio

[Intel-gfx] [PATCH v14 01/26] vfio: Allocate per device file structure

2023-07-10 Thread Yi Liu
Tian Reviewed-by: Eric Auger Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 13 +++-- drivers/vfio/vfio.h | 6

[Intel-gfx] [PATCH v14 00/26] Add vfio_device cdev for iommufd support

2023-07-10 Thread Yi Liu
6.namprd11.prod.outlook.com/) rfc: https://lore.kernel.org/kvm/20221219084718.9342-1-yi.l@intel.com/ Thanks, Yi Liu Nicolin Chen (1): iommufd/device: Add iommufd_access_detach() API Yi Liu (25): vfio: Allocate per device file structure vfio: Refine vfio file kAPIs for KVM vfio

[Intel-gfx] [PATCH v9 04/10] iommufd: Add iommufd_ctx_has_group()

2023-07-10 Thread Yi Liu
-by: Terrence Xu Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/iommu/iommufd/device.c | 30 ++ include/linux/iommufd.h| 2 ++ 2 files changed, 32 insertions(+) diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c index

[Intel-gfx] [PATCH v9 08/10] vfio/pci: Extend VFIO_DEVICE_GET_PCI_HOT_RESET_INFO for vfio device cdev

2023-07-10 Thread Yi Liu
virtue of being directly bound to the same iommufd context as the calling device, or implicitly owned via a shared IOMMU group. Suggested-by: Jason Gunthorpe Suggested-by: Alex Williamson Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/iommufd.c | 44

[Intel-gfx] [PATCH v9 06/10] vfio: Mark cdev usage in vfio_device

2023-07-10 Thread Yi Liu
This can be used to differentiate whether to report group_id or devid in the revised VFIO_DEVICE_GET_PCI_HOT_RESET_INFO ioctl. At this moment, no cdev path yet, so the vfio_device_cdev_opened() helper always returns false. Reviewed-by: Kevin Tian Tested-by: Terrence Xu Signed-off-by: Yi Liu

[Intel-gfx] [PATCH v9 07/10] vfio: Add helper to search vfio_device in a dev_set

2023-07-10 Thread Yi Liu
the return of vfio_pci_try_zap_and_vma_lock_cb(). However, it makes more sense to return -ENODEV. Suggested-by: Alex Williamson Tested-by: Terrence Xu Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 6 +- drivers/vfio/vfio_main.c | 15 ++

[Intel-gfx] [PATCH v9 05/10] iommufd: Add helper to retrieve iommufd_ctx and devid

2023-07-10 Thread Yi Liu
This is needed by the vfio-pci driver to report affected devices in the hot-reset for a given device. Tested-by: Terrence Xu Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/iommu/iommufd/device.c | 12 include/linux/iommufd.h| 3 +++ 2 files changed, 15

[Intel-gfx] [PATCH v9 01/10] vfio/pci: Update comment around group_fd get in vfio_pci_ioctl_pci_hot_reset()

2023-07-10 Thread Yi Liu
This suits more on what the code does. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Reviewed-by: Eric Auger Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers

[Intel-gfx] [PATCH v9 10/10] vfio/pci: Allow passing zero-length fd array in VFIO_DEVICE_PCI_HOT_RESET

2023-07-10 Thread Yi Liu
Gunthorpe Reviewed-by: Jason Gunthorpe Tested-by: Yanting Jiang Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 61 ++-- include/uapi/linux/vfio.h| 21 +++ 2 files changed, 71 insertions(+), 11 deletions(-) diff --git a/drivers/vfio/pci

[Intel-gfx] [PATCH v9 03/10] iommufd: Reserve all negative IDs in the iommufd xarray

2023-07-10 Thread Yi Liu
With this reservation, IOMMUFD users can encode the negative IDs for specific purposes. e.g. VFIO needs two reserved values to tell userspace the ID returned is not valid but has other meaning. Tested-by: Terrence Xu Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/iommu/iommufd

[Intel-gfx] [PATCH v9 00/10] Enhance vfio PCI hot reset for vfio cdev device

2023-07-10 Thread Yi Liu
x) v1: https://lore.kernel.org/kvm/20230316124156.12064-1-yi.l@intel.com/ Regards, Yi Liu Yi Liu (10): vfio/pci: Update comment around group_fd get in vfio_pci_ioctl_pci_hot_reset() vfio/pci: Move the existing hot reset logic to be a helper iommufd: Reserve all negati

[Intel-gfx] [PATCH v9 09/10] vfio/pci: Copy hot-reset device info to userspace in the devices loop

2023-07-10 Thread Yi Liu
to userspace. Suggested-by: Jason Gunthorpe Signed-off-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 93 1 file changed, 33 insertions(+), 60 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci

[Intel-gfx] [PATCH v9 02/10] vfio/pci: Move the existing hot reset logic to be a helper

2023-07-10 Thread Yi Liu
-by: Kevin Tian Tested-by: Yanting Jiang Tested-by: Terrence Xu Signed-off-by: Yi Liu --- drivers/vfio/pci/vfio_pci_core.c | 55 +++- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index

[Intel-gfx] [PATCH v13 22/22] docs: vfio: Add vfio device cdev description

2023-06-16 Thread Yi Liu
This gives notes for userspace applications on device cdev usage. Reviewed-by: Kevin Tian Signed-off-by: Yi Liu --- Documentation/driver-api/vfio.rst | 139 ++ 1 file changed, 139 insertions(+) diff --git a/Documentation/driver-api/vfio.rst b/Documentation/driver

[Intel-gfx] [PATCH v13 19/22] vfio: Add VFIO_DEVICE_[AT|DE]TACH_IOMMUFD_PT

2023-06-16 Thread Yi Liu
noiommu devices, hence noiommu devices do not support [AT|DE]TACH. Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Terrence Xu Signed-off-by: Yi Liu --- drivers/vfio/device_cdev.c | 66 ++ drivers

[Intel-gfx] [PATCH v13 21/22] vfio: Compile vfio_group infrastructure optionally

2023-06-16 Thread Yi Liu
-off-by: Yi Liu --- drivers/iommu/iommufd/Kconfig | 4 +- drivers/vfio/Kconfig | 15 ++ drivers/vfio/Makefile | 2 +- drivers/vfio/vfio.h | 89 --- include/linux/vfio.h | 25 -- 5 files changed, 123 insertions(+), 12

[Intel-gfx] [PATCH v13 20/22] vfio: Move the IOMMU_CAP_CACHE_COHERENCY check in __vfio_register_dev()

2023-06-16 Thread Yi Liu
for the physical devices that do not have IOMMU if the group code is not compiled as the cdev interface does not support such devices. Suggested-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/vfio/group.c | 10 -- drivers/vfio/vfio_main.c | 11 +++ 2 files changed, 11

[Intel-gfx] [PATCH v13 18/22] vfio: Add VFIO_DEVICE_BIND_IOMMUFD

2023-06-16 Thread Yi Liu
on cdev fds. cdev does not support noiommu devices, hence noiommu devices do not support BIND. Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Terrence Xu Signed-off-by: Yi Liu --- drivers/vfio/device_cdev.c | 123

[Intel-gfx] [PATCH v13 17/22] vfio: Add cdev for vfio_device

2023-06-16 Thread Yi Liu
en Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/Kconfig | 12 drivers/vfio/Makefile | 1 + drivers/vfio/device_cdev.c | 62 ++ drivers/vfio/vfio.h

[Intel-gfx] [PATCH v13 16/22] vfio: Move vfio_device_group_unregister() to be the first operation in unregister

2023-06-16 Thread Yi Liu
This avoids endless vfio_device refcount increasement by userspace, which would keep blocking the vfio_unregister_group_dev(). Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Tested-by: Terrence Xu Signed-off-by: Yi Liu --- drivers

[Intel-gfx] [PATCH v13 15/22] vfio-iommufd: Add detach_ioas support for emulated VFIO devices

2023-06-16 Thread Yi Liu
This prepares for adding DETACH ioctl for emulated VFIO devices. Reviewed-by: Kevin Tian Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/gpu/drm/i915/gvt/kvmgt.c | 1

[Intel-gfx] [PATCH v13 14/22] iommufd/device: Add iommufd_access_detach() API

2023-06-16 Thread Yi Liu
rick. Reviewed-by: Kevin Tian Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu --- drivers/iommu/iommufd/device.c | 76 +++

[Intel-gfx] [PATCH v13 13/22] vfio-iommufd: Add detach_ioas support for physical VFIO devices

2023-06-16 Thread Yi Liu
This prepares for adding DETACH ioctl for physical VFIO devices. Reviewed-by: Kevin Tian Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- Documentation/driver-api/vfio.rst

[Intel-gfx] [PATCH v13 12/22] vfio: Record devid in vfio_device_file

2023-06-16 Thread Yi Liu
-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/iommufd.c | 12 +++- drivers/vfio/vfio.h | 10 +- drivers/vfio/vfio_main.c | 6 +++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/vfio/iommufd.c b/drivers

[Intel-gfx] [PATCH v13 11/22] vfio-iommufd: Split bind/attach into two steps

2023-06-16 Thread Yi Liu
This aligns the bind/attach logic with the coming vfio device cdev support. Reviewed-by: Kevin Tian Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 17

[Intel-gfx] [PATCH v13 10/22] vfio-iommufd: Move noiommu compat validation out of vfio_iommufd_bind()

2023-06-16 Thread Yi Liu
Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 13 + drivers/vfio/iommufd.c | 22 -- drivers/vfio/vfio.h| 9 + 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c index 4e6277191eb4

[Intel-gfx] [PATCH v13 09/22] vfio: Make vfio_df_open() single open for device cdev path

2023-06-16 Thread Yi Liu
colin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 2 ++ drivers/vfio/vfio.h | 1 + drivers/vfio/vfio_main.c | 7 +++ 3 files changed, 10 insertions(+) diff --git a/drivers/vfio/group.c b/dr

[Intel-gfx] [PATCH v13 08/22] vfio: Add cdev_device_open_cnt to vfio_group

2023-06-16 Thread Yi Liu
devices within the same group may be opened via different paths. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Reviewed-by: Eric Auger Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu

[Intel-gfx] [PATCH v13 06/22] vfio: Pass struct vfio_device_file * to vfio_device_open/close()

2023-06-16 Thread Yi Liu
Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 20 ++-- drivers/vfio/vfio.h | 8 drivers/vfio/vfio_main.c | 25 +++-- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git

[Intel-gfx] [PATCH v13 07/22] vfio: Block device access via device fd until device is opened

2023-06-16 Thread Yi Liu
thorpe Reviewed-by: Eric Auger Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 11 ++- drivers/vfio/vfio.h | 1 + drivers/vfio/vfio_main.

[Intel-gfx] [PATCH v13 03/22] vfio: Accept vfio device file in the KVM facing kAPI

2023-06-16 Thread Yi Liu
will be set to vfio_device after device file is bound to iommufd in the cdev path. Reviewed-by: Kevin Tian Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers

[Intel-gfx] [PATCH v13 04/22] kvm/vfio: Prepare for accepting vfio device fd

2023-06-16 Thread Yi Liu
Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- virt/kvm/vfio.c | 115 1 file changed, 58 insertions(+), 57 deletions(-) diff --git a/virt/kvm/vfio.c b/virt/kvm/vfio.c index b33c7b8488b3..8f7fa07e8170 100644 --- a/virt/kvm/vfio.c +++ b

[Intel-gfx] [PATCH v13 05/22] kvm/vfio: Accept vfio device file from userspace

2023-06-16 Thread Yi Liu
-by: Shameer Kolothum Signed-off-by: Yi Liu --- Documentation/virt/kvm/devices/vfio.rst | 47 - include/uapi/linux/kvm.h| 13 +-- virt/kvm/vfio.c | 12 +++ 3 files changed, 47 insertions(+), 25 deletions(-) diff --git

[Intel-gfx] [PATCH v13 02/22] vfio: Refine vfio file kAPIs for KVM

2023-06-16 Thread Yi Liu
-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 53 +--- drivers/vfio/vfio.h | 3 +++ drivers/vfio

[Intel-gfx] [PATCH v13 01/22] vfio: Allocate per device file structure

2023-06-16 Thread Yi Liu
Tian Reviewed-by: Eric Auger Reviewed-by: Jason Gunthorpe Tested-by: Terrence Xu Tested-by: Nicolin Chen Tested-by: Matthew Rosato Tested-by: Yanting Jiang Tested-by: Shameer Kolothum Signed-off-by: Yi Liu --- drivers/vfio/group.c | 13 +++-- drivers/vfio/vfio.h | 6

[Intel-gfx] [PATCH v13 00/22] Add vfio_device cdev for iommufd support

2023-06-16 Thread Yi Liu
mprd11.prod.outlook.com/) rfc: https://lore.kernel.org/kvm/20221219084718.9342-1-yi.l@intel.com/ Thanks, Yi Liu Nicolin Chen (1): iommufd/device: Add iommufd_access_detach() API Yi Liu (21): vfio: Allocate per device file structure vfio: Refine vfio file kAPIs for KVM vfio

[Intel-gfx] [PATCH v8 03/10] iommufd: Reserve all negative IDs in the iommufd xarray

2023-06-16 Thread Yi Liu
With this reservation, IOMMUFD users can encode the negative IDs for specific purposes. e.g. VFIO needs two reserved values to tell userspace the ID returned is not valid but has other meaning. Tested-by: Terrence Xu Reviewed-by: Jason Gunthorpe Signed-off-by: Yi Liu --- drivers/iommu/iommufd

  1   2   3   4   5   >