diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 65efa949e5..59dd23a7f1 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -948,6 +948,7 @@ static int apply_p2m_changes(struct domain *d, const unsigned long sgfn = paddr_to_pfn(start_gpaddr), egfn = paddr_to_pfn(end_gpaddr); const unsigned int preempt_count_limit = (op == MEMACCESS) ? 1 : 0x2000; + const bool_t preempt = !is_idle_vcpu(current); bool_t flush = false; bool_t flush_pt; @@ -980,7 +981,8 @@ static int apply_p2m_changes(struct domain *d, * always make at least one pass as long as preempt_count_limit is * initialized with a value >= 1. */ - if ( count >= preempt_count_limit && hypercall_preempt_check() ) + if ( preempt && count >= preempt_count_limit + && hypercall_preempt_check() ) { switch ( op ) {