Re: [PATCH v6 04/24] iommu/amd: Introduce IOMMUFD vIOMMU support for AMD

From: Nicolin Chen

Date: Wed Sep 30 2026 - 17:49:59 EST


On Wed, Sep 30, 2026 at 09:23:24AM +0000, Suravee Suthikulpanit wrote:
> Introduce a new enum iommu_viommu_type (IOMMU_VIOMMU_TYPE_AMD) for AMD
> vIOMMU along with the struct iommu_viommu_amd, which is used to initialize
> IOMMUFD vIOMMU instance when calling struct iommu_ops.viommu_init().
>
> Also, hook up struct iomufd_viomu_ops.alloc_domain_nested to connect
> nested domain allocation with AMD vIOMMU implementation.
>
> Only report a non-zero viommu size when the type is AMD and
> amd_iommu_viommu_enabled() is true for the device's IOMMU.
>
> Additional initialization will be added in subsequent patches.
>
> Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>

Reviewed-by: Nicolin Chen <nicolinc@xxxxxxxxxx>