[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 08/13] accel/tcg: Extract rr_create_vcpu_thread_precheck()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 08/13] accel/tcg: Extract rr_create_vcpu_thread_precheck() |
Date: |
Wed, 23 Mar 2022 18:17:46 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
We are going to extract common pattern from rr_start_vcpu_thread().
First extract the rr_create_vcpu_thread_precheck() helper.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
accel/tcg/tcg-accel-ops-rr.c | 7 +++++++
accel/tcg/tcg-accel-ops-rr.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c
index de8af32af7..3da684b8e6 100644
--- a/accel/tcg/tcg-accel-ops-rr.c
+++ b/accel/tcg/tcg-accel-ops-rr.c
@@ -272,6 +272,13 @@ static void *rr_cpu_thread_fn(void *arg)
return NULL;
}
+static QemuThread *single_tcg_cpu_thread;
+
+bool rr_create_vcpu_thread_precheck(CPUState *cpu)
+{
+ return !single_tcg_cpu_thread;
+}
+
void rr_start_vcpu_thread(CPUState *cpu)
{
char thread_name[VCPU_THREAD_NAME_SIZE];
diff --git a/accel/tcg/tcg-accel-ops-rr.h b/accel/tcg/tcg-accel-ops-rr.h
index 54f6ae6e86..e2273b66d4 100644
--- a/accel/tcg/tcg-accel-ops-rr.h
+++ b/accel/tcg/tcg-accel-ops-rr.h
@@ -15,6 +15,7 @@
/* Kick all RR vCPUs. */
void rr_kick_vcpu_thread(CPUState *unused);
+bool rr_create_vcpu_thread_precheck(CPUState *cpu);
/* start the round robin vcpu thread */
void rr_start_vcpu_thread(CPUState *cpu);
--
2.35.1
- Re: [PATCH v4 02/13] target/i386/kvm: Free xsave_buf when destroying vCPU, (continued)
- [PATCH v4 03/13] target/i386/hvf: Free resources when vCPU is destroyed, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 04/13] accel/hvf: Remove pointless assertion, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 05/13] accel/tcg: Init TCG cflags in vCPU thread handler, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 06/13] accel/tcg: Reorganize tcg_accel_ops_init(), Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 07/13] accel-ops: Introduce create_vcpu_thread_precheck / postcheck handlers, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 08/13] accel/tcg: Extract rr_create_vcpu_thread_precheck(),
Philippe Mathieu-Daudé <=
- [PATCH v4 09/13] accel/all: Extract common_vcpu_thread_create(), Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 10/13] accel-ops: Introduce common_vcpu_thread_destroy() and .precheck handler, Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 11/13] accel/tcg: Add rr_destroy_vcpu_thread_precheck(), Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 12/13] softmmu/cpus: Free cpu->thread in generic_destroy_vcpu_thread(), Philippe Mathieu-Daudé, 2022/03/23