[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/24] accel/tcg: Implement AccelOpsClass::exit_vcpu_thread() han
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 07/24] accel/tcg: Implement AccelOpsClass::exit_vcpu_thread() handler |
Date: |
Mon, 29 Apr 2024 00:14:33 +0200 |
The TCG-specific code from the system generic cpu_exit()
is equivalent of tcg_cpu_exit(). Define the AccelOpsClass
exit_vcpu_thread() handler to it, making cpu_exit() generic.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/tcg/tcg-accel-ops.c | 2 ++
system/cpus.c | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c
index 7ac5f0c974..56bbad9fcd 100644
--- a/accel/tcg/tcg-accel-ops.c
+++ b/accel/tcg/tcg-accel-ops.c
@@ -43,6 +43,7 @@
#include "tcg-accel-ops-mttcg.h"
#include "tcg-accel-ops-rr.h"
#include "tcg-accel-ops-icount.h"
+#include "internal-common.h"
/* common functionality among all TCG variants */
@@ -218,6 +219,7 @@ static void tcg_accel_ops_init(AccelOpsClass *ops)
}
}
+ ops->exit_vcpu_thread = tcg_cpu_exit;
ops->cpu_reset_hold = tcg_cpu_reset_hold;
ops->supports_guest_debug = tcg_supports_guest_debug;
ops->insert_breakpoint = tcg_insert_breakpoint;
diff --git a/system/cpus.c b/system/cpus.c
index d0d585e8b9..3e86b488d3 100644
--- a/system/cpus.c
+++ b/system/cpus.c
@@ -422,9 +422,6 @@ void run_on_cpu(CPUState *cpu, run_on_cpu_func func,
run_on_cpu_data data)
void cpu_exit(CPUState *cpu)
{
qatomic_set(&cpu->exit_request, 1);
- /* 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);
}
--
2.41.0
- [PATCH 02/24] coverity: Update user emulation regexp, (continued)
- [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é, 2024/04/28
- [PATCH 07/24] accel/tcg: Implement AccelOpsClass::exit_vcpu_thread() handler,
Philippe Mathieu-Daudé <=
- [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é, 2024/04/28