[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 23/62] translate-all: make less of tb_invalidate_phys
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 23/62] translate-all: make less of tb_invalidate_phys_page_range depend on is_cpu_write_access |
Date: |
Fri, 5 Jun 2015 17:15:24 +0200 |
is_cpu_write_access is only set if tb_invalidate_phys_page_range is called
from tb_invalidate_phys_page_fast, and hence from notdirty_mem_write.
However:
- the code bitmap can be built directly in tb_invalidate_phys_page_fast
(unconditionally, since is_cpu_write_access would always be passed as 1);
- the virtual address is not needed to mark the page as "not containing
code" (dirty code bitmap = 1), so we can also remove that use of
is_cpu_write_access. For calls of tb_invalidate_phys_page_range
that do not come from notdirty_mem_write, the next call to
notdirty_mem_write will notice that the page does not contain code
anymore, and will fix up the TLB entry.
The parameter needs to remain in order to guard accesses to cpu->mem_io_pc.
Signed-off-by: Paolo Bonzini <address@hidden>
---
translate-all.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/translate-all.c b/translate-all.c
index 0e2ad8a..e2e7422 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -1082,12 +1082,6 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start,
tb_page_addr_t end,
if (!p) {
return;
}
- if (!p->code_bitmap &&
- ++p->code_write_count >= SMC_BITMAP_USE_THRESHOLD &&
- is_cpu_write_access) {
- /* build code bitmap */
- build_page_bitmap(p);
- }
#if defined(TARGET_HAS_PRECISE_SMC)
if (cpu != NULL) {
env = cpu->env_ptr;
@@ -1157,9 +1151,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start,
tb_page_addr_t end,
/* if no code remaining, no need to continue to use slow writes */
if (!p->first_tb) {
invalidate_page_bitmap(p);
- if (is_cpu_write_access) {
- tlb_unprotect_code(start);
- }
+ tlb_unprotect_code(start);
}
#endif
#ifdef TARGET_HAS_PRECISE_SMC
@@ -1192,6 +1184,11 @@ void tb_invalidate_phys_page_fast(tb_page_addr_t start,
int len)
if (!p) {
return;
}
+ if (!p->code_bitmap &&
+ ++p->code_write_count >= SMC_BITMAP_USE_THRESHOLD) {
+ /* build code bitmap */
+ build_page_bitmap(p);
+ }
if (p->code_bitmap) {
unsigned int nr;
unsigned long b;
--
2.4.1
- [Qemu-devel] [PULL 13/62] ui/console: remove dpy_gfx_update_dirty, (continued)
- [Qemu-devel] [PULL 13/62] ui/console: remove dpy_gfx_update_dirty, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 15/62] kvm: accept non-mapped memory in kvm_dirty_pages_log_change, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 16/62] memory: include DIRTY_MEMORY_MIGRATION in the dirty log mask, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 17/62] kvm: remove special handling of DIRTY_MEMORY_MIGRATION in the dirty log mask, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 19/62] exec: use memory_region_get_dirty_log_mask to optimize dirty tracking, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 20/62] exec: move functions to translate-all.h, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 18/62] ram_addr: tweaks to xen_modified_memory, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 21/62] translate-all: remove unnecessary argument to tb_invalidate_phys_range, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 22/62] cputlb: remove useless arguments to tlb_unprotect_code_phys, rename, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 24/62] exec: pass client mask to cpu_physical_memory_set_dirty_range, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 23/62] translate-all: make less of tb_invalidate_phys_page_range depend on is_cpu_write_access,
Paolo Bonzini <=
- [Qemu-devel] [PULL 25/62] exec: invert return value of cpu_physical_memory_get_clean, rename, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 26/62] exec: only check relevant bitmaps for cleanliness, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 27/62] memory: do not touch code dirty bitmap unless TCG is enabled, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 28/62] bitmap: add atomic set functions, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 29/62] bitmap: add atomic test and clear, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 30/62] memory: use atomic ops for setting dirty memory bits, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 31/62] migration: move dirty bitmap sync to ram_addr.h, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 33/62] memory: make cpu_physical_memory_sync_dirty_bitmap() fully atomic, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 32/62] memory: replace cpu_physical_memory_reset_dirty() with test-and-clear, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PULL 34/62] memory: use mr->ram_addr in "is this RAM?" assertions, Paolo Bonzini, 2015/06/05