Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- include/exec/exec-all.h | 1 - include/tcg/tcg-module.h | 3 +++ accel/tcg/cputlb.c | 3 ++- accel/tcg/tcg-module.c | 9 +++++++++ softmmu/physmem.c | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 43d89699e989..27fc489c57b5 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -691,7 +691,6 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr); tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, target_ulong addr, void **hostp); -void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); void tlb_set_dirty(CPUState *cpu, target_ulong vaddr); MemoryRegionSection * diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index a903e3ee62c0..a14dcdb002db 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -6,6 +6,9 @@ struct TCGModuleOps { void (*tlb_flush)(CPUState *cpu); void (*tlb_flush_page)(CPUState *cpu, target_ulong addr); +#if defined(CONFIG_SOFTMMU) + void (*tlb_reset_dirty)(CPUState *cpu, ram_addr_t start1, ram_addr_t length); +#endif }; extern struct TCGModuleOps tcg; diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 1fcdb71a10a0..fa9c9064848c 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1004,7 +1004,7 @@ static inline void copy_tlb_helper_locked(CPUTLBEntry *d, const CPUTLBEntry *s) * We must take tlb_c.lock to avoid racing with another vCPU update. The only * thing actually updated is the target TLB entry ->addr_write flags. */ -void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length) +static void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length) { CPUArchState *env; @@ -2772,6 +2772,7 @@ static void tcg_module_ops_tlb(void) { tcg.tlb_flush = tlb_flush; tcg.tlb_flush_page = tlb_flush_page; + tcg.tlb_reset_dirty = tlb_reset_dirty; } type_init(tcg_module_ops_tlb); diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index 4d62160628bd..febf4e49981c 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -9,7 +9,16 @@ static void tlb_flush_page_stub(CPUState *cpu, target_ulong addr) { } +#if defined(CONFIG_SOFTMMU) +static void tlb_reset_dirty_stub(CPUState *cpu, ram_addr_t start1, ram_addr_t length) +{ +} +#endif + struct TCGModuleOps tcg = { .tlb_flush = update_cpu_stub, .tlb_flush_page = tlb_flush_page_stub, +#if defined(CONFIG_SOFTMMU) + .tlb_reset_dirty = tlb_reset_dirty_stub, +#endif }; diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 8fa5376de1c9..8b27827c533d 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -1015,7 +1015,7 @@ static void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length) assert(block == qemu_get_ram_block(end - 1)); start1 = (uintptr_t)ramblock_ptr(block, start - block->offset); CPU_FOREACH(cpu) { - tlb_reset_dirty(cpu, start1, length); + tcg.tlb_reset_dirty(cpu, start1, length); } } -- 2.31.1