RE: [PATCH v2] vfio/cdx: Fix missing detach_ioas op
From: Agarwal, Nikhil
Date: Wed Dec 02 2026 - 01:34:43 EST
> -----Original Message-----
> From: Ian Rogers <irogers@xxxxxxxxxx>
> Sent: Tuesday, December 1, 2026 10:56 PM
> To: Alex Williamson <alex@xxxxxxxxxxx>; Gupta, Nipun <Nipun.Gupta@xxxxxxx>;
> Agarwal, Nikhil <nikhil.agarwal@xxxxxxx>
> Cc: Jason Gunthorpe <jgg@xxxxxxxxxx>; Kevin Tian <kevin.tian@xxxxxxxxx>; Yi Liu
> <yi.l.liu@xxxxxxxxx>; Nathan Chancellor <nathan@xxxxxxxxxx>; kvm@xxxxxxxxxxxxxxx;
> llvm@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Ian Rogers
> <irogers@xxxxxxxxxx>
> Subject: [PATCH v2] vfio/cdx: Fix missing detach_ioas op
>
> 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>
Acked-by: Nikhil Agarwal <Nikhil.agarwal@xxxxxxx>