Re: [PATCH 09/24] iommu/amd: Introduce and map vIOMMU private IPA region
Jason Gunthorpe <[email protected]>
| Newsgroups | dev.linux.lists.iommu,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <178759229632.3131778.18162973370003245229.b4-review@b4> |
> [ ... 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 <[email protected]>
--
Jason