From 58ff61870889d2c31e45af8183cfdbd8383a2c0d Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Mon, 26 Feb 2018 02:06:52 -0500 Subject: [PATCH] tcg: rename tb_find_physical() In fact, this function does not exactly perform a lookup by physical address as it is descibed for comment on get_page_addr_code(). Thus it may be a bit confusing to have "physical" in it's name. So rename it to tb_htable_lookup() to better reflect its actual functionality. Backports commit b34de45fc40d01c14b31d3a682e284180a2ed8c5 from qemu --- qemu/cpu-exec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu/cpu-exec.c b/qemu/cpu-exec.c index 204bb78e..2143433e 100644 --- a/qemu/cpu-exec.c +++ b/qemu/cpu-exec.c @@ -83,7 +83,7 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) return ret; } -static TranslationBlock *tb_find_physical(CPUState *cpu, +static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, target_ulong cs_base, uint32_t flags) @@ -155,7 +155,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu, tb = atomic_read(&cpu->tb_jmp_cache[tb_jmp_cache_hash_func(pc)]); if (unlikely(!tb || tb->pc != pc || tb->cs_base != cs_base || tb->flags != flags)) { - tb = tb_find_physical(cpu, pc, cs_base, flags); + tb = tb_htable_lookup(cpu, pc, cs_base, flags); if (!tb) { /* mmap_lock is needed by tb_gen_code, and mmap_lock must be * taken outside tb_lock. As system emulation is currently @@ -169,7 +169,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu, /* There's a chance that our desired tb has been translated while * taking the locks so we check again inside the lock. */ - tb = tb_find_physical(cpu, pc, cs_base, flags); + tb = tb_htable_lookup(cpu, pc, cs_base, flags); if (!tb) { /* if no translated code available, then translate it now */ tb = tb_gen_code(cpu, pc, cs_base, flags, 0);