[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 06/13] accel/tcg: Reorganize tcg_accel_ops_init()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 06/13] accel/tcg: Reorganize tcg_accel_ops_init() |
Date: |
Wed, 23 Mar 2022 18:17:44 +0100 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reorg TCG AccelOpsClass initialization to emphasis icount
mode share more code with single-threaded TCG.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
accel/tcg/tcg-accel-ops.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c
index ea7dcad674..d2181ea1e5 100644
--- a/accel/tcg/tcg-accel-ops.c
+++ b/accel/tcg/tcg-accel-ops.c
@@ -98,16 +98,17 @@ static void tcg_accel_ops_init(AccelOpsClass *ops)
ops->create_vcpu_thread = mttcg_start_vcpu_thread;
ops->kick_vcpu_thread = mttcg_kick_vcpu_thread;
ops->handle_interrupt = tcg_handle_interrupt;
- } else if (icount_enabled()) {
- ops->create_vcpu_thread = rr_start_vcpu_thread;
- ops->kick_vcpu_thread = rr_kick_vcpu_thread;
- ops->handle_interrupt = icount_handle_interrupt;
- ops->get_virtual_clock = icount_get;
- ops->get_elapsed_ticks = icount_get;
} else {
ops->create_vcpu_thread = rr_start_vcpu_thread;
ops->kick_vcpu_thread = rr_kick_vcpu_thread;
- ops->handle_interrupt = tcg_handle_interrupt;
+
+ if (icount_enabled()) {
+ ops->handle_interrupt = icount_handle_interrupt;
+ ops->get_virtual_clock = icount_get;
+ ops->get_elapsed_ticks = icount_get;
+ } else {
+ ops->handle_interrupt = tcg_handle_interrupt;
+ }
}
}
--
2.35.1
- [PATCH v4 01/13] cpu: Free cpu->cpu_ases in cpu_address_space_destroy(), (continued)
- [PATCH v4 01/13] cpu: Free cpu->cpu_ases in cpu_address_space_destroy(), Philippe Mathieu-Daudé, 2022/03/23
- [PATCH v4 02/13] target/i386/kvm: Free xsave_buf when destroying vCPU, Philippe Mathieu-Daudé, 2022/03/23
- [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é <=
- [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é, 2022/03/23
- [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