diff mbox series

[RFC,5/6] accel/tcg: Restrict cpu_io_recompile() from other accelerators

Message ID 20210117164813.4101761-6-f4bug@amsat.org (mailing list archive)
State New, archived
Headers show
Series accel: Restrict TCG-specific code | expand

Commit Message

Philippe Mathieu-Daudé Jan. 17, 2021, 4:48 p.m. UTC
As cpu_io_recompile() is only called within TCG accelerator
in cputlb.c, declare it locally.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
RFC because not sure if other accelerator could implement this.
---
 accel/tcg/internal.h    | 2 ++
 include/exec/exec-all.h | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Claudio Fontana Jan. 18, 2021, 9:04 a.m. UTC | #1
On 1/17/21 5:48 PM, Philippe Mathieu-Daudé wrote:
> As cpu_io_recompile() is only called within TCG accelerator
> in cputlb.c, declare it locally.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

It's only used in accel/tcg/cputlb.c, should it be a static function there?


> ---
> RFC because not sure if other accelerator could implement this.
> ---
>  accel/tcg/internal.h    | 2 ++
>  include/exec/exec-all.h | 1 -
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
> index f7e18c3498b..c72a69e4d63 100644
> --- a/accel/tcg/internal.h
> +++ b/accel/tcg/internal.h
> @@ -18,4 +18,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
>  
>  void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr);
>  
> +void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
> +
>  #endif
> diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
> index 3acc7c2943a..125000bcf70 100644
> --- a/include/exec/exec-all.h
> +++ b/include/exec/exec-all.h
> @@ -63,7 +63,6 @@ void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb,
>  bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exit);
>  
>  void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu);
> -void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
>  void QEMU_NORETURN cpu_loop_exit(CPUState *cpu);
>  void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
>  void QEMU_NORETURN cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
>
Richard Henderson Jan. 21, 2021, 6:53 a.m. UTC | #2
On 1/17/21 6:48 AM, Philippe Mathieu-Daudé wrote:
> As cpu_io_recompile() is only called within TCG accelerator
> in cputlb.c, declare it locally.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> RFC because not sure if other accelerator could implement this.
> ---
>  accel/tcg/internal.h    | 2 ++
>  include/exec/exec-all.h | 1 -
>  2 files changed, 2 insertions(+), 1 deletion(-)

Queued to tcg-next.

r~
diff mbox series

Patch

diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
index f7e18c3498b..c72a69e4d63 100644
--- a/accel/tcg/internal.h
+++ b/accel/tcg/internal.h
@@ -18,4 +18,6 @@  TranslationBlock *tb_gen_code(CPUState *cpu,
 
 void tb_flush_jmp_cache(CPUState *cpu, target_ulong addr);
 
+void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
+
 #endif
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 3acc7c2943a..125000bcf70 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -63,7 +63,6 @@  void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb,
 bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exit);
 
 void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu);
-void QEMU_NORETURN cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);
 void QEMU_NORETURN cpu_loop_exit(CPUState *cpu);
 void QEMU_NORETURN cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
 void QEMU_NORETURN cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);