From 66fa40187175866082a7855fc54b04b867cd1742 Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Tue, 13 Mar 2018 16:20:32 -0400 Subject: [PATCH] exec-all: rename tb_free to tb_remove We don't really free anything in this function anymore; we just remove the TB from the binary search tree. Backports commit be1e01171b556807198c84feac7cf4bca0d904c2 from qemu --- qemu/aarch64.h | 2 +- qemu/aarch64eb.h | 2 +- qemu/accel/tcg/cpu-exec.c | 2 +- qemu/accel/tcg/translate-all.c | 6 +++--- qemu/arm.h | 2 +- qemu/armeb.h | 2 +- qemu/header_gen.py | 2 +- qemu/include/exec/exec-all.h | 2 +- qemu/m68k.h | 2 +- qemu/mips.h | 2 +- qemu/mips64.h | 2 +- qemu/mips64el.h | 2 +- qemu/mipsel.h | 2 +- qemu/powerpc.h | 2 +- qemu/sparc.h | 2 +- qemu/sparc64.h | 2 +- qemu/x86_64.h | 2 +- 17 files changed, 19 insertions(+), 19 deletions(-) diff --git a/qemu/aarch64.h b/qemu/aarch64.h index 491d4fa8..06d6ac19 100644 --- a/qemu/aarch64.h +++ b/qemu/aarch64.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_aarch64 #define tb_flush tb_flush_aarch64 #define tb_flush_jmp_cache tb_flush_jmp_cache_aarch64 -#define tb_free tb_free_aarch64 #define tb_gen_code tb_gen_code_aarch64 #define tb_hash_remove tb_hash_remove_aarch64 #define tb_htable_lookup tb_htable_lookup_aarch64 @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_aarch64 #define tb_phys_hash_func tb_phys_hash_func_aarch64 #define tb_phys_invalidate tb_phys_invalidate_aarch64 +#define tb_remove tb_remove_aarch64 #define tb_reset_jump tb_reset_jump_aarch64 #define tb_set_jmp_target tb_set_jmp_target_aarch64 #define tcg_accel_class_init tcg_accel_class_init_aarch64 diff --git a/qemu/aarch64eb.h b/qemu/aarch64eb.h index c9ab8358..5180053a 100644 --- a/qemu/aarch64eb.h +++ b/qemu/aarch64eb.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_aarch64eb #define tb_flush tb_flush_aarch64eb #define tb_flush_jmp_cache tb_flush_jmp_cache_aarch64eb -#define tb_free tb_free_aarch64eb #define tb_gen_code tb_gen_code_aarch64eb #define tb_hash_remove tb_hash_remove_aarch64eb #define tb_htable_lookup tb_htable_lookup_aarch64eb @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_aarch64eb #define tb_phys_hash_func tb_phys_hash_func_aarch64eb #define tb_phys_invalidate tb_phys_invalidate_aarch64eb +#define tb_remove tb_remove_aarch64eb #define tb_reset_jump tb_reset_jump_aarch64eb #define tb_set_jmp_target tb_set_jmp_target_aarch64eb #define tcg_accel_class_init tcg_accel_class_init_aarch64eb diff --git a/qemu/accel/tcg/cpu-exec.c b/qemu/accel/tcg/cpu-exec.c index 0cc4687c..58936e9c 100644 --- a/qemu/accel/tcg/cpu-exec.c +++ b/qemu/accel/tcg/cpu-exec.c @@ -111,7 +111,7 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles, //trace_exec_tb_nocache(tb, tb->pc); cpu_tb_exec(cpu, tb); tb_phys_invalidate(env->uc, tb, -1); - tb_free(env->uc, tb); + tb_remove(env->uc, tb); } struct tb_desc { diff --git a/qemu/accel/tcg/translate-all.c b/qemu/accel/tcg/translate-all.c index 71e9aac6..39abbcc3 100644 --- a/qemu/accel/tcg/translate-all.c +++ b/qemu/accel/tcg/translate-all.c @@ -354,7 +354,7 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr) if (tb->cflags & CF_NOCACHE) { /* one-shot translation, invalidate it immediately */ tb_phys_invalidate(cpu->uc, tb, -1); - tb_free(cpu->uc, tb); + tb_remove(cpu->uc, tb); } return true; } @@ -921,7 +921,7 @@ static TranslationBlock *tb_alloc(struct uc_struct *uc, target_ulong pc) } /* Called with tb_lock held. */ -void tb_free(struct uc_struct *uc, TranslationBlock *tb) +void tb_remove(struct uc_struct *uc, TranslationBlock *tb) { TCGContext *tcg_ctx = uc->tcg_ctx; @@ -1857,7 +1857,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) * cpu_exec_nocache() */ tb_phys_invalidate(cpu->uc, tb->orig_tb, -1); } - tb_free(env->uc, tb); + tb_remove(env->uc, tb); } /* TODO: If env->pc != tb->pc (i.e. the faulting instruction was not diff --git a/qemu/arm.h b/qemu/arm.h index a1974154..83c5130a 100644 --- a/qemu/arm.h +++ b/qemu/arm.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_arm #define tb_flush tb_flush_arm #define tb_flush_jmp_cache tb_flush_jmp_cache_arm -#define tb_free tb_free_arm #define tb_gen_code tb_gen_code_arm #define tb_hash_remove tb_hash_remove_arm #define tb_htable_lookup tb_htable_lookup_arm @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_arm #define tb_phys_hash_func tb_phys_hash_func_arm #define tb_phys_invalidate tb_phys_invalidate_arm +#define tb_remove tb_remove_arm #define tb_reset_jump tb_reset_jump_arm #define tb_set_jmp_target tb_set_jmp_target_arm #define tcg_accel_class_init tcg_accel_class_init_arm diff --git a/qemu/armeb.h b/qemu/armeb.h index d900d7b0..7d690a41 100644 --- a/qemu/armeb.h +++ b/qemu/armeb.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_armeb #define tb_flush tb_flush_armeb #define tb_flush_jmp_cache tb_flush_jmp_cache_armeb -#define tb_free tb_free_armeb #define tb_gen_code tb_gen_code_armeb #define tb_hash_remove tb_hash_remove_armeb #define tb_htable_lookup tb_htable_lookup_armeb @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_armeb #define tb_phys_hash_func tb_phys_hash_func_armeb #define tb_phys_invalidate tb_phys_invalidate_armeb +#define tb_remove tb_remove_armeb #define tb_reset_jump tb_reset_jump_armeb #define tb_set_jmp_target tb_set_jmp_target_armeb #define tcg_accel_class_init tcg_accel_class_init_armeb diff --git a/qemu/header_gen.py b/qemu/header_gen.py index f1e05daf..41b17cd9 100644 --- a/qemu/header_gen.py +++ b/qemu/header_gen.py @@ -2445,7 +2445,6 @@ symbols = ( 'tb_find_slow', 'tb_flush', 'tb_flush_jmp_cache', - 'tb_free', 'tb_gen_code', 'tb_hash_remove', 'tb_htable_lookup', @@ -2460,6 +2459,7 @@ symbols = ( 'tb_page_remove', 'tb_phys_hash_func', 'tb_phys_invalidate', + 'tb_remove', 'tb_reset_jump', 'tb_set_jmp_target', 'tcg_accel_class_init', diff --git a/qemu/include/exec/exec-all.h b/qemu/include/exec/exec-all.h index 6f8e9a00..a4e07707 100644 --- a/qemu/include/exec/exec-all.h +++ b/qemu/include/exec/exec-all.h @@ -291,7 +291,7 @@ static inline uint32_t curr_cflags(struct uc_struct *uc) // | (use_icount ? CF_USE_ICOUNT : 0); } -void tb_free(struct uc_struct *uc, TranslationBlock *tb); +void tb_remove(struct uc_struct *uc, TranslationBlock *tb); void tb_flush(CPUState *cpu); void tb_phys_invalidate(struct uc_struct *uc, TranslationBlock *tb, tb_page_addr_t page_addr); diff --git a/qemu/m68k.h b/qemu/m68k.h index b9da9330..887fc35c 100644 --- a/qemu/m68k.h +++ b/qemu/m68k.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_m68k #define tb_flush tb_flush_m68k #define tb_flush_jmp_cache tb_flush_jmp_cache_m68k -#define tb_free tb_free_m68k #define tb_gen_code tb_gen_code_m68k #define tb_hash_remove tb_hash_remove_m68k #define tb_htable_lookup tb_htable_lookup_m68k @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_m68k #define tb_phys_hash_func tb_phys_hash_func_m68k #define tb_phys_invalidate tb_phys_invalidate_m68k +#define tb_remove tb_remove_m68k #define tb_reset_jump tb_reset_jump_m68k #define tb_set_jmp_target tb_set_jmp_target_m68k #define tcg_accel_class_init tcg_accel_class_init_m68k diff --git a/qemu/mips.h b/qemu/mips.h index 0d5f22e5..a9e30d2f 100644 --- a/qemu/mips.h +++ b/qemu/mips.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_mips #define tb_flush tb_flush_mips #define tb_flush_jmp_cache tb_flush_jmp_cache_mips -#define tb_free tb_free_mips #define tb_gen_code tb_gen_code_mips #define tb_hash_remove tb_hash_remove_mips #define tb_htable_lookup tb_htable_lookup_mips @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_mips #define tb_phys_hash_func tb_phys_hash_func_mips #define tb_phys_invalidate tb_phys_invalidate_mips +#define tb_remove tb_remove_mips #define tb_reset_jump tb_reset_jump_mips #define tb_set_jmp_target tb_set_jmp_target_mips #define tcg_accel_class_init tcg_accel_class_init_mips diff --git a/qemu/mips64.h b/qemu/mips64.h index 73f2944c..9b564d4d 100644 --- a/qemu/mips64.h +++ b/qemu/mips64.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_mips64 #define tb_flush tb_flush_mips64 #define tb_flush_jmp_cache tb_flush_jmp_cache_mips64 -#define tb_free tb_free_mips64 #define tb_gen_code tb_gen_code_mips64 #define tb_hash_remove tb_hash_remove_mips64 #define tb_htable_lookup tb_htable_lookup_mips64 @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_mips64 #define tb_phys_hash_func tb_phys_hash_func_mips64 #define tb_phys_invalidate tb_phys_invalidate_mips64 +#define tb_remove tb_remove_mips64 #define tb_reset_jump tb_reset_jump_mips64 #define tb_set_jmp_target tb_set_jmp_target_mips64 #define tcg_accel_class_init tcg_accel_class_init_mips64 diff --git a/qemu/mips64el.h b/qemu/mips64el.h index 8edb64e1..f982c765 100644 --- a/qemu/mips64el.h +++ b/qemu/mips64el.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_mips64el #define tb_flush tb_flush_mips64el #define tb_flush_jmp_cache tb_flush_jmp_cache_mips64el -#define tb_free tb_free_mips64el #define tb_gen_code tb_gen_code_mips64el #define tb_hash_remove tb_hash_remove_mips64el #define tb_htable_lookup tb_htable_lookup_mips64el @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_mips64el #define tb_phys_hash_func tb_phys_hash_func_mips64el #define tb_phys_invalidate tb_phys_invalidate_mips64el +#define tb_remove tb_remove_mips64el #define tb_reset_jump tb_reset_jump_mips64el #define tb_set_jmp_target tb_set_jmp_target_mips64el #define tcg_accel_class_init tcg_accel_class_init_mips64el diff --git a/qemu/mipsel.h b/qemu/mipsel.h index 46ba1751..16402ce2 100644 --- a/qemu/mipsel.h +++ b/qemu/mipsel.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_mipsel #define tb_flush tb_flush_mipsel #define tb_flush_jmp_cache tb_flush_jmp_cache_mipsel -#define tb_free tb_free_mipsel #define tb_gen_code tb_gen_code_mipsel #define tb_hash_remove tb_hash_remove_mipsel #define tb_htable_lookup tb_htable_lookup_mipsel @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_mipsel #define tb_phys_hash_func tb_phys_hash_func_mipsel #define tb_phys_invalidate tb_phys_invalidate_mipsel +#define tb_remove tb_remove_mipsel #define tb_reset_jump tb_reset_jump_mipsel #define tb_set_jmp_target tb_set_jmp_target_mipsel #define tcg_accel_class_init tcg_accel_class_init_mipsel diff --git a/qemu/powerpc.h b/qemu/powerpc.h index 92048014..84365cf3 100644 --- a/qemu/powerpc.h +++ b/qemu/powerpc.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_powerpc #define tb_flush tb_flush_powerpc #define tb_flush_jmp_cache tb_flush_jmp_cache_powerpc -#define tb_free tb_free_powerpc #define tb_gen_code tb_gen_code_powerpc #define tb_hash_remove tb_hash_remove_powerpc #define tb_htable_lookup tb_htable_lookup_powerpc @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_powerpc #define tb_phys_hash_func tb_phys_hash_func_powerpc #define tb_phys_invalidate tb_phys_invalidate_powerpc +#define tb_remove tb_remove_powerpc #define tb_reset_jump tb_reset_jump_powerpc #define tb_set_jmp_target tb_set_jmp_target_powerpc #define tcg_accel_class_init tcg_accel_class_init_powerpc diff --git a/qemu/sparc.h b/qemu/sparc.h index ec19d7e6..a4924f5d 100644 --- a/qemu/sparc.h +++ b/qemu/sparc.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_sparc #define tb_flush tb_flush_sparc #define tb_flush_jmp_cache tb_flush_jmp_cache_sparc -#define tb_free tb_free_sparc #define tb_gen_code tb_gen_code_sparc #define tb_hash_remove tb_hash_remove_sparc #define tb_htable_lookup tb_htable_lookup_sparc @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_sparc #define tb_phys_hash_func tb_phys_hash_func_sparc #define tb_phys_invalidate tb_phys_invalidate_sparc +#define tb_remove tb_remove_sparc #define tb_reset_jump tb_reset_jump_sparc #define tb_set_jmp_target tb_set_jmp_target_sparc #define tcg_accel_class_init tcg_accel_class_init_sparc diff --git a/qemu/sparc64.h b/qemu/sparc64.h index 028f5809..017822f6 100644 --- a/qemu/sparc64.h +++ b/qemu/sparc64.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_sparc64 #define tb_flush tb_flush_sparc64 #define tb_flush_jmp_cache tb_flush_jmp_cache_sparc64 -#define tb_free tb_free_sparc64 #define tb_gen_code tb_gen_code_sparc64 #define tb_hash_remove tb_hash_remove_sparc64 #define tb_htable_lookup tb_htable_lookup_sparc64 @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_sparc64 #define tb_phys_hash_func tb_phys_hash_func_sparc64 #define tb_phys_invalidate tb_phys_invalidate_sparc64 +#define tb_remove tb_remove_sparc64 #define tb_reset_jump tb_reset_jump_sparc64 #define tb_set_jmp_target tb_set_jmp_target_sparc64 #define tcg_accel_class_init tcg_accel_class_init_sparc64 diff --git a/qemu/x86_64.h b/qemu/x86_64.h index 171f1bcf..45dd40e8 100644 --- a/qemu/x86_64.h +++ b/qemu/x86_64.h @@ -2439,7 +2439,6 @@ #define tb_find_slow tb_find_slow_x86_64 #define tb_flush tb_flush_x86_64 #define tb_flush_jmp_cache tb_flush_jmp_cache_x86_64 -#define tb_free tb_free_x86_64 #define tb_gen_code tb_gen_code_x86_64 #define tb_hash_remove tb_hash_remove_x86_64 #define tb_htable_lookup tb_htable_lookup_x86_64 @@ -2454,6 +2453,7 @@ #define tb_page_remove tb_page_remove_x86_64 #define tb_phys_hash_func tb_phys_hash_func_x86_64 #define tb_phys_invalidate tb_phys_invalidate_x86_64 +#define tb_remove tb_remove_x86_64 #define tb_reset_jump tb_reset_jump_x86_64 #define tb_set_jmp_target tb_set_jmp_target_x86_64 #define tcg_accel_class_init tcg_accel_class_init_x86_64