qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/2] accel/tcg: Move tcg_cflags_has/set() to 'exec/transla


From: Richard Henderson
Subject: Re: [PATCH v2 1/2] accel/tcg: Move tcg_cflags_has/set() to 'exec/translation-block.h'
Date: Thu, 12 Dec 2024 09:09:28 -0600
User-agent: Mozilla Thunderbird

On 12/12/24 09:00, Philippe Mathieu-Daudé wrote:
On 12/12/24 15:44, Philippe Mathieu-Daudé wrote:
The TranslationBlock flags are defined in 'exec/translation-block.h'.
tcg_cflags_has/set() and curr_cflags() use them, it is more logical
to declare them in the same place. Move them there too.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  include/exec/cpu-common.h               | 6 ------
  include/exec/translation-block.h        | 6 ++++++
  accel/tcg/cpu-exec.c                    | 1 +
  accel/tcg/tcg-accel-ops.c               | 1 +
  accel/tcg/watchpoint.c                  | 1 +
  linux-user/mmap.c                       | 1 +
  linux-user/syscall.c                    | 1 +
  target/arm/cpu.c                        | 1 +
  target/avr/cpu.c                        | 1 +
  target/hexagon/cpu.c                    | 1 +
  target/hppa/cpu.c                       | 1 +
  target/i386/cpu.c                       | 1 +
  target/i386/helper.c                    | 1 +
  target/loongarch/cpu.c                  | 1 +
  target/microblaze/cpu.c                 | 1 +
  target/mips/tcg/exception.c             | 1 +
  target/mips/tcg/sysemu/special_helper.c | 1 +
  target/openrisc/cpu.c                   | 1 +
  target/riscv/tcg/tcg-cpu.c              | 1 +
  target/rx/cpu.c                         | 1 +
  target/sh4/cpu.c                        | 1 +
  target/sparc/cpu.c                      | 1 +
  target/tricore/cpu.c                    | 1 +
  23 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 638dc806a5f..bdeb9d68f32 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -187,12 +187,6 @@ void list_cpus(void);
  #ifdef CONFIG_TCG
-bool tcg_cflags_has(CPUState *cpu, uint32_t flags);
-void tcg_cflags_set(CPUState *cpu, uint32_t flags);
-
-/* current cflags for hashing/comparison */
-uint32_t curr_cflags(CPUState *cpu);
-
  /**
   * cpu_unwind_state_data:
   * @cpu: the cpu context
diff --git a/include/exec/translation-block.h b/include/exec/translation-block.h
index b99afb00779..c1e48a48aab 100644
--- a/include/exec/translation-block.h
+++ b/include/exec/translation-block.h
@@ -153,4 +153,10 @@ static inline uint32_t tb_cflags(const TranslationBlock 
*tb)
      return qatomic_read(&tb->cflags);
  }
+bool tcg_cflags_has(CPUState *cpu, uint32_t flags);
+void tcg_cflags_set(CPUState *cpu, uint32_t flags);
+
+/* current cflags for hashing/comparison */
+uint32_t curr_cflags(CPUState *cpu);

Per this comment I suppose accel/tcg/tb-hash.h is better for
curr_cflags(). Also because it is internal to accel/tcg/.

Given the usage of curr_cflags() in accel/tcg/watchpoint.c, accel/tcg/internal-common.h would be the place. tb-hash.h strictly concerns the hashing itself.

With that,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>







reply via email to

[Prev in Thread] Current Thread [Next in Thread]