[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 11/15] cputlb: move CPU_LOOP() for tlb_reset() to
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [PATCH v1 11/15] cputlb: move CPU_LOOP() for tlb_reset() to exec.c |
Date: |
Thu, 10 Sep 2015 22:39:41 -0700 |
To prepare for multi-arch, cputlb.c should only have awareness of one
single architecture. This means it should not have access to the full
CPU lists which may be heterogeneous. Instead, push the CPU_LOOP() up
to the one and only caller in exec.c.
Signed-off-by: Peter Crosthwaite <address@hidden>
---
Easier reading with git diff -w
Changed since RFCv2:
split off to new patch (previously part of core virtualisation patch)
cputlb.c | 27 ++++++++++++---------------
exec.c | 5 ++++-
include/exec/cputlb.h | 2 +-
3 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/cputlb.c b/cputlb.c
index 4bc6c24..5ccd545 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -262,27 +262,24 @@ static inline ram_addr_t
qemu_ram_addr_from_host_nofail(void *ptr)
return ram_addr;
}
-void cpu_tlb_reset_dirty_all(ram_addr_t start1, ram_addr_t length)
+void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length)
{
- CPUState *cpu;
CPUArchState *env;
- CPU_FOREACH(cpu) {
- int mmu_idx;
+ int mmu_idx;
- env = cpu->env_ptr;
- for (mmu_idx = 0; mmu_idx < NB_MMU_MODES; mmu_idx++) {
- unsigned int i;
+ env = cpu->env_ptr;
+ for (mmu_idx = 0; mmu_idx < NB_MMU_MODES; mmu_idx++) {
+ unsigned int i;
- for (i = 0; i < CPU_TLB_SIZE; i++) {
- tlb_reset_dirty_range(&env->tlb_table[mmu_idx][i],
- start1, length);
- }
+ for (i = 0; i < CPU_TLB_SIZE; i++) {
+ tlb_reset_dirty_range(&env->tlb_table[mmu_idx][i],
+ start1, length);
+ }
- for (i = 0; i < CPU_VTLB_SIZE; i++) {
- tlb_reset_dirty_range(&env->tlb_v_table[mmu_idx][i],
- start1, length);
- }
+ for (i = 0; i < CPU_VTLB_SIZE; i++) {
+ tlb_reset_dirty_range(&env->tlb_v_table[mmu_idx][i],
+ start1, length);
}
}
}
diff --git a/exec.c b/exec.c
index c120730..e3568c3 100644
--- a/exec.c
+++ b/exec.c
@@ -894,6 +894,7 @@ found:
static void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length)
{
+ CPUState *cpu;
ram_addr_t start1;
RAMBlock *block;
ram_addr_t end;
@@ -905,7 +906,9 @@ static void tlb_reset_dirty_range_all(ram_addr_t start,
ram_addr_t length)
block = qemu_get_ram_block(start);
assert(block == qemu_get_ram_block(end - 1));
start1 = (uintptr_t)ramblock_ptr(block, start - block->offset);
- cpu_tlb_reset_dirty_all(start1, length);
+ CPU_FOREACH(cpu) {
+ tlb_reset_dirty(cpu, start1, length);
+ }
rcu_read_unlock();
}
diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h
index 360815e..c3aaa30 100644
--- a/include/exec/cputlb.h
+++ b/include/exec/cputlb.h
@@ -25,7 +25,7 @@ void tlb_protect_code(ram_addr_t ram_addr);
void tlb_unprotect_code(ram_addr_t ram_addr);
void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry, uintptr_t start,
uintptr_t length);
-void cpu_tlb_reset_dirty_all(ram_addr_t start1, ram_addr_t length);
+void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length);
void tlb_set_dirty(CPUArchState *env, target_ulong vaddr);
extern int tlb_flush_count;
--
1.9.1
- [Qemu-devel] [PATCH v1 02/15] translate: Listify tcg_exec_init(), (continued)
- [Qemu-devel] [PATCH v1 02/15] translate: Listify tcg_exec_init(), Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 03/15] translate-all: Move tcg_handle_interrupt() to -common, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 04/15] tcg: split tcg_op_defs to -common, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 06/15] translate: move real_host_page setting to -common, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 05/15] tcg: Move tcg_tb_ptr to -common, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 07/15] cpus: Listify cpu_list() function, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 08/15] translate-common: Listify tcg_enabled(), Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 10/15] exec-all: Move cpu_can_do_io() to qom/cpu.h, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 11/15] cputlb: move CPU_LOOP() for tlb_reset() to exec.c,
Peter Crosthwaite <=
- [Qemu-devel] [PATCH v1 12/15] cputlb: Change tlb_set_dirty() arg to cpu, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 09/15] core: Convert tcg_enabled() uses to any/all variants, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 13/15] include/exec: Move cputlb exec.c defs out, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 14/15] cpu-common: Define tb_page_addr_t for everyone, Peter Crosthwaite, 2015/09/11
- [Qemu-devel] [PATCH v1 15/15] monitor: uninclude cpu_ldst, Peter Crosthwaite, 2015/09/11
- Re: [Qemu-devel] [PATCH v1 00/15] Multi-Arch Phase 1, Paolo Bonzini, 2015/09/11