Re: [PATCH 09/24] iommu/amd: Introduce and map vIOMMU private IPA region
From: Jason Gunthorpe
Date: Mon Aug 24 2026 - 13:26:23 EST
> [ ... 197 lines skipped ... ]
> +static void viommu_priv_unmap_free(struct amd_iommu *iommu, u64 iova, size_t size,
> + void *cpu_va)
> +{
> + size_t unmapped;
> +
> + if (!cpu_va)
> + return;
> + if (!iommu || !iommu->viommu_pdom)
> + return;
> +
> + unmapped = iommu_unmap(&iommu->viommu_pdom->domain, iova, size);
> + if (unmapped != size)
> + pr_warn("%s: unmapped %#zx of %#lx at %#llx\n", __func__, unmapped, size, iova);
This should be a WARN_ON, the kernel has malfunctioned if the mapping
it put there cannot be unmapped.
Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
--
Jason