Skip to contentSkip to conversation

IOMMU/x86: don't bypass softirq processing in arch_iommu_hwdom_init()

PATCH In review Jan Beulich 3 participants 3 messages Mar 2, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IOMMU/x86: don't bypass softirq processing in arch_iommu_hwdom_init()

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.

xen/drivers/passthrough/x86/iommu.c +2 -3
@@ -226,9 +226,8 @@ void __hwdom_init arch_iommu_hwdom_init(
         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,

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jan Beulich

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.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Tested-by
#2 lore raw
Quoted 9 lines · Roger Pau Monné
Quoted 7 lines · Jan Beulich

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.

This resolves the watchdog timeout, and reveals more work to do, but I'll follow up on the main thread.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel