Re: [PATCH 4/22] iommu/amd: Introduce IOMMUFD vIOMMU support for AMD
From: Weinan Liu
Date: Tue Apr 07 2026 - 02:46:16 EST
On Mon, Mar 30, 2026 at 1:43 AM Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx> wrote:
> diff --git a/drivers/iommu/amd/iommufd.c b/drivers/iommu/amd/iommufd.c
> index ad627fd5ccc7..e7ffa7e8915b 100644
> --- a/drivers/iommu/amd/iommufd.c
> +++ b/drivers/iommu/amd/iommufd.c
> @@ -34,6 +34,9 @@ void *amd_iommufd_hw_info(struct device *dev, u32 *length, u32 *type)
>
> size_t amd_iommufd_get_viommu_size(struct device *dev, enum iommu_viommu_type viommu_type)
> {
> + if (viommu_type != IOMMU_VIOMMU_TYPE_AMD)
> + return 0;
> +
It should also return 0 here if amd_viommu_init() fails or if amd_iommu_viommu is false.