@@ -1375,10 +1375,14 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
*/
static void tb_invalidate_phys_range_1(tb_page_addr_t start, tb_page_addr_t end)
{
- while (start < end) {
- tb_invalidate_phys_page_range(start, end, 0);
- start &= TARGET_PAGE_MASK;
- start += TARGET_PAGE_SIZE;
+ tb_page_addr_t next;
+
+ for (next = (start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
+ start < end;
+ start = next, next += TARGET_PAGE_SIZE) {
+ tb_page_addr_t bound = MIN(next, end);
+
+ tb_invalidate_phys_page_range(start, bound, 0);
}
}