diff mbox series

[09/18] accel/tcg: Un-inline log_pc()

Message ID 20241212185341.2857-10-philmd@linaro.org
State New
Headers show
Series accel/tcg: Extract user APIs out of 'exec/[cpu, exec]-all.h' | expand

Commit Message

Philippe Mathieu-Daudé Dec. 12, 2024, 6:53 p.m. UTC
log_pc() is only used within cpu-exec.c, no need to
expose it via "internal-target.h".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/tcg/internal-target.h | 10 ----------
 accel/tcg/cpu-exec.c        | 11 +++++++++++
 2 files changed, 11 insertions(+), 10 deletions(-)

Comments

Pierrick Bouvier Dec. 12, 2024, 7:25 p.m. UTC | #1
On 12/12/24 10:53, Philippe Mathieu-Daudé wrote:
> log_pc() is only used within cpu-exec.c, no need to
> expose it via "internal-target.h".
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/tcg/internal-target.h | 10 ----------
>   accel/tcg/cpu-exec.c        | 11 +++++++++++
>   2 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h
> index 6f4ec0bd424..0437d798295 100644
> --- a/accel/tcg/internal-target.h
> +++ b/accel/tcg/internal-target.h
> @@ -72,16 +72,6 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
>   
>   bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc);
>   
> -/* Return the current PC from CPU, which may be cached in TB. */
> -static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb)
> -{
> -    if (tb_cflags(tb) & CF_PCREL) {
> -        return cpu->cc->get_pc(cpu);
> -    } else {
> -        return tb->pc;
> -    }
> -}
> -
>   /**
>    * tcg_req_mo:
>    * @type: TCGBar
> diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
> index f82870a1e2a..396fa6f4a6b 100644
> --- a/accel/tcg/cpu-exec.c
> +++ b/accel/tcg/cpu-exec.c
> @@ -21,6 +21,7 @@
>   #include "qemu/qemu-print.h"
>   #include "qapi/error.h"
>   #include "qapi/type-helpers.h"
> +#include "hw/core/cpu.h"
>   #include "hw/core/tcg-cpu-ops.h"
>   #include "trace.h"
>   #include "disas/disas.h"
> @@ -434,6 +435,16 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env)
>       return tb->tc.ptr;
>   }
>   
> +/* Return the current PC from CPU, which may be cached in TB. */
> +static vaddr log_pc(CPUState *cpu, const TranslationBlock *tb)
> +{
> +    if (tb_cflags(tb) & CF_PCREL) {
> +        return cpu->cc->get_pc(cpu);
> +    } else {
> +        return tb->pc;
> +    }
> +}
> +
>   /* Execute a TB, and fix up the CPU state afterwards if necessary */
>   /*
>    * Disable CFI checks.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
diff mbox series

Patch

diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h
index 6f4ec0bd424..0437d798295 100644
--- a/accel/tcg/internal-target.h
+++ b/accel/tcg/internal-target.h
@@ -72,16 +72,6 @@  G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
 
 bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc);
 
-/* Return the current PC from CPU, which may be cached in TB. */
-static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb)
-{
-    if (tb_cflags(tb) & CF_PCREL) {
-        return cpu->cc->get_pc(cpu);
-    } else {
-        return tb->pc;
-    }
-}
-
 /**
  * tcg_req_mo:
  * @type: TCGBar
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index f82870a1e2a..396fa6f4a6b 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -21,6 +21,7 @@ 
 #include "qemu/qemu-print.h"
 #include "qapi/error.h"
 #include "qapi/type-helpers.h"
+#include "hw/core/cpu.h"
 #include "hw/core/tcg-cpu-ops.h"
 #include "trace.h"
 #include "disas/disas.h"
@@ -434,6 +435,16 @@  const void *HELPER(lookup_tb_ptr)(CPUArchState *env)
     return tb->tc.ptr;
 }
 
+/* Return the current PC from CPU, which may be cached in TB. */
+static vaddr log_pc(CPUState *cpu, const TranslationBlock *tb)
+{
+    if (tb_cflags(tb) & CF_PCREL) {
+        return cpu->cc->get_pc(cpu);
+    } else {
+        return tb->pc;
+    }
+}
+
 /* Execute a TB, and fix up the CPU state afterwards if necessary */
 /*
  * Disable CFI checks.