]> xenbits.xensource.com Git - xen.git/commitdiff
AMD/IOMMU: don't leave page table mapped when unmapping ...
authorJan Beulich <jbeulich@suse.com>
Fri, 20 Aug 2021 10:30:35 +0000 (12:30 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 20 Aug 2021 10:30:35 +0000 (12:30 +0200)
... 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 <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
xen/drivers/passthrough/amd/iommu_map.c

index 560af54b765ba61de3c311e0bb2c974be0a8a030..1ed39bbee5c2d5ab6a33b6fd4437f6d136ec1c09 100644 (file)
@@ -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 )
             {