[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/24] accel: Introduce AccelOpsClass::exit_vcpu_thread() handler
|
From: |
Philippe Mathieu-Daudé |
|
Subject: |
[PATCH 06/24] accel: Introduce AccelOpsClass::exit_vcpu_thread() handler |
|
Date: |
Mon, 29 Apr 2024 00:14:32 +0200 |
Introduce a per-accelerator handler that can be call
when a vCPU exits.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/sysemu/accel-ops.h | 1 +
system/cpus.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h
index ef91fc28bb..35dfb7e266 100644
--- a/include/sysemu/accel-ops.h
+++ b/include/sysemu/accel-ops.h
@@ -35,6 +35,7 @@ struct AccelOpsClass {
void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */
void (*kick_vcpu_thread)(CPUState *cpu);
bool (*cpu_thread_is_idle)(CPUState *cpu);
+ void (*exit_vcpu_thread)(CPUState *cpu);
void (*synchronize_post_reset)(CPUState *cpu);
void (*synchronize_post_init)(CPUState *cpu);
diff --git a/system/cpus.c b/system/cpus.c
index e0530ad603..d0d585e8b9 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -425,6 +425,9 @@ void cpu_exit(CPUState *cpu)
/* Ensure cpu_exec will see the exit request after TCG has exited. */
smp_wmb();
qatomic_set(&cpu->neg.icount_decr.u16.high, -1);
+ if (cpus_accel->exit_vcpu_thread) {
+ cpus_accel->exit_vcpu_thread(cpu);
+ }
}
static void qemu_cpu_stop(CPUState *cpu, bool exit)
--
2.41.0
- [PATCH 01/24] exec/user: Move 'thunk.h' from 'exec/user' to 'user', (continued)
- [PATCH 01/24] exec/user: Move 'thunk.h' from 'exec/user' to 'user', Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 02/24] coverity: Update user emulation regexp, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 03/24] accel/tcg: Move user definition of cpu_interrupt() to user-exec.c, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 04/24] accel/tcg: Duplicate cpu_exit() for user / system, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 05/24] accel/tcg: Extract tcg_cpu_exit() from cpu_exit(), Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 06/24] accel: Introduce AccelOpsClass::exit_vcpu_thread() handler,
Philippe Mathieu-Daudé <=
- [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