]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
IOMMU/x86: don't bypass softirq processing in arch_iommu_hwdom_init()
authorJan Beulich <jbeulich@suse.com>
Mon, 2 Mar 2020 09:49:48 +0000 (10:49 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 2 Mar 2020 13:06:22 +0000 (13:06 +0000)
Even when a page doesn't need mapping, we should check whether softirq
processing should be invoked. Otherwise with sufficiently much RAM
chances of a to-be-mapped page actually occurring with the loop counter
having the "right" value may become diminishingly small.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/drivers/passthrough/x86/iommu.c

index 2cf528e7603e8038e69117a8808d20e9dd358387..6b4360ba396b02be75a843fac7bf99e9fee6de37 100644 (file)
@@ -226,9 +226,8 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain *d)
         int rc;
 
         if ( !hwdom_iommu_map(d, pfn, max_pfn) )
-            continue;
-
-        if ( paging_mode_translate(d) )
+            rc = 0;
+        else if ( paging_mode_translate(d) )
             rc = set_identity_p2m_entry(d, pfn, p2m_access_rw, 0);
         else
             rc = iommu_map(d, _dfn(pfn), _mfn(pfn), PAGE_ORDER_4K,