Re: [PATCH 4/22] iommu/amd: Introduce IOMMUFD vIOMMU support for AMD
From: Suthikulpanit, Suravee
Date: Tue May 12 2026 - 11:52:30 EST
On 4/7/2026 1:46 PM, Weinan Liu wrote:
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.
I'll fix this in V2.
Thanks,
Suravee