[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 17/24] accel/tcg: Use tb_invalidate_phys_range in page_set_flags
From: |
Richard Henderson |
Subject: |
[PATCH 17/24] accel/tcg: Use tb_invalidate_phys_range in page_set_flags |
Date: |
Wed, 5 Oct 2022 20:11:06 -0700 |
Flush translation blocks in bulk, rather than page-by-page.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/translate-all.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 0006290694..04401ceac7 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)
--
2.34.1
- [PATCH 10/24] accel/tcg: Rename tb_invalidate_phys_page, (continued)
- [PATCH 10/24] accel/tcg: Rename tb_invalidate_phys_page, Richard Henderson, 2022/10/05
- [PATCH 11/24] accel/tcg: Rename tb_invalidate_phys_page_range and drop end parameter, Richard Henderson, 2022/10/05
- [PATCH 12/24] accel/tcg: Unify declarations of tb_invalidate_phys_range, Richard Henderson, 2022/10/05
- [PATCH 14/24] accel/tcg: Call tb_invalidate_phys_page for PAGE_RESET, Richard Henderson, 2022/10/05
- [PATCH 13/24] accel/tcg: Use tb_invalidate_phys_page in page_set_flags, Richard Henderson, 2022/10/05
- [PATCH 17/24] accel/tcg: Use tb_invalidate_phys_range in page_set_flags,
Richard Henderson <=
- [PATCH 16/24] accel/tcg: Use page_reset_target_data in page_set_flags, Richard Henderson, 2022/10/05
- [PATCH 15/24] accel/tcg: Use interval tree for TBs in user-only mode, Richard Henderson, 2022/10/05
- [PATCH 18/24] accel/tcg: Move TARGET_PAGE_DATA_SIZE impl to user-exec.c, Richard Henderson, 2022/10/05
- [PATCH 19/24] accel/tcg: Simplify page_get/alloc_target_data, Richard Henderson, 2022/10/05