Commit 85b98276 authored by David Woodhouse's avatar David Woodhouse

intel-iommu: Warn about unmatched unmap requests

This would have found the bug in i386 pci_unmap_addr() a long time ago.
We shouldn't just silently return without doing anything.
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 206a73c1
...@@ -2640,7 +2640,8 @@ static void intel_unmap_page(struct device *dev, dma_addr_t dev_addr, ...@@ -2640,7 +2640,8 @@ static void intel_unmap_page(struct device *dev, dma_addr_t dev_addr,
iommu = domain_get_iommu(domain); iommu = domain_get_iommu(domain);
iova = find_iova(&domain->iovad, IOVA_PFN(dev_addr)); iova = find_iova(&domain->iovad, IOVA_PFN(dev_addr));
if (!iova) if (WARN_ONCE(!iova, "Driver unmaps unmatched page at PFN %llx\n",
(unsigned long long)dev_addr))
return; return;
start_pfn = mm_to_dma_pfn(iova->pfn_lo); start_pfn = mm_to_dma_pfn(iova->pfn_lo);
...@@ -2730,7 +2731,8 @@ static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist, ...@@ -2730,7 +2731,8 @@ static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist,
iommu = domain_get_iommu(domain); iommu = domain_get_iommu(domain);
iova = find_iova(&domain->iovad, IOVA_PFN(sglist[0].dma_address)); iova = find_iova(&domain->iovad, IOVA_PFN(sglist[0].dma_address));
if (!iova) if (WARN_ONCE(!iova, "Driver unmaps unmatched sglist at PFN %llx\n",
(unsigned long long)sglist[0].dma_address))
return; return;
start_pfn = mm_to_dma_pfn(iova->pfn_lo); start_pfn = mm_to_dma_pfn(iova->pfn_lo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment