summaryrefslogtreecommitdiffstats
path: root/accel
diff options
context:
space:
mode:
authorRichard Henderson2022-10-05 21:56:46 +0200
committerRichard Henderson2022-10-26 03:11:28 +0200
commite786509f29c3b4ea7e295f79e8e73e7a3b2f2818 (patch)
tree72c35ffd44b62521d7f18fcb1a55640ce22c17cd /accel
parentaccel/tcg: Use page_reset_target_data in page_set_flags (diff)
downloadqemu-e786509f29c3b4ea7e295f79e8e73e7a3b2f2818.tar.gz
qemu-e786509f29c3b4ea7e295f79e8e73e7a3b2f2818.tar.xz
qemu-e786509f29c3b4ea7e295f79e8e73e7a3b2f2818.zip
accel/tcg: Use tb_invalidate_phys_range in page_set_flags
Flush translation blocks in bulk, rather than page-by-page. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'accel')
-rw-r--r--accel/tcg/translate-all.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 41b6d5fe26..eea24dea96 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1352,7 +1352,7 @@ int page_get_flags(target_ulong address)
void page_set_flags(target_ulong start, target_ulong end, int flags)
{
target_ulong addr, len;
- bool reset;
+ bool reset, inval_tb = false;
/* This function should never be called with addresses outside the
guest address space. If this assert fires, it probably indicates
@@ -1388,11 +1388,15 @@ void page_set_flags(target_ulong start, target_ulong end, int flags)
&& (reset ||
!(flags & PAGE_EXEC) ||
(flags & ~p->flags & PAGE_WRITE))) {
- tb_invalidate_phys_page(addr);
+ inval_tb = true;
}
/* Using mprotect on a page does not change sticky bits. */
p->flags = (reset ? 0 : p->flags & PAGE_STICKY) | flags;
}
+
+ if (inval_tb) {
+ tb_invalidate_phys_range(start, end);
+ }
}
void page_reset_target_data(target_ulong start, target_ulong end)