Re: [PATCH v9 5/6] vfio: Enable cdev noiommu mode under iommufd
From: Yi Liu
Date: Tue Jun 16 2026 - 01:52:45 EST
On 6/12/26 01:26, Jacob Pan wrote:
Now that devices under noiommu mode can bind with IOMMUFD and perform
IOAS operations, lift restrictions on cdev from VFIO side.
Use cases are documented in Documentation/driver-api/vfio.rst
Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
Signed-off-by: Jacob Pan <jacob.pan@xxxxxxxxxxxxxxxxxxx>
---
v9:
- Leave device->device.devt unset for no-IOMMU dev so cdev_device_add()
registers only the struct device and does not expose an unsupported
cdev. (Alex, Sashiko)
- Hold registration while checking cdev no-IOMMU access (Sashiko)
v8:
- Fix warning message (Kevin)
v7:
- Avoid treating emulated device as noiommu device (Sashiko)
- Keep platforms w/ GENERIC_ATOMIC64 to use VFIO group noiommu as
before (Sashiko)
- Restore order of group & cdev init for noiommu (Yi)
- Consolidate noiommu helper for cdev & group (Yi)
v6:
- Revert back to unified VFIO_NOIOMMU Kconfig for both cdev and group.
Use Kconfig dependency to restrict usages and avoid null group
checks. (Alex & Yi)
- Add CAP_SYS_RAWIO checks for cdev open to maintain security parity
with the group noiommu path. (Alex)
v5:
- Add Kconfig VFIO_CDEV_NOIOMMU to select IOMMUFD_NOIOMMU
and its dependencies
- Add comment to explain vfio_noiommu conditional definition (Alex)
- Removed early return for group noiommu in bind/unbind
- Use consistent wording referring to VFIO noiommu mode (Kevin)
- Update unsafe_noiommu Kconfig help text (Kevin)
- Change dev_warn to dev_info for noiommu enabling msg (Kevin)
v4:
- Remove early return in iommufd_bind for noiommu (Alex)
v3:
- Consolidate into fewer patches
v2:
- removed unnecessary device->noiommu set in
iommufd_vfio_compat_ioas_get_id()
---
drivers/vfio/Kconfig | 7 ++++---
drivers/vfio/device_cdev.c | 9 +++++++++
drivers/vfio/iommufd.c | 12 ++++++++----
drivers/vfio/vfio.h | 23 +++++++++--------------
drivers/vfio/vfio_main.c | 26 +++++++++++++++++++++++++-
include/linux/vfio.h | 1 +
6 files changed, 56 insertions(+), 22 deletions(-)
LGTM.
Reviewed-by: Yi Liu <yi.l.liu@xxxxxxxxx>