diff --git a/qemu/aarch64.h b/qemu/aarch64.h index bf22bc45..52ac516b 100644 --- a/qemu/aarch64.h +++ b/qemu/aarch64.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_aarch64 #define memory_register_types memory_register_types_aarch64 #define cpu_exec_init_all cpu_exec_init_all_aarch64 +#define cpu_reload_memory_map cpu_reload_memory_map_aarch64 #define vm_start vm_start_aarch64 #define resume_all_vcpus resume_all_vcpus_aarch64 #define a15_l2ctlr_read a15_l2ctlr_read_aarch64 diff --git a/qemu/aarch64eb.h b/qemu/aarch64eb.h index c73892d4..ffa1817f 100644 --- a/qemu/aarch64eb.h +++ b/qemu/aarch64eb.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_aarch64eb #define memory_register_types memory_register_types_aarch64eb #define cpu_exec_init_all cpu_exec_init_all_aarch64eb +#define cpu_reload_memory_map cpu_reload_memory_map_aarch64eb #define vm_start vm_start_aarch64eb #define resume_all_vcpus resume_all_vcpus_aarch64eb #define a15_l2ctlr_read a15_l2ctlr_read_aarch64eb diff --git a/qemu/arm.h b/qemu/arm.h index 772d6bfc..90e5f315 100644 --- a/qemu/arm.h +++ b/qemu/arm.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_arm #define memory_register_types memory_register_types_arm #define cpu_exec_init_all cpu_exec_init_all_arm +#define cpu_reload_memory_map cpu_reload_memory_map_arm #define vm_start vm_start_arm #define resume_all_vcpus resume_all_vcpus_arm #define a15_l2ctlr_read a15_l2ctlr_read_arm diff --git a/qemu/armeb.h b/qemu/armeb.h index e847cfc7..6d48412e 100644 --- a/qemu/armeb.h +++ b/qemu/armeb.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_armeb #define memory_register_types memory_register_types_armeb #define cpu_exec_init_all cpu_exec_init_all_armeb +#define cpu_reload_memory_map cpu_reload_memory_map_armeb #define vm_start vm_start_armeb #define resume_all_vcpus resume_all_vcpus_armeb #define a15_l2ctlr_read a15_l2ctlr_read_armeb diff --git a/qemu/cpu-exec.c b/qemu/cpu-exec.c index 7755adf2..782c73b7 100644 --- a/qemu/cpu-exec.c +++ b/qemu/cpu-exec.c @@ -286,6 +286,12 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq return ret; } +void cpu_reload_memory_map(CPUState *cpu) +{ + /* The TLB is protected by the iothread lock. */ + tlb_flush(cpu, 1); +} + /* Execute a TB, and fix up the CPU state afterwards if necessary */ static tcg_target_ulong cpu_tb_exec(CPUState *cpu, uint8_t *tb_ptr) { diff --git a/qemu/exec.c b/qemu/exec.c index e6923862..f0ccfd19 100644 --- a/qemu/exec.c +++ b/qemu/exec.c @@ -1484,7 +1484,7 @@ static void tcg_commit(MemoryListener *listener) /* since each CPU stores ram addresses in its TLB cache, we must reset the modified entries */ /* XXX: slow ! */ - tlb_flush(uc->cpu, 1); + cpu_reload_memory_map(uc->cpu); } void address_space_init_dispatch(AddressSpace *as) diff --git a/qemu/header_gen.py b/qemu/header_gen.py index ae04984c..0acde92d 100644 --- a/qemu/header_gen.py +++ b/qemu/header_gen.py @@ -30,6 +30,7 @@ symbols = ( 'tcg_exec_init', 'memory_register_types', 'cpu_exec_init_all', + 'cpu_reload_memory_map', 'vm_start', 'resume_all_vcpus', 'a15_l2ctlr_read', diff --git a/qemu/include/exec/exec-all.h b/qemu/include/exec/exec-all.h index e839825f..86aeaa14 100644 --- a/qemu/include/exec/exec-all.h +++ b/qemu/include/exec/exec-all.h @@ -92,6 +92,7 @@ void tb_invalidate_phys_page_range(struct uc_struct *uc, tb_page_addr_t start, t void tb_invalidate_phys_range(struct uc_struct *uc, tb_page_addr_t start, tb_page_addr_t end, int is_cpu_write_access); #if !defined(CONFIG_USER_ONLY) +void cpu_reload_memory_map(CPUState *cpu); void tcg_cpu_address_space_init(CPUState *cpu, AddressSpace *as); /* cputlb.c */ void tlb_flush_page(CPUState *cpu, target_ulong addr); diff --git a/qemu/m68k.h b/qemu/m68k.h index de91a07c..9100b02a 100644 --- a/qemu/m68k.h +++ b/qemu/m68k.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_m68k #define memory_register_types memory_register_types_m68k #define cpu_exec_init_all cpu_exec_init_all_m68k +#define cpu_reload_memory_map cpu_reload_memory_map_m68k #define vm_start vm_start_m68k #define resume_all_vcpus resume_all_vcpus_m68k #define a15_l2ctlr_read a15_l2ctlr_read_m68k diff --git a/qemu/mips.h b/qemu/mips.h index ad8450b9..d31800a1 100644 --- a/qemu/mips.h +++ b/qemu/mips.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_mips #define memory_register_types memory_register_types_mips #define cpu_exec_init_all cpu_exec_init_all_mips +#define cpu_reload_memory_map cpu_reload_memory_map_mips #define vm_start vm_start_mips #define resume_all_vcpus resume_all_vcpus_mips #define a15_l2ctlr_read a15_l2ctlr_read_mips diff --git a/qemu/mips64.h b/qemu/mips64.h index 5b650fdd..8a572afb 100644 --- a/qemu/mips64.h +++ b/qemu/mips64.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_mips64 #define memory_register_types memory_register_types_mips64 #define cpu_exec_init_all cpu_exec_init_all_mips64 +#define cpu_reload_memory_map cpu_reload_memory_map_mips64 #define vm_start vm_start_mips64 #define resume_all_vcpus resume_all_vcpus_mips64 #define a15_l2ctlr_read a15_l2ctlr_read_mips64 diff --git a/qemu/mips64el.h b/qemu/mips64el.h index 7ce4b6af..d76896e5 100644 --- a/qemu/mips64el.h +++ b/qemu/mips64el.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_mips64el #define memory_register_types memory_register_types_mips64el #define cpu_exec_init_all cpu_exec_init_all_mips64el +#define cpu_reload_memory_map cpu_reload_memory_map_mips64el #define vm_start vm_start_mips64el #define resume_all_vcpus resume_all_vcpus_mips64el #define a15_l2ctlr_read a15_l2ctlr_read_mips64el diff --git a/qemu/mipsel.h b/qemu/mipsel.h index 95155520..fa2f5d2e 100644 --- a/qemu/mipsel.h +++ b/qemu/mipsel.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_mipsel #define memory_register_types memory_register_types_mipsel #define cpu_exec_init_all cpu_exec_init_all_mipsel +#define cpu_reload_memory_map cpu_reload_memory_map_mipsel #define vm_start vm_start_mipsel #define resume_all_vcpus resume_all_vcpus_mipsel #define a15_l2ctlr_read a15_l2ctlr_read_mipsel diff --git a/qemu/powerpc.h b/qemu/powerpc.h index 87f87691..ed7c2826 100644 --- a/qemu/powerpc.h +++ b/qemu/powerpc.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_powerpc #define memory_register_types memory_register_types_powerpc #define cpu_exec_init_all cpu_exec_init_all_powerpc +#define cpu_reload_memory_map cpu_reload_memory_map_powerpc #define vm_start vm_start_powerpc #define resume_all_vcpus resume_all_vcpus_powerpc #define a15_l2ctlr_read a15_l2ctlr_read_powerpc diff --git a/qemu/sparc.h b/qemu/sparc.h index cc97714f..a4a7534d 100644 --- a/qemu/sparc.h +++ b/qemu/sparc.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_sparc #define memory_register_types memory_register_types_sparc #define cpu_exec_init_all cpu_exec_init_all_sparc +#define cpu_reload_memory_map cpu_reload_memory_map_sparc #define vm_start vm_start_sparc #define resume_all_vcpus resume_all_vcpus_sparc #define a15_l2ctlr_read a15_l2ctlr_read_sparc diff --git a/qemu/sparc64.h b/qemu/sparc64.h index 4cd8fccb..f6e7fcf0 100644 --- a/qemu/sparc64.h +++ b/qemu/sparc64.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_sparc64 #define memory_register_types memory_register_types_sparc64 #define cpu_exec_init_all cpu_exec_init_all_sparc64 +#define cpu_reload_memory_map cpu_reload_memory_map_sparc64 #define vm_start vm_start_sparc64 #define resume_all_vcpus resume_all_vcpus_sparc64 #define a15_l2ctlr_read a15_l2ctlr_read_sparc64 diff --git a/qemu/x86_64.h b/qemu/x86_64.h index cd206e35..54a859ea 100644 --- a/qemu/x86_64.h +++ b/qemu/x86_64.h @@ -24,6 +24,7 @@ #define tcg_exec_init tcg_exec_init_x86_64 #define memory_register_types memory_register_types_x86_64 #define cpu_exec_init_all cpu_exec_init_all_x86_64 +#define cpu_reload_memory_map cpu_reload_memory_map_x86_64 #define vm_start vm_start_x86_64 #define resume_all_vcpus resume_all_vcpus_x86_64 #define a15_l2ctlr_read a15_l2ctlr_read_x86_64