mfn_t omfn = l1e_get_mfn(old);
unsigned int oflags = l1e_get_flags(old);
p2m_type_t p2mt = p2m_flags_to_type(oflags);
+ bool flush = false;
/*
* If there are any shadows, update them. But if shadow_teardown()
{
sh_remove_all_shadows_and_parents(d, omfn);
if ( sh_remove_all_mappings(d, omfn, _gfn(gfn)) )
- guest_flush_tlb_mask(d, d->dirty_cpumask);
+ flush = true;
}
break;
if ( p2m_is_valid(p2mt) && mfn_valid(omfn) )
{
unsigned int i;
- cpumask_t flushmask;
mfn_t nmfn = l1e_get_mfn(new);
l1_pgentry_t *npte = NULL;
- cpumask_clear(&flushmask);
-
/* If we're replacing a superpage with a normal L1 page, map it */
if ( (l1e_get_flags(new) & _PAGE_PRESENT) &&
!(l1e_get_flags(new) & _PAGE_PSE) &&
/* This GFN->MFN mapping has gone away */
sh_remove_all_shadows_and_parents(d, omfn);
if ( sh_remove_all_mappings(d, omfn, _gfn(gfn + i)) )
- cpumask_or(&flushmask, &flushmask, d->dirty_cpumask);
+ flush = true;
}
omfn = mfn_add(omfn, 1);
}
- guest_flush_tlb_mask(d, &flushmask);
if ( npte )
unmap_domain_page(npte);
break;
}
+
+ if ( flush )
+ guest_flush_tlb_mask(d, d->dirty_cpumask);
}
#if (SHADOW_OPTIMIZATIONS & SHOPT_FAST_FAULT_PATH)