[PATCH 0/2] iommufd: give hints to user about kernel support

Pierrick Bouvier posted 2 patches 2 weeks, 5 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260317225751.1325098-1-pierrick.bouvier@linaro.org
Maintainers: Yi Liu <yi.l.liu@intel.com>, Eric Auger <eric.auger@redhat.com>, Zhenzhong Duan <zhenzhong.duan@intel.com>, Alex Williamson <alex@shazbot.org>, "Cédric Le Goater" <clg@redhat.com>
There is a newer version of this series
backends/iommufd.c | 5 +++++
hw/vfio/iommufd.c  | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)
[PATCH 0/2] iommufd: give hints to user about kernel support
Posted by Pierrick Bouvier 2 weeks, 5 days ago
Using iommufd requires two different kernel config:
CONFIG_IOMMUFD and CONFIG_VFIO_DEVICE_CDEV
https://docs.kernel.org/driver-api/vfio.html#vfio-device-cdev

It can be complex to identify what is missing when trying to use it. This series
gives hints to user about it.

Suggested on:
https://lore.kernel.org/qemu-devel/0cc139d6-9289-44a0-9122-d701426dae0c@linaro.org/

Tested using a cross compiled QEMU and a custom kernel + debian rootfs [1].

[1] https://github.com/p-b-o/qemu-linux-stack/tree/device_passthrough

Pierrick Bouvier (2):
  backends/iommufd.c: report error when /dev/iommu is not available
  hw/vfio/iommufd.c: report hint to user when vfio-dev/vfio*/dev is
    missing

 backends/iommufd.c | 5 +++++
 hw/vfio/iommufd.c  | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.47.3
Re: [PATCH 0/2] iommufd: give hints to user about kernel support
Posted by Pierrick Bouvier 2 weeks, 5 days ago
On 3/17/26 3:57 PM, Pierrick Bouvier wrote:
> Using iommufd requires two different kernel config:
> CONFIG_IOMMUFD and CONFIG_VFIO_DEVICE_CDEV
> https://docs.kernel.org/driver-api/vfio.html#vfio-device-cdev
> 
> It can be complex to identify what is missing when trying to use it. This series
> gives hints to user about it.
> 
> Suggested on:
> https://lore.kernel.org/qemu-devel/0cc139d6-9289-44a0-9122-d701426dae0c@linaro.org/
> 
> Tested using a cross compiled QEMU and a custom kernel + debian rootfs [1].
> 
> [1] https://github.com/p-b-o/qemu-linux-stack/tree/device_passthrough
> 
> Pierrick Bouvier (2):
>    backends/iommufd.c: report error when /dev/iommu is not available
>    hw/vfio/iommufd.c: report hint to user when vfio-dev/vfio*/dev is
>      missing
> 
>   backends/iommufd.c | 5 +++++
>   hw/vfio/iommufd.c  | 5 ++++-
>   2 files changed, 9 insertions(+), 1 deletion(-)
> 

Sent v2, moving the /dev/iommu check to iommu_backend_complete:
https://lore.kernel.org/qemu-devel/20260318180641.1797902-1-pierrick.bouvier@linaro.org/T/#t

Regards,
Pierrick