diff mbox

[10/10] tcg: rename tb_find_physical()

Message ID 1468917141-8155-11-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini July 19, 2016, 8:32 a.m. UTC
From: Sergey Fedorov <serge.fdrv@gmail.com>

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.

Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com>
Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org>
Message-Id: <20160715175852.30749-13-sergey.fedorov@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 cpu-exec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Alex Bennée Sept. 8, 2016, 12:39 p.m. UTC | #1
Paolo Bonzini <pbonzini@redhat.com> writes:

> From: Sergey Fedorov <serge.fdrv@gmail.com>
>
> 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.
>
> Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com>
> Signed-off-by: Sergey Fedorov <sergey.fedorov@linaro.org>
> Message-Id: <20160715175852.30749-13-sergey.fedorov@linaro.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  cpu-exec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/cpu-exec.c b/cpu-exec.c
> index f7f60b1..b240b9f 100644
> --- a/cpu-exec.c
> +++ b/cpu-exec.c
> @@ -260,7 +260,7 @@ static bool tb_cmp(const void *p, const void *d)
>      return false;
>  }
>
> -static TranslationBlock *tb_find_physical(CPUState *cpu,
> +static TranslationBlock *tb_htable_lookup(CPUState *cpu,
>                                            target_ulong pc,
>                                            target_ulong cs_base,
>                                            uint32_t flags)
> @@ -296,7 +296,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
> @@ -310,7 +310,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);


--
Alex Bennée
diff mbox

Patch

diff --git a/cpu-exec.c b/cpu-exec.c
index f7f60b1..b240b9f 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -260,7 +260,7 @@  static bool tb_cmp(const void *p, const void *d)
     return false;
 }
 
-static TranslationBlock *tb_find_physical(CPUState *cpu,
+static TranslationBlock *tb_htable_lookup(CPUState *cpu,
                                           target_ulong pc,
                                           target_ulong cs_base,
                                           uint32_t flags)
@@ -296,7 +296,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
@@ -310,7 +310,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);