Make sure softirqs are processed at least once for every call to
pvh_populate_memory_range. It's likely that none of the calls to
pvh_populate_memory_range will perform 64 iterations, in which case
softirqs won't be processed for the whole duration of the p2m
population.
In order to force softirqs to be processed at least once for every
pvh_populate_memory_range call move the increasing of 'i' to be done
after evaluation, so on the first loop iteration softirqs will
unconditionally be processed.
Fixes: 5427134eae ('x86: populate PVHv2 Dom0 physical memory map')
Signed-off-by: Roger Pau Monné <[email protected]>
---
xen/arch/x86/hvm/dom0_build.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 549ff8ec7c..78d6f1012a 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -186,7 +186,7 @@ static int __init pvh_populate_memory_range(struct domain
*d,
start += 1UL << order;
nr_pages -= 1UL << order;
order_stats[order]++;
- if ( (++i % MAP_MAX_ITER) == 0 )
+ if ( (i++ % MAP_MAX_ITER) == 0 )
process_pending_softirqs();
}
--
2.34.1