Re: [PATCH v2 3/7] iommu/vt-d: Enhance compatibility check for paging domain attach
From: Jason Gunthorpe
Date: Mon Oct 21 2024 - 08:46:27 EST
On Mon, Oct 21, 2024 at 04:51:20PM +0800, Lu Baolu wrote:
> diff --git a/drivers/iommu/intel/nested.c b/drivers/iommu/intel/nested.c
> index 433c58944401..96016bc40f94 100644
> --- a/drivers/iommu/intel/nested.c
> +++ b/drivers/iommu/intel/nested.c
> @@ -40,7 +40,7 @@ static int intel_nested_attach_dev(struct iommu_domain *domain,
> * The s2_domain will be used in nested translation, hence needs
> * to ensure the s2_domain is compatible with this IOMMU.
> */
> - ret = prepare_domain_attach_device(&dmar_domain->s2_domain->domain, dev);
> + ret = paging_domain_compatible(&dmar_domain->s2_domain->domain, dev);
> if (ret) {
> dev_err_ratelimited(dev, "s2 domain is not compatible\n");
> return ret;
This dev_err shouldn't be here, this path would be userspace
triggerable.
Otherwise
Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
Jason