* [PATCH 01/11] exec: Make EXCP_FOO definitions target agnostic
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 13:24 ` Anton Johansson via
2023-09-14 18:57 ` [PATCH 02/11] exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h' Philippe Mathieu-Daudé
` (10 subsequent siblings)
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
The EXCP_* definitions don't need to be target specific,
move them to "exec/cpu-common.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/exec/cpu-all.h | 7 -------
include/exec/cpu-common.h | 7 +++++++
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 3b1cec390b..71efc2d404 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -26,13 +26,6 @@
#include "hw/core/cpu.h"
#include "qemu/rcu.h"
-#define EXCP_INTERRUPT 0x10000 /* async interruption */
-#define EXCP_HLT 0x10001 /* hlt instruction reached */
-#define EXCP_DEBUG 0x10002 /* cpu stopped after a breakpoint or singlestep */
-#define EXCP_HALTED 0x10003 /* cpu is halted (waiting for external event) */
-#define EXCP_YIELD 0x10004 /* cpu wants to yield timeslice to another */
-#define EXCP_ATOMIC 0x10005 /* stop-the-world and emulate atomic */
-
/* some important defines:
*
* HOST_BIG_ENDIAN : whether the host cpu is big endian and
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 41788c0bdd..360b8298a4 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -7,6 +7,13 @@
#include "exec/hwaddr.h"
#endif
+#define EXCP_INTERRUPT 0x10000 /* async interruption */
+#define EXCP_HLT 0x10001 /* hlt instruction reached */
+#define EXCP_DEBUG 0x10002 /* cpu stopped after a breakpoint or singlestep */
+#define EXCP_HALTED 0x10003 /* cpu is halted (waiting for external event) */
+#define EXCP_YIELD 0x10004 /* cpu wants to yield timeslice to another */
+#define EXCP_ATOMIC 0x10005 /* stop-the-world and emulate atomic */
+
/**
* vaddr:
* Type wide enough to contain any #target_ulong virtual address.
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 01/11] exec: Make EXCP_FOO definitions target agnostic
2023-09-14 18:57 ` [PATCH 01/11] exec: Make EXCP_FOO definitions target agnostic Philippe Mathieu-Daudé
@ 2023-09-15 13:24 ` Anton Johansson via
0 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 13:24 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> The EXCP_* definitions don't need to be target specific,
> move them to "exec/cpu-common.h".
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/exec/cpu-all.h | 7 -------
> include/exec/cpu-common.h | 7 +++++++
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
> index 3b1cec390b..71efc2d404 100644
> --- a/include/exec/cpu-all.h
> +++ b/include/exec/cpu-all.h
> @@ -26,13 +26,6 @@
> #include "hw/core/cpu.h"
> #include "qemu/rcu.h"
>
> -#define EXCP_INTERRUPT 0x10000 /* async interruption */
> -#define EXCP_HLT 0x10001 /* hlt instruction reached */
> -#define EXCP_DEBUG 0x10002 /* cpu stopped after a breakpoint or singlestep */
> -#define EXCP_HALTED 0x10003 /* cpu is halted (waiting for external event) */
> -#define EXCP_YIELD 0x10004 /* cpu wants to yield timeslice to another */
> -#define EXCP_ATOMIC 0x10005 /* stop-the-world and emulate atomic */
> -
> /* some important defines:
> *
> * HOST_BIG_ENDIAN : whether the host cpu is big endian and
> diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
> index 41788c0bdd..360b8298a4 100644
> --- a/include/exec/cpu-common.h
> +++ b/include/exec/cpu-common.h
> @@ -7,6 +7,13 @@
> #include "exec/hwaddr.h"
> #endif
>
> +#define EXCP_INTERRUPT 0x10000 /* async interruption */
> +#define EXCP_HLT 0x10001 /* hlt instruction reached */
> +#define EXCP_DEBUG 0x10002 /* cpu stopped after a breakpoint or singlestep */
> +#define EXCP_HALTED 0x10003 /* cpu is halted (waiting for external event) */
> +#define EXCP_YIELD 0x10004 /* cpu wants to yield timeslice to another */
> +#define EXCP_ATOMIC 0x10005 /* stop-the-world and emulate atomic */
> +
> /**
> * vaddr:
> * Type wide enough to contain any #target_ulong virtual address.
> --
> 2.41.0
>
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 02/11] exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h'
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
2023-09-14 18:57 ` [PATCH 01/11] exec: Make EXCP_FOO definitions target agnostic Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 13:54 ` Anton Johansson via
2023-09-14 18:57 ` [PATCH 03/11] accel/tcg: Restrict dump_exec_info() declaration Philippe Mathieu-Daudé
` (9 subsequent siblings)
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
While these functions are not TCG specific, they are not target
specific. Move them to "exec/cpu-common.h" so their callers don't
have to be tainted as target specific.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/exec/cpu-common.h | 32 ++++++++++++++++++++++++++++++++
include/exec/exec-all.h | 30 ------------------------------
2 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 360b8298a4..605b160a7e 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -173,4 +173,36 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
/* vl.c */
void list_cpus(void);
+#ifdef CONFIG_TCG
+/**
+ * cpu_unwind_state_data:
+ * @cpu: the cpu context
+ * @host_pc: the host pc within the translation
+ * @data: output data
+ *
+ * Attempt to load the the unwind state for a host pc occurring in
+ * translated code. If @host_pc is not in translated code, the
+ * function returns false; otherwise @data is loaded.
+ * This is the same unwind info as given to restore_state_to_opc.
+ */
+bool cpu_unwind_state_data(CPUState *cpu, uintptr_t host_pc, uint64_t *data);
+
+/**
+ * cpu_restore_state:
+ * @cpu: the cpu context
+ * @host_pc: the host pc within the translation
+ * @return: true if state was restored, false otherwise
+ *
+ * Attempt to restore the state for a fault occurring in translated
+ * code. If @host_pc is not in translated code no state is
+ * restored and the function returns false.
+ */
+bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
+
+G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu);
+G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
+#endif /* CONFIG_TCG */
+G_NORETURN void cpu_loop_exit(CPUState *cpu);
+G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
+
#endif /* CPU_COMMON_H */
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 2e4d337805..ee90ef122b 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -27,36 +27,6 @@
#include "exec/translation-block.h"
#include "qemu/clang-tsa.h"
-/**
- * cpu_unwind_state_data:
- * @cpu: the cpu context
- * @host_pc: the host pc within the translation
- * @data: output data
- *
- * Attempt to load the the unwind state for a host pc occurring in
- * translated code. If @host_pc is not in translated code, the
- * function returns false; otherwise @data is loaded.
- * This is the same unwind info as given to restore_state_to_opc.
- */
-bool cpu_unwind_state_data(CPUState *cpu, uintptr_t host_pc, uint64_t *data);
-
-/**
- * cpu_restore_state:
- * @cpu: the cpu context
- * @host_pc: the host pc within the translation
- * @return: true if state was restored, false otherwise
- *
- * Attempt to restore the state for a fault occurring in translated
- * code. If @host_pc is not in translated code no state is
- * restored and the function returns false.
- */
-bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
-
-G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu);
-G_NORETURN void cpu_loop_exit(CPUState *cpu);
-G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
-G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
-
/**
* cpu_loop_exit_requested:
* @cpu: The CPU state to be tested
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 02/11] exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h'
2023-09-14 18:57 ` [PATCH 02/11] exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h' Philippe Mathieu-Daudé
@ 2023-09-15 13:54 ` Anton Johansson via
0 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 13:54 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> While these functions are not TCG specific, they are not target
> specific. Move them to "exec/cpu-common.h" so their callers don't
> have to be tainted as target specific.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/exec/cpu-common.h | 32 ++++++++++++++++++++++++++++++++
> include/exec/exec-all.h | 30 ------------------------------
> 2 files changed, 32 insertions(+), 30 deletions(-)
>
> diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
> index 360b8298a4..605b160a7e 100644
> --- a/include/exec/cpu-common.h
> +++ b/include/exec/cpu-common.h
> @@ -173,4 +173,36 @@ int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
> /* vl.c */
> void list_cpus(void);
>
> +#ifdef CONFIG_TCG
> +/**
> + * cpu_unwind_state_data:
> + * @cpu: the cpu context
> + * @host_pc: the host pc within the translation
> + * @data: output data
> + *
> + * Attempt to load the the unwind state for a host pc occurring in
> + * translated code. If @host_pc is not in translated code, the
> + * function returns false; otherwise @data is loaded.
> + * This is the same unwind info as given to restore_state_to_opc.
> + */
> +bool cpu_unwind_state_data(CPUState *cpu, uintptr_t host_pc, uint64_t *data);
> +
> +/**
> + * cpu_restore_state:
> + * @cpu: the cpu context
> + * @host_pc: the host pc within the translation
> + * @return: true if state was restored, false otherwise
> + *
> + * Attempt to restore the state for a fault occurring in translated
> + * code. If @host_pc is not in translated code no state is
> + * restored and the function returns false.
> + */
> +bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
> +
> +G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu);
> +G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
> +#endif /* CONFIG_TCG */
> +G_NORETURN void cpu_loop_exit(CPUState *cpu);
> +G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
> +
> #endif /* CPU_COMMON_H */
> diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
> index 2e4d337805..ee90ef122b 100644
> --- a/include/exec/exec-all.h
> +++ b/include/exec/exec-all.h
> @@ -27,36 +27,6 @@
> #include "exec/translation-block.h"
> #include "qemu/clang-tsa.h"
>
> -/**
> - * cpu_unwind_state_data:
> - * @cpu: the cpu context
> - * @host_pc: the host pc within the translation
> - * @data: output data
> - *
> - * Attempt to load the the unwind state for a host pc occurring in
> - * translated code. If @host_pc is not in translated code, the
> - * function returns false; otherwise @data is loaded.
> - * This is the same unwind info as given to restore_state_to_opc.
> - */
> -bool cpu_unwind_state_data(CPUState *cpu, uintptr_t host_pc, uint64_t *data);
> -
> -/**
> - * cpu_restore_state:
> - * @cpu: the cpu context
> - * @host_pc: the host pc within the translation
> - * @return: true if state was restored, false otherwise
> - *
> - * Attempt to restore the state for a fault occurring in translated
> - * code. If @host_pc is not in translated code no state is
> - * restored and the function returns false.
> - */
> -bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc);
> -
> -G_NORETURN void cpu_loop_exit_noexc(CPUState *cpu);
> -G_NORETURN void cpu_loop_exit(CPUState *cpu);
> -G_NORETURN void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc);
> -G_NORETURN void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc);
> -
> /**
> * cpu_loop_exit_requested:
> * @cpu: The CPU state to be tested
> --
> 2.41.0
>
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 03/11] accel/tcg: Restrict dump_exec_info() declaration
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
2023-09-14 18:57 ` [PATCH 01/11] exec: Make EXCP_FOO definitions target agnostic Philippe Mathieu-Daudé
2023-09-14 18:57 ` [PATCH 02/11] exec: Move cpu_loop_foo() target agnostic functions to 'cpu-common.h' Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 13:56 ` Anton Johansson via
2023-09-14 18:57 ` [PATCH 04/11] accel: Make accel-blocker.o target agnostic Philippe Mathieu-Daudé
` (8 subsequent siblings)
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
In commit 00c9a5c2c3 ("accel/tcg: Restrict 'qapi-commands-machine.h'
to system emulation") we moved the definition to accel/tcg/ which is
where this function is called. No need to expose it outside.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/tcg/internal.h | 2 ++
include/exec/cpu-all.h | 5 -----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
index e8cbbde581..cd6b9eb7f0 100644
--- a/accel/tcg/internal.h
+++ b/accel/tcg/internal.h
@@ -102,6 +102,8 @@ static inline bool cpu_in_serial_context(CPUState *cs)
extern int64_t max_delay;
extern int64_t max_advance;
+void dump_exec_info(GString *buf);
+
extern bool one_insn_per_tb;
/**
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 71efc2d404..221ada2b6d 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -406,11 +406,6 @@ static inline bool tlb_hit(uint64_t tlb_addr, vaddr addr)
return tlb_hit_page(tlb_addr, addr & TARGET_PAGE_MASK);
}
-#ifdef CONFIG_TCG
-/* accel/tcg/translate-all.c */
-void dump_exec_info(GString *buf);
-#endif /* CONFIG_TCG */
-
#endif /* !CONFIG_USER_ONLY */
/* accel/tcg/cpu-exec.c */
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 03/11] accel/tcg: Restrict dump_exec_info() declaration
2023-09-14 18:57 ` [PATCH 03/11] accel/tcg: Restrict dump_exec_info() declaration Philippe Mathieu-Daudé
@ 2023-09-15 13:56 ` Anton Johansson via
0 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 13:56 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> In commit 00c9a5c2c3 ("accel/tcg: Restrict 'qapi-commands-machine.h'
> to system emulation") we moved the definition to accel/tcg/ which is
> where this function is called. No need to expose it outside.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> accel/tcg/internal.h | 2 ++
> include/exec/cpu-all.h | 5 -----
> 2 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/accel/tcg/internal.h b/accel/tcg/internal.h
> index e8cbbde581..cd6b9eb7f0 100644
> --- a/accel/tcg/internal.h
> +++ b/accel/tcg/internal.h
> @@ -102,6 +102,8 @@ static inline bool cpu_in_serial_context(CPUState *cs)
> extern int64_t max_delay;
> extern int64_t max_advance;
>
> +void dump_exec_info(GString *buf);
> +
> extern bool one_insn_per_tb;
>
> /**
> diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
> index 71efc2d404..221ada2b6d 100644
> --- a/include/exec/cpu-all.h
> +++ b/include/exec/cpu-all.h
> @@ -406,11 +406,6 @@ static inline bool tlb_hit(uint64_t tlb_addr, vaddr addr)
> return tlb_hit_page(tlb_addr, addr & TARGET_PAGE_MASK);
> }
>
> -#ifdef CONFIG_TCG
> -/* accel/tcg/translate-all.c */
> -void dump_exec_info(GString *buf);
> -#endif /* CONFIG_TCG */
> -
> #endif /* !CONFIG_USER_ONLY */
>
> /* accel/tcg/cpu-exec.c */
> --
> 2.41.0
>
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 04/11] accel: Make accel-blocker.o target agnostic
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2023-09-14 18:57 ` [PATCH 03/11] accel/tcg: Restrict dump_exec_info() declaration Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 14:14 ` Anton Johansson via
2023-09-14 18:57 ` [PATCH 05/11] accel: Rename accel-common.c -> accel-target.c Philippe Mathieu-Daudé
` (7 subsequent siblings)
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
accel-blocker.c is not target specific, move it to system_ss[].
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/meson.build | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/accel/meson.build b/accel/meson.build
index 638a9a03ba..76f3cbc530 100644
--- a/accel/meson.build
+++ b/accel/meson.build
@@ -1,5 +1,5 @@
-specific_ss.add(files('accel-common.c', 'accel-blocker.c'))
-system_ss.add(files('accel-softmmu.c'))
+specific_ss.add(files('accel-common.c'))
+system_ss.add(files('accel-softmmu.c', 'accel-blocker.c'))
user_ss.add(files('accel-user.c'))
subdir('tcg')
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 04/11] accel: Make accel-blocker.o target agnostic
2023-09-14 18:57 ` [PATCH 04/11] accel: Make accel-blocker.o target agnostic Philippe Mathieu-Daudé
@ 2023-09-15 14:14 ` Anton Johansson via
0 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 14:14 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> accel-blocker.c is not target specific, move it to system_ss[].
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> accel/meson.build | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/accel/meson.build b/accel/meson.build
> index 638a9a03ba..76f3cbc530 100644
> --- a/accel/meson.build
> +++ b/accel/meson.build
> @@ -1,5 +1,5 @@
> -specific_ss.add(files('accel-common.c', 'accel-blocker.c'))
> -system_ss.add(files('accel-softmmu.c'))
> +specific_ss.add(files('accel-common.c'))
> +system_ss.add(files('accel-softmmu.c', 'accel-blocker.c'))
> user_ss.add(files('accel-user.c'))
>
> subdir('tcg')
> --
> 2.41.0
>
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 05/11] accel: Rename accel-common.c -> accel-target.c
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2023-09-14 18:57 ` [PATCH 04/11] accel: Make accel-blocker.o target agnostic Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 14:15 ` Anton Johansson via
2023-09-14 18:57 ` [PATCH 06/11] exec: Rename cpu.c -> cpu-target.c Philippe Mathieu-Daudé
` (6 subsequent siblings)
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
We use the '-common.c' suffix for target agnostic units.
This file is target specific, rename it using the '-target'
suffix.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/{accel-common.c => accel-target.c} | 0
accel/meson.build | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
rename accel/{accel-common.c => accel-target.c} (100%)
diff --git a/accel/accel-common.c b/accel/accel-target.c
similarity index 100%
rename from accel/accel-common.c
rename to accel/accel-target.c
diff --git a/accel/meson.build b/accel/meson.build
index 76f3cbc530..fda3157a6e 100644
--- a/accel/meson.build
+++ b/accel/meson.build
@@ -1,4 +1,4 @@
-specific_ss.add(files('accel-common.c'))
+specific_ss.add(files('accel-target.c'))
system_ss.add(files('accel-softmmu.c', 'accel-blocker.c'))
user_ss.add(files('accel-user.c'))
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 05/11] accel: Rename accel-common.c -> accel-target.c
2023-09-14 18:57 ` [PATCH 05/11] accel: Rename accel-common.c -> accel-target.c Philippe Mathieu-Daudé
@ 2023-09-15 14:15 ` Anton Johansson via
0 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 14:15 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> We use the '-common.c' suffix for target agnostic units.
> This file is target specific, rename it using the '-target'
> suffix.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> accel/{accel-common.c => accel-target.c} | 0
> accel/meson.build | 2 +-
> 2 files changed, 1 insertion(+), 1 deletion(-)
> rename accel/{accel-common.c => accel-target.c} (100%)
>
> diff --git a/accel/accel-common.c b/accel/accel-target.c
> similarity index 100%
> rename from accel/accel-common.c
> rename to accel/accel-target.c
> diff --git a/accel/meson.build b/accel/meson.build
> index 76f3cbc530..fda3157a6e 100644
> --- a/accel/meson.build
> +++ b/accel/meson.build
> @@ -1,4 +1,4 @@
> -specific_ss.add(files('accel-common.c'))
> +specific_ss.add(files('accel-target.c'))
> system_ss.add(files('accel-softmmu.c', 'accel-blocker.c'))
> user_ss.add(files('accel-user.c'))
>
> --
> 2.41.0
>
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 06/11] exec: Rename cpu.c -> cpu-target.c
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2023-09-14 18:57 ` [PATCH 05/11] accel: Rename accel-common.c -> accel-target.c Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 14:19 ` Anton Johansson via
2023-09-14 18:57 ` [PATCH 07/11] exec: Rename target specific page-vary.c -> page-vary-target.c Philippe Mathieu-Daudé
` (5 subsequent siblings)
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
We have exec/cpu code split in 2 files for target agnostic
("common") and specific. Rename 'cpu.c' which is target
specific using the '-target' suffix. Update MAINTAINERS.
Remove the 's from 'cpus-common.c' to match the API cpu_foo()
functions.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
MAINTAINERS | 4 ++--
meson.build | 4 ++--
cpus-common.c => cpu-common.c | 0
cpu.c => cpu-target.c | 0
4 files changed, 4 insertions(+), 4 deletions(-)
rename cpus-common.c => cpu-common.c (100%)
rename cpu.c => cpu-target.c (100%)
diff --git a/MAINTAINERS b/MAINTAINERS
index 00562f924f..12261d8eaf 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -139,7 +139,8 @@ R: Paolo Bonzini <pbonzini@redhat.com>
S: Maintained
F: softmmu/cpus.c
F: softmmu/watchpoint.c
-F: cpus-common.c
+F: cpu-common.c
+F: cpu-target.c
F: page-vary.c
F: page-vary-common.c
F: accel/tcg/
@@ -1772,7 +1773,6 @@ M: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
R: Philippe Mathieu-Daudé <philmd@linaro.org>
R: Yanan Wang <wangyanan55@huawei.com>
S: Supported
-F: cpu.c
F: hw/core/cpu.c
F: hw/core/machine-qmp-cmds.c
F: hw/core/machine.c
diff --git a/meson.build b/meson.build
index 5150a74831..3e86a6cebf 100644
--- a/meson.build
+++ b/meson.build
@@ -3416,8 +3416,8 @@ if have_block
system_ss.add(when: 'CONFIG_WIN32', if_true: [files('os-win32.c')])
endif
-common_ss.add(files('cpus-common.c'))
-specific_ss.add(files('cpu.c'))
+common_ss.add(files('cpu-common.c'))
+specific_ss.add(files('cpu-target.c'))
subdir('softmmu')
diff --git a/cpus-common.c b/cpu-common.c
similarity index 100%
rename from cpus-common.c
rename to cpu-common.c
diff --git a/cpu.c b/cpu-target.c
similarity index 100%
rename from cpu.c
rename to cpu-target.c
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 06/11] exec: Rename cpu.c -> cpu-target.c
2023-09-14 18:57 ` [PATCH 06/11] exec: Rename cpu.c -> cpu-target.c Philippe Mathieu-Daudé
@ 2023-09-15 14:19 ` Anton Johansson via
2023-09-15 15:36 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 14:19 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> We have exec/cpu code split in 2 files for target agnostic
> ("common") and specific. Rename 'cpu.c' which is target
> specific using the '-target' suffix. Update MAINTAINERS.
> Remove the 's from 'cpus-common.c' to match the API cpu_foo()
> functions.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> MAINTAINERS | 4 ++--
> meson.build | 4 ++--
> cpus-common.c => cpu-common.c | 0
> cpu.c => cpu-target.c | 0
> 4 files changed, 4 insertions(+), 4 deletions(-)
> rename cpus-common.c => cpu-common.c (100%)
> rename cpu.c => cpu-target.c (100%)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 00562f924f..12261d8eaf 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -139,7 +139,8 @@ R: Paolo Bonzini <pbonzini@redhat.com>
> S: Maintained
> F: softmmu/cpus.c
> F: softmmu/watchpoint.c
> -F: cpus-common.c
> +F: cpu-common.c
> +F: cpu-target.c
> F: page-vary.c
> F: page-vary-common.c
> F: accel/tcg/
> @@ -1772,7 +1773,6 @@ M: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
> R: Philippe Mathieu-Daudé <philmd@linaro.org>
> R: Yanan Wang <wangyanan55@huawei.com>
> S: Supported
> -F: cpu.c
Was the maintainer switch intentional?
Either way,
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 06/11] exec: Rename cpu.c -> cpu-target.c
2023-09-15 14:19 ` Anton Johansson via
@ 2023-09-15 15:36 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-15 15:36 UTC (permalink / raw)
To: Anton Johansson
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 15/9/23 16:19, Anton Johansson wrote:
> On 14/09/23, Philippe Mathieu-Daudé wrote:
>> We have exec/cpu code split in 2 files for target agnostic
>> ("common") and specific. Rename 'cpu.c' which is target
>> specific using the '-target' suffix. Update MAINTAINERS.
>> Remove the 's from 'cpus-common.c' to match the API cpu_foo()
>> functions.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> MAINTAINERS | 4 ++--
>> meson.build | 4 ++--
>> cpus-common.c => cpu-common.c | 0
>> cpu.c => cpu-target.c | 0
>> 4 files changed, 4 insertions(+), 4 deletions(-)
>> rename cpus-common.c => cpu-common.c (100%)
>> rename cpu.c => cpu-target.c (100%)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index 00562f924f..12261d8eaf 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -139,7 +139,8 @@ R: Paolo Bonzini <pbonzini@redhat.com>
>> S: Maintained
>> F: softmmu/cpus.c
>> F: softmmu/watchpoint.c
>> -F: cpus-common.c
>> +F: cpu-common.c
>> +F: cpu-target.c
The renamed file is here ^
>> F: page-vary.c
>> F: page-vary-common.c
>> F: accel/tcg/
>> @@ -1772,7 +1773,6 @@ M: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
>> R: Philippe Mathieu-Daudé <philmd@linaro.org>
>> R: Yanan Wang <wangyanan55@huawei.com>
>> S: Supported
>> -F: cpu.c
> Was the maintainer switch intentional?
(yes, see earlier)
>
> Either way,
> Reviewed-by: Anton Johansson <anjo@rev.ng>
Thanks!
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 07/11] exec: Rename target specific page-vary.c -> page-vary-target.c
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2023-09-14 18:57 ` [PATCH 06/11] exec: Rename cpu.c -> cpu-target.c Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 14:20 ` Anton Johansson via
2023-09-14 18:57 ` [PATCH 08/11] accel/tcg: Rename target-specific 'internal.h' -> 'internal-target.h' Philippe Mathieu-Daudé
` (4 subsequent siblings)
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
This matches the target agnostic 'page-vary-common.c' counterpart.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
MAINTAINERS | 2 +-
meson.build | 2 +-
page-vary.c => page-vary-target.c | 0
3 files changed, 2 insertions(+), 2 deletions(-)
rename page-vary.c => page-vary-target.c (100%)
diff --git a/MAINTAINERS b/MAINTAINERS
index 12261d8eaf..ff436dbf21 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -141,7 +141,7 @@ F: softmmu/cpus.c
F: softmmu/watchpoint.c
F: cpu-common.c
F: cpu-target.c
-F: page-vary.c
+F: page-vary-target.c
F: page-vary-common.c
F: accel/tcg/
F: accel/stubs/tcg-stub.c
diff --git a/meson.build b/meson.build
index 3e86a6cebf..3282f888a3 100644
--- a/meson.build
+++ b/meson.build
@@ -3439,7 +3439,7 @@ if get_option('b_lto')
pagevary = declare_dependency(link_with: pagevary)
endif
common_ss.add(pagevary)
-specific_ss.add(files('page-vary.c'))
+specific_ss.add(files('page-vary-target.c'))
subdir('backends')
subdir('disas')
diff --git a/page-vary.c b/page-vary-target.c
similarity index 100%
rename from page-vary.c
rename to page-vary-target.c
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 07/11] exec: Rename target specific page-vary.c -> page-vary-target.c
2023-09-14 18:57 ` [PATCH 07/11] exec: Rename target specific page-vary.c -> page-vary-target.c Philippe Mathieu-Daudé
@ 2023-09-15 14:20 ` Anton Johansson via
0 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 14:20 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> This matches the target agnostic 'page-vary-common.c' counterpart.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> MAINTAINERS | 2 +-
> meson.build | 2 +-
> page-vary.c => page-vary-target.c | 0
> 3 files changed, 2 insertions(+), 2 deletions(-)
> rename page-vary.c => page-vary-target.c (100%)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 12261d8eaf..ff436dbf21 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -141,7 +141,7 @@ F: softmmu/cpus.c
> F: softmmu/watchpoint.c
> F: cpu-common.c
> F: cpu-target.c
> -F: page-vary.c
> +F: page-vary-target.c
> F: page-vary-common.c
> F: accel/tcg/
> F: accel/stubs/tcg-stub.c
> diff --git a/meson.build b/meson.build
> index 3e86a6cebf..3282f888a3 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -3439,7 +3439,7 @@ if get_option('b_lto')
> pagevary = declare_dependency(link_with: pagevary)
> endif
> common_ss.add(pagevary)
> -specific_ss.add(files('page-vary.c'))
> +specific_ss.add(files('page-vary-target.c'))
>
> subdir('backends')
> subdir('disas')
> diff --git a/page-vary.c b/page-vary-target.c
> similarity index 100%
> rename from page-vary.c
> rename to page-vary-target.c
> --
> 2.41.0
>
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 08/11] accel/tcg: Rename target-specific 'internal.h' -> 'internal-target.h'
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2023-09-14 18:57 ` [PATCH 07/11] exec: Rename target specific page-vary.c -> page-vary-target.c Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 14:22 ` Anton Johansson via
2023-09-14 18:57 ` [PATCH 09/11] accel/tcg: Make monitor.c a target-agnostic unit Philippe Mathieu-Daudé
` (3 subsequent siblings)
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
accel/tcg/internal.h contains target specific declarations.
Unit files including it become "target tainted": they can not
be compiled as target agnostic. Rename using the '-target'
suffix to make this explicit.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/tcg/{internal.h => internal-target.h} | 6 +++---
accel/tcg/cpu-exec-common.c | 2 +-
accel/tcg/cpu-exec.c | 2 +-
accel/tcg/cputlb.c | 2 +-
accel/tcg/monitor.c | 2 +-
accel/tcg/tb-maint.c | 2 +-
accel/tcg/tcg-all.c | 2 +-
accel/tcg/translate-all.c | 2 +-
accel/tcg/translator.c | 2 +-
accel/tcg/user-exec.c | 2 +-
10 files changed, 12 insertions(+), 12 deletions(-)
rename accel/tcg/{internal.h => internal-target.h} (96%)
diff --git a/accel/tcg/internal.h b/accel/tcg/internal-target.h
similarity index 96%
rename from accel/tcg/internal.h
rename to accel/tcg/internal-target.h
index cd6b9eb7f0..4ce3b29056 100644
--- a/accel/tcg/internal.h
+++ b/accel/tcg/internal-target.h
@@ -1,13 +1,13 @@
/*
- * Internal execution defines for qemu
+ * Internal execution defines for qemu (target specific)
*
* Copyright (c) 2003 Fabrice Bellard
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
-#ifndef ACCEL_TCG_INTERNAL_H
-#define ACCEL_TCG_INTERNAL_H
+#ifndef ACCEL_TCG_INTERNAL_TARGET_H
+#define ACCEL_TCG_INTERNAL_TARGET_H
#include "exec/exec-all.h"
#include "exec/translate-all.h"
diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c
index 8ac2af4d0c..55980417b4 100644
--- a/accel/tcg/cpu-exec-common.c
+++ b/accel/tcg/cpu-exec-common.c
@@ -22,7 +22,7 @@
#include "sysemu/tcg.h"
#include "exec/exec-all.h"
#include "qemu/plugin.h"
-#include "internal.h"
+#include "internal-target.h"
bool tcg_allowed;
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 0e7eeef001..f5625e047a 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -42,7 +42,7 @@
#include "tb-jmp-cache.h"
#include "tb-hash.h"
#include "tb-context.h"
-#include "internal.h"
+#include "internal-target.h"
/* -icount align implementation. */
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 31e34700ea..a912d746a9 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -35,7 +35,7 @@
#include "exec/translate-all.h"
#include "trace.h"
#include "tb-hash.h"
-#include "internal.h"
+#include "internal-target.h"
#ifdef CONFIG_PLUGIN
#include "qemu/plugin-memory.h"
#endif
diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c
index d48de23999..30724fdb98 100644
--- a/accel/tcg/monitor.c
+++ b/accel/tcg/monitor.c
@@ -16,7 +16,7 @@
#include "sysemu/cpu-timers.h"
#include "sysemu/tcg.h"
#include "tcg/tcg.h"
-#include "internal.h"
+#include "internal-target.h"
static void dump_drift_info(GString *buf)
diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index 32ae8af61c..85cf51445d 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -29,7 +29,7 @@
#include "tcg/tcg.h"
#include "tb-hash.h"
#include "tb-context.h"
-#include "internal.h"
+#include "internal-target.h"
/* List iterators for lists of tagged pointers in TranslationBlock. */
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index 03dfd67e9e..b32e0b80ec 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -38,7 +38,7 @@
#if !defined(CONFIG_USER_ONLY)
#include "hw/boards.h"
#endif
-#include "internal.h"
+#include "internal-target.h"
struct TCGState {
AccelState parent_obj;
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 83e07b830f..6c09b7f50d 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -61,7 +61,7 @@
#include "tb-jmp-cache.h"
#include "tb-hash.h"
#include "tb-context.h"
-#include "internal.h"
+#include "internal-target.h"
#include "perf.h"
#include "tcg/insn-start-words.h"
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index d9fcb4cbe8..65219b52eb 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -14,7 +14,7 @@
#include "exec/translator.h"
#include "exec/plugin-gen.h"
#include "tcg/tcg-op-common.h"
-#include "internal.h"
+#include "internal-target.h"
static void gen_io_start(void)
{
diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
index 17f9aff0cf..f925dd0305 100644
--- a/accel/tcg/user-exec.c
+++ b/accel/tcg/user-exec.c
@@ -29,7 +29,7 @@
#include "qemu/atomic128.h"
#include "trace/trace-root.h"
#include "tcg/tcg-ldst.h"
-#include "internal.h"
+#include "internal-target.h"
__thread uintptr_t helper_retaddr;
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 08/11] accel/tcg: Rename target-specific 'internal.h' -> 'internal-target.h'
2023-09-14 18:57 ` [PATCH 08/11] accel/tcg: Rename target-specific 'internal.h' -> 'internal-target.h' Philippe Mathieu-Daudé
@ 2023-09-15 14:22 ` Anton Johansson via
0 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 14:22 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> accel/tcg/internal.h contains target specific declarations.
> Unit files including it become "target tainted": they can not
> be compiled as target agnostic. Rename using the '-target'
> suffix to make this explicit.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> accel/tcg/{internal.h => internal-target.h} | 6 +++---
> accel/tcg/cpu-exec-common.c | 2 +-
> accel/tcg/cpu-exec.c | 2 +-
> accel/tcg/cputlb.c | 2 +-
> accel/tcg/monitor.c | 2 +-
> accel/tcg/tb-maint.c | 2 +-
> accel/tcg/tcg-all.c | 2 +-
> accel/tcg/translate-all.c | 2 +-
> accel/tcg/translator.c | 2 +-
> accel/tcg/user-exec.c | 2 +-
> 10 files changed, 12 insertions(+), 12 deletions(-)
> rename accel/tcg/{internal.h => internal-target.h} (96%)
>
> diff --git a/accel/tcg/internal.h b/accel/tcg/internal-target.h
> similarity index 96%
> rename from accel/tcg/internal.h
> rename to accel/tcg/internal-target.h
> index cd6b9eb7f0..4ce3b29056 100644
> --- a/accel/tcg/internal.h
> +++ b/accel/tcg/internal-target.h
> @@ -1,13 +1,13 @@
> /*
> - * Internal execution defines for qemu
> + * Internal execution defines for qemu (target specific)
> *
> * Copyright (c) 2003 Fabrice Bellard
> *
> * SPDX-License-Identifier: LGPL-2.1-or-later
> */
>
> -#ifndef ACCEL_TCG_INTERNAL_H
> -#define ACCEL_TCG_INTERNAL_H
> +#ifndef ACCEL_TCG_INTERNAL_TARGET_H
> +#define ACCEL_TCG_INTERNAL_TARGET_H
>
> #include "exec/exec-all.h"
> #include "exec/translate-all.h"
> diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c
> index 8ac2af4d0c..55980417b4 100644
> --- a/accel/tcg/cpu-exec-common.c
> +++ b/accel/tcg/cpu-exec-common.c
> @@ -22,7 +22,7 @@
> #include "sysemu/tcg.h"
> #include "exec/exec-all.h"
> #include "qemu/plugin.h"
> -#include "internal.h"
> +#include "internal-target.h"
>
> bool tcg_allowed;
>
> diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
> index 0e7eeef001..f5625e047a 100644
> --- a/accel/tcg/cpu-exec.c
> +++ b/accel/tcg/cpu-exec.c
> @@ -42,7 +42,7 @@
> #include "tb-jmp-cache.h"
> #include "tb-hash.h"
> #include "tb-context.h"
> -#include "internal.h"
> +#include "internal-target.h"
>
> /* -icount align implementation. */
>
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index 31e34700ea..a912d746a9 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -35,7 +35,7 @@
> #include "exec/translate-all.h"
> #include "trace.h"
> #include "tb-hash.h"
> -#include "internal.h"
> +#include "internal-target.h"
> #ifdef CONFIG_PLUGIN
> #include "qemu/plugin-memory.h"
> #endif
> diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c
> index d48de23999..30724fdb98 100644
> --- a/accel/tcg/monitor.c
> +++ b/accel/tcg/monitor.c
> @@ -16,7 +16,7 @@
> #include "sysemu/cpu-timers.h"
> #include "sysemu/tcg.h"
> #include "tcg/tcg.h"
> -#include "internal.h"
> +#include "internal-target.h"
>
>
> static void dump_drift_info(GString *buf)
> diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
> index 32ae8af61c..85cf51445d 100644
> --- a/accel/tcg/tb-maint.c
> +++ b/accel/tcg/tb-maint.c
> @@ -29,7 +29,7 @@
> #include "tcg/tcg.h"
> #include "tb-hash.h"
> #include "tb-context.h"
> -#include "internal.h"
> +#include "internal-target.h"
>
>
> /* List iterators for lists of tagged pointers in TranslationBlock. */
> diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
> index 03dfd67e9e..b32e0b80ec 100644
> --- a/accel/tcg/tcg-all.c
> +++ b/accel/tcg/tcg-all.c
> @@ -38,7 +38,7 @@
> #if !defined(CONFIG_USER_ONLY)
> #include "hw/boards.h"
> #endif
> -#include "internal.h"
> +#include "internal-target.h"
>
> struct TCGState {
> AccelState parent_obj;
> diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
> index 83e07b830f..6c09b7f50d 100644
> --- a/accel/tcg/translate-all.c
> +++ b/accel/tcg/translate-all.c
> @@ -61,7 +61,7 @@
> #include "tb-jmp-cache.h"
> #include "tb-hash.h"
> #include "tb-context.h"
> -#include "internal.h"
> +#include "internal-target.h"
> #include "perf.h"
> #include "tcg/insn-start-words.h"
>
> diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
> index d9fcb4cbe8..65219b52eb 100644
> --- a/accel/tcg/translator.c
> +++ b/accel/tcg/translator.c
> @@ -14,7 +14,7 @@
> #include "exec/translator.h"
> #include "exec/plugin-gen.h"
> #include "tcg/tcg-op-common.h"
> -#include "internal.h"
> +#include "internal-target.h"
>
> static void gen_io_start(void)
> {
> diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
> index 17f9aff0cf..f925dd0305 100644
> --- a/accel/tcg/user-exec.c
> +++ b/accel/tcg/user-exec.c
> @@ -29,7 +29,7 @@
> #include "qemu/atomic128.h"
> #include "trace/trace-root.h"
> #include "tcg/tcg-ldst.h"
> -#include "internal.h"
> +#include "internal-target.h"
>
> __thread uintptr_t helper_retaddr;
>
> --
> 2.41.0
>
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 09/11] accel/tcg: Make monitor.c a target-agnostic unit
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2023-09-14 18:57 ` [PATCH 08/11] accel/tcg: Rename target-specific 'internal.h' -> 'internal-target.h' Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 14:25 ` Anton Johansson via
2023-09-14 18:57 ` [PATCH 10/11] accel/tcg: Make icount.o a target agnostic unit Philippe Mathieu-Daudé
` (2 subsequent siblings)
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
Move target-agnostic declarations from "internal-target.h"
to a new "internal-common.h" header.
monitor.c now don't include target specific headers and can
be compiled once in system_ss[].
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/tcg/internal-common.h | 17 +++++++++++++++++
accel/tcg/internal-target.h | 5 -----
accel/tcg/cpu-exec.c | 1 +
accel/tcg/monitor.c | 2 +-
accel/tcg/translate-all.c | 1 +
accel/tcg/meson.build | 3 +++
6 files changed, 23 insertions(+), 6 deletions(-)
create mode 100644 accel/tcg/internal-common.h
diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h
new file mode 100644
index 0000000000..5d5247442e
--- /dev/null
+++ b/accel/tcg/internal-common.h
@@ -0,0 +1,17 @@
+/*
+ * Internal execution defines for qemu (target agnostic)
+ *
+ * Copyright (c) 2003 Fabrice Bellard
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef ACCEL_TCG_INTERNAL_COMMON_H
+#define ACCEL_TCG_INTERNAL_COMMON_H
+
+extern int64_t max_delay;
+extern int64_t max_advance;
+
+void dump_exec_info(GString *buf);
+
+#endif
diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h
index 4ce3b29056..f9eec1ce28 100644
--- a/accel/tcg/internal-target.h
+++ b/accel/tcg/internal-target.h
@@ -99,11 +99,6 @@ static inline bool cpu_in_serial_context(CPUState *cs)
return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs);
}
-extern int64_t max_delay;
-extern int64_t max_advance;
-
-void dump_exec_info(GString *buf);
-
extern bool one_insn_per_tb;
/**
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index f5625e047a..95dd8a30cb 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -42,6 +42,7 @@
#include "tb-jmp-cache.h"
#include "tb-hash.h"
#include "tb-context.h"
+#include "internal-common.h"
#include "internal-target.h"
/* -icount align implementation. */
diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c
index 30724fdb98..caf1189e0b 100644
--- a/accel/tcg/monitor.c
+++ b/accel/tcg/monitor.c
@@ -16,7 +16,7 @@
#include "sysemu/cpu-timers.h"
#include "sysemu/tcg.h"
#include "tcg/tcg.h"
-#include "internal-target.h"
+#include "internal-common.h"
static void dump_drift_info(GString *buf)
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 6c09b7f50d..8cb6ad3511 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -61,6 +61,7 @@
#include "tb-jmp-cache.h"
#include "tb-hash.h"
#include "tb-context.h"
+#include "internal-common.h"
#include "internal-target.h"
#include "perf.h"
#include "tcg/insn-start-words.h"
diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
index 8ace783707..0fb03bd7d3 100644
--- a/accel/tcg/meson.build
+++ b/accel/tcg/meson.build
@@ -20,6 +20,9 @@ specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files(
'cputlb.c',
+))
+
+system_ss.add(when: ['CONFIG_TCG'], if_true: files(
'monitor.c',
))
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 09/11] accel/tcg: Make monitor.c a target-agnostic unit
2023-09-14 18:57 ` [PATCH 09/11] accel/tcg: Make monitor.c a target-agnostic unit Philippe Mathieu-Daudé
@ 2023-09-15 14:25 ` Anton Johansson via
0 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 14:25 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> Move target-agnostic declarations from "internal-target.h"
> to a new "internal-common.h" header.
> monitor.c now don't include target specific headers and can
> be compiled once in system_ss[].
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> accel/tcg/internal-common.h | 17 +++++++++++++++++
> accel/tcg/internal-target.h | 5 -----
> accel/tcg/cpu-exec.c | 1 +
> accel/tcg/monitor.c | 2 +-
> accel/tcg/translate-all.c | 1 +
> accel/tcg/meson.build | 3 +++
> 6 files changed, 23 insertions(+), 6 deletions(-)
> create mode 100644 accel/tcg/internal-common.h
>
> diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h
> new file mode 100644
> index 0000000000..5d5247442e
> --- /dev/null
> +++ b/accel/tcg/internal-common.h
> @@ -0,0 +1,17 @@
> +/*
> + * Internal execution defines for qemu (target agnostic)
> + *
> + * Copyright (c) 2003 Fabrice Bellard
> + *
> + * SPDX-License-Identifier: LGPL-2.1-or-later
> + */
> +
> +#ifndef ACCEL_TCG_INTERNAL_COMMON_H
> +#define ACCEL_TCG_INTERNAL_COMMON_H
> +
> +extern int64_t max_delay;
> +extern int64_t max_advance;
> +
> +void dump_exec_info(GString *buf);
> +
> +#endif
> diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h
> index 4ce3b29056..f9eec1ce28 100644
> --- a/accel/tcg/internal-target.h
> +++ b/accel/tcg/internal-target.h
> @@ -99,11 +99,6 @@ static inline bool cpu_in_serial_context(CPUState *cs)
> return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs);
> }
>
> -extern int64_t max_delay;
> -extern int64_t max_advance;
> -
> -void dump_exec_info(GString *buf);
> -
> extern bool one_insn_per_tb;
>
> /**
> diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
> index f5625e047a..95dd8a30cb 100644
> --- a/accel/tcg/cpu-exec.c
> +++ b/accel/tcg/cpu-exec.c
> @@ -42,6 +42,7 @@
> #include "tb-jmp-cache.h"
> #include "tb-hash.h"
> #include "tb-context.h"
> +#include "internal-common.h"
> #include "internal-target.h"
>
> /* -icount align implementation. */
> diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c
> index 30724fdb98..caf1189e0b 100644
> --- a/accel/tcg/monitor.c
> +++ b/accel/tcg/monitor.c
> @@ -16,7 +16,7 @@
> #include "sysemu/cpu-timers.h"
> #include "sysemu/tcg.h"
> #include "tcg/tcg.h"
> -#include "internal-target.h"
> +#include "internal-common.h"
>
>
> static void dump_drift_info(GString *buf)
> diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
> index 6c09b7f50d..8cb6ad3511 100644
> --- a/accel/tcg/translate-all.c
> +++ b/accel/tcg/translate-all.c
> @@ -61,6 +61,7 @@
> #include "tb-jmp-cache.h"
> #include "tb-hash.h"
> #include "tb-context.h"
> +#include "internal-common.h"
> #include "internal-target.h"
> #include "perf.h"
> #include "tcg/insn-start-words.h"
> diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
> index 8ace783707..0fb03bd7d3 100644
> --- a/accel/tcg/meson.build
> +++ b/accel/tcg/meson.build
> @@ -20,6 +20,9 @@ specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
>
> specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files(
> 'cputlb.c',
> +))
> +
> +system_ss.add(when: ['CONFIG_TCG'], if_true: files(
> 'monitor.c',
> ))
>
> --
> 2.41.0
>
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 10/11] accel/tcg: Make icount.o a target agnostic unit
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2023-09-14 18:57 ` [PATCH 09/11] accel/tcg: Make monitor.c a target-agnostic unit Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 14:31 ` Anton Johansson via
2023-09-14 18:57 ` [PATCH 11/11] accel/tcg: Make cpu-exec-common.c " Philippe Mathieu-Daudé
2023-09-15 12:22 ` [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Anton Johansson via
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
Remove the unused "exec/exec-all.h" header. There is
no more target specific code in it: make it target
agnostic (rename using the '-common' suffix). Since
it is TCG specific, move it to accel/tcg, updating
MAINTAINERS.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
MAINTAINERS | 1 -
softmmu/icount.c => accel/tcg/icount-common.c | 3 +--
accel/tcg/meson.build | 1 +
softmmu/meson.build | 4 ----
4 files changed, 2 insertions(+), 7 deletions(-)
rename softmmu/icount.c => accel/tcg/icount-common.c (99%)
diff --git a/MAINTAINERS b/MAINTAINERS
index ff436dbf21..047d143b9d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2912,7 +2912,6 @@ F: softmmu/main.c
F: softmmu/cpus.c
F: softmmu/cpu-throttle.c
F: softmmu/cpu-timers.c
-F: softmmu/icount.c
F: softmmu/runstate*
F: qapi/run-state.json
diff --git a/softmmu/icount.c b/accel/tcg/icount-common.c
similarity index 99%
rename from softmmu/icount.c
rename to accel/tcg/icount-common.c
index 4527bfbd6e..0bf5bb5e21 100644
--- a/softmmu/icount.c
+++ b/accel/tcg/icount-common.c
@@ -27,7 +27,6 @@
#include "migration/vmstate.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
-#include "exec/exec-all.h"
#include "sysemu/cpus.h"
#include "sysemu/qtest.h"
#include "qemu/main-loop.h"
@@ -38,7 +37,7 @@
#include "hw/core/cpu.h"
#include "sysemu/cpu-timers.h"
#include "sysemu/cpu-throttle.h"
-#include "timers-state.h"
+#include "softmmu/timers-state.h"
/*
* ICOUNT: Instruction Counter
diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
index 0fb03bd7d3..4633a34d28 100644
--- a/accel/tcg/meson.build
+++ b/accel/tcg/meson.build
@@ -23,6 +23,7 @@ specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files(
))
system_ss.add(when: ['CONFIG_TCG'], if_true: files(
+ 'icount-common.c',
'monitor.c',
))
diff --git a/softmmu/meson.build b/softmmu/meson.build
index c18b7ad738..3a64dd89de 100644
--- a/softmmu/meson.build
+++ b/softmmu/meson.build
@@ -6,10 +6,6 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files(
'watchpoint.c',
)])
-specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: [files(
- 'icount.c',
-)])
-
system_ss.add(files(
'balloon.c',
'bootdevice.c',
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 10/11] accel/tcg: Make icount.o a target agnostic unit
2023-09-14 18:57 ` [PATCH 10/11] accel/tcg: Make icount.o a target agnostic unit Philippe Mathieu-Daudé
@ 2023-09-15 14:31 ` Anton Johansson via
2023-09-15 15:39 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 14:31 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> Remove the unused "exec/exec-all.h" header. There is
> no more target specific code in it: make it target
> agnostic (rename using the '-common' suffix). Since
> it is TCG specific, move it to accel/tcg, updating
> MAINTAINERS.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> MAINTAINERS | 1 -
> softmmu/icount.c => accel/tcg/icount-common.c | 3 +--
> accel/tcg/meson.build | 1 +
> softmmu/meson.build | 4 ----
> 4 files changed, 2 insertions(+), 7 deletions(-)
> rename softmmu/icount.c => accel/tcg/icount-common.c (99%)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index ff436dbf21..047d143b9d 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2912,7 +2912,6 @@ F: softmmu/main.c
> F: softmmu/cpus.c
> F: softmmu/cpu-throttle.c
> F: softmmu/cpu-timers.c
> -F: softmmu/icount.c
Would also be a maintainer switch
Otherwise,
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 10/11] accel/tcg: Make icount.o a target agnostic unit
2023-09-15 14:31 ` Anton Johansson via
@ 2023-09-15 15:39 ` Philippe Mathieu-Daudé
2023-09-15 15:46 ` Anton Johansson via
0 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-15 15:39 UTC (permalink / raw)
To: Anton Johansson
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 15/9/23 16:31, Anton Johansson wrote:
> On 14/09/23, Philippe Mathieu-Daudé wrote:
>> Remove the unused "exec/exec-all.h" header. There is
>> no more target specific code in it: make it target
>> agnostic (rename using the '-common' suffix). Since
>> it is TCG specific, move it to accel/tcg, updating
>> MAINTAINERS.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>> MAINTAINERS | 1 -
>> softmmu/icount.c => accel/tcg/icount-common.c | 3 +--
>> accel/tcg/meson.build | 1 +
>> softmmu/meson.build | 4 ----
>> 4 files changed, 2 insertions(+), 7 deletions(-)
>> rename softmmu/icount.c => accel/tcg/icount-common.c (99%)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index ff436dbf21..047d143b9d 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -2912,7 +2912,6 @@ F: softmmu/main.c
>> F: softmmu/cpus.c
>> F: softmmu/cpu-throttle.c
>> F: softmmu/cpu-timers.c
>> -F: softmmu/icount.c
> Would also be a maintainer switch
OK, now I understood your comment. I should have mentioned
it in the commit description. This move from "Main loop"
to "Overall TCG". Icount is a TCG feature.
(Less work for Paolo, but more for Richard...)
> Otherwise,
> Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 10/11] accel/tcg: Make icount.o a target agnostic unit
2023-09-15 15:39 ` Philippe Mathieu-Daudé
@ 2023-09-15 15:46 ` Anton Johansson via
0 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 15:46 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 15/09/23, Philippe Mathieu-Daudé wrote:
> On 15/9/23 16:31, Anton Johansson wrote:
> > On 14/09/23, Philippe Mathieu-Daudé wrote:
> > > Remove the unused "exec/exec-all.h" header. There is
> > > no more target specific code in it: make it target
> > > agnostic (rename using the '-common' suffix). Since
> > > it is TCG specific, move it to accel/tcg, updating
> > > MAINTAINERS.
> > >
> > > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> > > ---
> > > MAINTAINERS | 1 -
> > > softmmu/icount.c => accel/tcg/icount-common.c | 3 +--
> > > accel/tcg/meson.build | 1 +
> > > softmmu/meson.build | 4 ----
> > > 4 files changed, 2 insertions(+), 7 deletions(-)
> > > rename softmmu/icount.c => accel/tcg/icount-common.c (99%)
> > >
> > > diff --git a/MAINTAINERS b/MAINTAINERS
> > > index ff436dbf21..047d143b9d 100644
> > > --- a/MAINTAINERS
> > > +++ b/MAINTAINERS
> > > @@ -2912,7 +2912,6 @@ F: softmmu/main.c
> > > F: softmmu/cpus.c
> > > F: softmmu/cpu-throttle.c
> > > F: softmmu/cpu-timers.c
> > > -F: softmmu/icount.c
> > Would also be a maintainer switch
>
> OK, now I understood your comment. I should have mentioned
> it in the commit description. This move from "Main loop"
> to "Overall TCG". Icount is a TCG feature.
> (Less work for Paolo, but more for Richard...)
Ah that makes sense, just wanted to make sure:)
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 11/11] accel/tcg: Make cpu-exec-common.c a target agnostic unit
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2023-09-14 18:57 ` [PATCH 10/11] accel/tcg: Make icount.o a target agnostic unit Philippe Mathieu-Daudé
@ 2023-09-14 18:57 ` Philippe Mathieu-Daudé
2023-09-15 14:35 ` Anton Johansson via
2023-09-15 12:22 ` [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Anton Johansson via
11 siblings, 1 reply; 27+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-14 18:57 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Daniel P. Berrangé, Paolo Bonzini,
Thomas Huth, Alessandro Di Federico, Marc-André Lureau,
Anton Johansson, Riku Voipio, Philippe Mathieu-Daudé
cpu_in_serial_context() is not target specific,
move it declaration to "internal-common.h" (which
we include in the 4 source files modified).
Remove the unused "exec/exec-all.h" header from
cpu-exec-common.c. There is no more target specific
code in this file: make it target agnostic.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/tcg/internal-common.h | 11 +++++++++++
accel/tcg/internal-target.h | 9 ---------
accel/tcg/cpu-exec-common.c | 3 +--
accel/tcg/cputlb.c | 1 +
accel/tcg/tb-maint.c | 1 +
accel/tcg/user-exec.c | 1 +
accel/tcg/meson.build | 4 +++-
7 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h
index 5d5247442e..3b2277e6e9 100644
--- a/accel/tcg/internal-common.h
+++ b/accel/tcg/internal-common.h
@@ -9,9 +9,20 @@
#ifndef ACCEL_TCG_INTERNAL_COMMON_H
#define ACCEL_TCG_INTERNAL_COMMON_H
+#include "exec/translation-block.h"
+
extern int64_t max_delay;
extern int64_t max_advance;
void dump_exec_info(GString *buf);
+/*
+ * Return true if CS is not running in parallel with other cpus, either
+ * because there are no other cpus or we are within an exclusive context.
+ */
+static inline bool cpu_in_serial_context(CPUState *cs)
+{
+ return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs);
+}
+
#endif
diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h
index f9eec1ce28..932bbe4b63 100644
--- a/accel/tcg/internal-target.h
+++ b/accel/tcg/internal-target.h
@@ -90,15 +90,6 @@ static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb)
}
}
-/*
- * Return true if CS is not running in parallel with other cpus, either
- * because there are no other cpus or we are within an exclusive context.
- */
-static inline bool cpu_in_serial_context(CPUState *cs)
-{
- return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs);
-}
-
extern bool one_insn_per_tb;
/**
diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c
index 55980417b4..b6cc387482 100644
--- a/accel/tcg/cpu-exec-common.c
+++ b/accel/tcg/cpu-exec-common.c
@@ -20,9 +20,8 @@
#include "qemu/osdep.h"
#include "sysemu/cpus.h"
#include "sysemu/tcg.h"
-#include "exec/exec-all.h"
#include "qemu/plugin.h"
-#include "internal-target.h"
+#include "internal-common.h"
bool tcg_allowed;
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index a912d746a9..400d9ee0d0 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -35,6 +35,7 @@
#include "exec/translate-all.h"
#include "trace.h"
#include "tb-hash.h"
+#include "internal-common.h"
#include "internal-target.h"
#ifdef CONFIG_PLUGIN
#include "qemu/plugin-memory.h"
diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index 85cf51445d..b194f8f065 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -29,6 +29,7 @@
#include "tcg/tcg.h"
#include "tb-hash.h"
#include "tb-context.h"
+#include "internal-common.h"
#include "internal-target.h"
diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
index f925dd0305..5bf2761bf4 100644
--- a/accel/tcg/user-exec.c
+++ b/accel/tcg/user-exec.c
@@ -29,6 +29,7 @@
#include "qemu/atomic128.h"
#include "trace/trace-root.h"
#include "tcg/tcg-ldst.h"
+#include "internal-common.h"
#include "internal-target.h"
__thread uintptr_t helper_retaddr;
diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
index 4633a34d28..8783edd06e 100644
--- a/accel/tcg/meson.build
+++ b/accel/tcg/meson.build
@@ -1,7 +1,9 @@
tcg_ss = ss.source_set()
+common_ss.add(when: 'CONFIG_TCG', if_true: files(
+ 'cpu-exec-common.c',
+))
tcg_ss.add(files(
'tcg-all.c',
- 'cpu-exec-common.c',
'cpu-exec.c',
'tb-maint.c',
'tcg-runtime-gvec.c',
--
2.41.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 11/11] accel/tcg: Make cpu-exec-common.c a target agnostic unit
2023-09-14 18:57 ` [PATCH 11/11] accel/tcg: Make cpu-exec-common.c " Philippe Mathieu-Daudé
@ 2023-09-15 14:35 ` Anton Johansson via
0 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 14:35 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> cpu_in_serial_context() is not target specific,
> move it declaration to "internal-common.h" (which
> we include in the 4 source files modified).
>
> Remove the unused "exec/exec-all.h" header from
> cpu-exec-common.c. There is no more target specific
> code in this file: make it target agnostic.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> accel/tcg/internal-common.h | 11 +++++++++++
> accel/tcg/internal-target.h | 9 ---------
> accel/tcg/cpu-exec-common.c | 3 +--
> accel/tcg/cputlb.c | 1 +
> accel/tcg/tb-maint.c | 1 +
> accel/tcg/user-exec.c | 1 +
> accel/tcg/meson.build | 4 +++-
> 7 files changed, 18 insertions(+), 12 deletions(-)
>
> diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h
> index 5d5247442e..3b2277e6e9 100644
> --- a/accel/tcg/internal-common.h
> +++ b/accel/tcg/internal-common.h
> @@ -9,9 +9,20 @@
> #ifndef ACCEL_TCG_INTERNAL_COMMON_H
> #define ACCEL_TCG_INTERNAL_COMMON_H
>
> +#include "exec/translation-block.h"
> +
> extern int64_t max_delay;
> extern int64_t max_advance;
>
> void dump_exec_info(GString *buf);
>
> +/*
> + * Return true if CS is not running in parallel with other cpus, either
> + * because there are no other cpus or we are within an exclusive context.
> + */
> +static inline bool cpu_in_serial_context(CPUState *cs)
> +{
> + return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs);
> +}
> +
> #endif
> diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h
> index f9eec1ce28..932bbe4b63 100644
> --- a/accel/tcg/internal-target.h
> +++ b/accel/tcg/internal-target.h
> @@ -90,15 +90,6 @@ static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb)
> }
> }
>
> -/*
> - * Return true if CS is not running in parallel with other cpus, either
> - * because there are no other cpus or we are within an exclusive context.
> - */
> -static inline bool cpu_in_serial_context(CPUState *cs)
> -{
> - return !(cs->tcg_cflags & CF_PARALLEL) || cpu_in_exclusive_context(cs);
> -}
> -
> extern bool one_insn_per_tb;
>
> /**
> diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c
> index 55980417b4..b6cc387482 100644
> --- a/accel/tcg/cpu-exec-common.c
> +++ b/accel/tcg/cpu-exec-common.c
> @@ -20,9 +20,8 @@
> #include "qemu/osdep.h"
> #include "sysemu/cpus.h"
> #include "sysemu/tcg.h"
> -#include "exec/exec-all.h"
> #include "qemu/plugin.h"
> -#include "internal-target.h"
> +#include "internal-common.h"
>
> bool tcg_allowed;
>
> diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
> index a912d746a9..400d9ee0d0 100644
> --- a/accel/tcg/cputlb.c
> +++ b/accel/tcg/cputlb.c
> @@ -35,6 +35,7 @@
> #include "exec/translate-all.h"
> #include "trace.h"
> #include "tb-hash.h"
> +#include "internal-common.h"
> #include "internal-target.h"
> #ifdef CONFIG_PLUGIN
> #include "qemu/plugin-memory.h"
> diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
> index 85cf51445d..b194f8f065 100644
> --- a/accel/tcg/tb-maint.c
> +++ b/accel/tcg/tb-maint.c
> @@ -29,6 +29,7 @@
> #include "tcg/tcg.h"
> #include "tb-hash.h"
> #include "tb-context.h"
> +#include "internal-common.h"
> #include "internal-target.h"
>
>
> diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c
> index f925dd0305..5bf2761bf4 100644
> --- a/accel/tcg/user-exec.c
> +++ b/accel/tcg/user-exec.c
> @@ -29,6 +29,7 @@
> #include "qemu/atomic128.h"
> #include "trace/trace-root.h"
> #include "tcg/tcg-ldst.h"
> +#include "internal-common.h"
> #include "internal-target.h"
>
> __thread uintptr_t helper_retaddr;
> diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build
> index 4633a34d28..8783edd06e 100644
> --- a/accel/tcg/meson.build
> +++ b/accel/tcg/meson.build
> @@ -1,7 +1,9 @@
> tcg_ss = ss.source_set()
> +common_ss.add(when: 'CONFIG_TCG', if_true: files(
> + 'cpu-exec-common.c',
> +))
> tcg_ss.add(files(
> 'tcg-all.c',
> - 'cpu-exec-common.c',
> 'cpu-exec.c',
> 'tb-maint.c',
> 'tcg-runtime-gvec.c',
> --
> 2.41.0
>
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping)
2023-09-14 18:57 [PATCH 00/11] accel/tcg: Make more files target agnostic (& exec/ housekeeping) Philippe Mathieu-Daudé
` (10 preceding siblings ...)
2023-09-14 18:57 ` [PATCH 11/11] accel/tcg: Make cpu-exec-common.c " Philippe Mathieu-Daudé
@ 2023-09-15 12:22 ` Anton Johansson via
11 siblings, 0 replies; 27+ messages in thread
From: Anton Johansson via @ 2023-09-15 12:22 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: qemu-devel, Richard Henderson, Daniel P. Berrangé,
Paolo Bonzini, Thomas Huth, Alessandro Di Federico,
Marc-André Lureau, Riku Voipio
On 14/09/23, Philippe Mathieu-Daudé wrote:
> While reviewing Anton/Richard series [*] it was a bit hard
> for me to figure out which headers are target specific and
> "taint" the source which include them, in that we can not
> compile them once for all targets.
>
> My understanding is -all.h suffix is a target specific header,
> and -common.c is a target agnostic file. I tried to consolidate
> a bit renaming some files with the -target.c suffix (I'd like
> to rename -all.h -> .target.h for parity / clarity, but that
> is too much code churn at this point).
Nice, very much appreciated, I've also been struggling a bit with
keeping track of especially target-agnostic/dependent headers.
--
Anton Johansson
rev.ng Labs Srl.
^ permalink raw reply [flat|nested] 27+ messages in thread