From: Jan Beulich Date: Fri, 20 Aug 2021 10:30:35 +0000 (+0200) Subject: AMD/IOMMU: don't leave page table mapped when unmapping ... X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~270 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3cfec6a6aa7a7bf68f8e19e21f450c2febe9acb4;p=xen.git AMD/IOMMU: don't leave page table mapped when unmapping ... ... an already not mapped page. With all other exit paths doing the unmap, I have no idea how I managed to miss that aspect at the time. Fixes: ad591454f069 ("AMD/IOMMU: don't needlessly trigger errors/crashes when unmapping a page") Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant --- diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c index 560af54b76..1ed39bbee5 100644 --- a/xen/drivers/passthrough/amd/iommu_map.c +++ b/xen/drivers/passthrough/amd/iommu_map.c @@ -243,7 +243,10 @@ static int iommu_pde_from_dfn(struct domain *d, unsigned long dfn, else if ( !pde->pr ) { if ( !map ) + { + unmap_domain_page(next_table_vaddr); return 0; + } if ( next_table_mfn == 0 ) {