RE: [PATCH v2] vfio/cdx: Fix missing detach_ioas op

From: Tian, Kevin

Date: Thu Dec 03 2026 - 03:01:18 EST


> From: Ian Rogers <irogers@xxxxxxxxxx>
> Sent: Wednesday, December 2, 2026 1:26 AM
>
> vfio_cdx_ops sets bind_iommufd, unbind_iommufd, and attach_ioas to the
> vfio_iommufd_physical_* helpers, but omits detach_ioas. When
> CONFIG_IOMMUFD is enabled, __vfio_register_dev() checks
> !device->ops->detach_ioas and fails registration with WARN_ON() and
> -EINVAL during vfio_cdx_probe() -> vfio_register_group_dev().
>
> Commit 9048c7341c4d ("vfio-iommufd: Add detach_ioas support for physical
> VFIO devices") added detach_ioas across the other physical VFIO drivers
> while omitting vfio_cdx_ops.
>
> Add the missing vfio_iommufd_physical_detach_ioas callback, found with
> Clang's require_explicit_initialization attribute.
>
> Fixes: 9048c7341c4d ("vfio-iommufd: Add detach_ioas support for physical
> VFIO devices")
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>