[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/24] accel/tcg: Move TaskState from CPUState to TCG AccelCPUSta
|
From: |
Philippe Mathieu-Daudé |
|
Subject: |
[PATCH 12/24] accel/tcg: Move TaskState from CPUState to TCG AccelCPUState |
|
Date: |
Mon, 29 Apr 2024 00:14:38 +0200 |
TaskState is specific to TCG user emulation, move it
to AccelCPUState.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/tcg/vcpu-state.h | 6 ++++--
include/hw/core/cpu.h | 2 --
bsd-user/main.c | 2 +-
linux-user/main.c | 2 +-
linux-user/syscall.c | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/accel/tcg/vcpu-state.h b/accel/tcg/vcpu-state.h
index d0dd1bbff8..cf8e3acef9 100644
--- a/accel/tcg/vcpu-state.h
+++ b/accel/tcg/vcpu-state.h
@@ -12,13 +12,15 @@
* AccelCPUState:
*/
struct AccelCPUState {
- /* Empty */
+#ifdef CONFIG_USER_ONLY
+ TaskState *ts;
+#endif
};
#ifdef CONFIG_USER_ONLY
static inline TaskState *get_task_state(const CPUState *cs)
{
- return cs->opaque;
+ return cs->accel->ts;
}
#endif
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 46b99a7ea5..9b99d8e8fe 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -490,8 +490,6 @@ struct CPUState {
QTAILQ_HEAD(, CPUWatchpoint) watchpoints;
CPUWatchpoint *watchpoint_hit;
- void *opaque;
-
/* In order to avoid passing too many arguments to the MMIO helpers,
* we store some rarely used information in the CPU context.
*/
diff --git a/bsd-user/main.c b/bsd-user/main.c
index 29a629d877..1ce4b0b6e4 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -590,7 +590,7 @@ int main(int argc, char **argv)
init_task_state(ts);
ts->info = info;
ts->bprm = &bprm;
- cpu->opaque = ts;
+ cpu->accel->ts = ts;
target_set_brk(info->brk);
syscall_init();
diff --git a/linux-user/main.c b/linux-user/main.c
index 94e4c47f05..5f7f03f4b0 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -949,7 +949,7 @@ int main(int argc, char **argv, char **envp)
/* build Task State */
ts->info = info;
ts->bprm = &bprm;
- cpu->opaque = ts;
+ cpu->accel->ts = ts;
task_settid(ts);
fd_trans_init();
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b9b5a387b3..49db3052aa 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6594,7 +6594,7 @@ static int do_fork(CPUArchState *env, unsigned int flags,
abi_ulong newsp,
cpu_clone_regs_child(new_env, newsp, flags);
cpu_clone_regs_parent(env, flags);
new_cpu = env_cpu(new_env);
- new_cpu->opaque = ts;
+ new_cpu->accel->ts = ts;
ts->bprm = parent_ts->bprm;
ts->info = parent_ts->info;
ts->signal_mask = parent_ts->signal_mask;
--
2.41.0
- [PATCH 07/24] accel/tcg: Implement AccelOpsClass::exit_vcpu_thread() handler, (continued)
- [PATCH 07/24] accel/tcg: Implement AccelOpsClass::exit_vcpu_thread() handler, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 08/24] user: Forward declare TaskState type definition, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 09/24] user: Declare get_task_state() once in 'accel/tcg/vcpu-state.h', Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 10/24] user: Use get_task_state() helper, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 11/24] accel/tcg: Allocate per-vCPU accel state in create_vcpu_thread(), Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 12/24] accel/tcg: Move TaskState from CPUState to TCG AccelCPUState,
Philippe Mathieu-Daudé <=
- [PATCH 13/24] accel/tcg: Update CPUNegativeOffsetState::can_do_io field documentation, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 14/24] accel/tcg: Move plugin fields to CPUNegativeOffsetState, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 15/24] accel/tcg: Restrict IcountDecr and CPUTLB to TCG, Philippe Mathieu-Daudé, 2024/04/28