[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v10 11/32] tcg: cpu_exec_{enter,exit} helpers
From: |
Claudio Fontana |
Subject: |
[PATCH v10 11/32] tcg: cpu_exec_{enter,exit} helpers |
Date: |
Thu, 10 Dec 2020 13:12:05 +0100 |
From: Eduardo Habkost <ehabkost@redhat.com>
Move invocation of CPUClass.cpu_exec_*() to separate helpers,
to make it easier to refactor that code later.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
---
accel/tcg/cpu-exec.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 58aea605d8..8d31145ad2 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -236,9 +236,22 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
}
#endif
+static void cpu_exec_enter(CPUState *cpu)
+{
+ CPUClass *cc = CPU_GET_CLASS(cpu);
+
+ cc->cpu_exec_enter(cpu);
+}
+
+static void cpu_exec_exit(CPUState *cpu)
+{
+ CPUClass *cc = CPU_GET_CLASS(cpu);
+
+ cc->cpu_exec_exit(cpu);
+}
+
void cpu_exec_step_atomic(CPUState *cpu)
{
- CPUClass *cc = CPU_GET_CLASS(cpu);
TranslationBlock *tb;
target_ulong cs_base, pc;
uint32_t flags;
@@ -257,11 +270,11 @@ void cpu_exec_step_atomic(CPUState *cpu)
/* Since we got here, we know that parallel_cpus must be true. */
parallel_cpus = false;
- cc->cpu_exec_enter(cpu);
+ cpu_exec_enter(cpu);
/* execute the generated code */
trace_exec_tb(tb, pc);
cpu_tb_exec(cpu, tb);
- cc->cpu_exec_exit(cpu);
+ cpu_exec_exit(cpu);
} else {
/*
* The mmap_lock is dropped by tb_gen_code if it runs out of
@@ -713,7 +726,7 @@ int cpu_exec(CPUState *cpu)
rcu_read_lock();
- cc->cpu_exec_enter(cpu);
+ cpu_exec_enter(cpu);
/* Calculate difference between guest clock and host clock.
* This delay includes the delay of the last cycle, so
@@ -775,7 +788,7 @@ int cpu_exec(CPUState *cpu)
}
}
- cc->cpu_exec_exit(cpu);
+ cpu_exec_exit(cpu);
rcu_read_unlock();
return ret;
--
2.26.2
- [PATCH v10 00/32] i386 cleanup, Claudio Fontana, 2020/12/10
- [PATCH v10 02/32] accel/tcg: split tcg_start_vcpu_thread, Claudio Fontana, 2020/12/10
- [PATCH v10 03/32] accel/tcg: rename tcg-cpus functions to match module name, Claudio Fontana, 2020/12/10
- [PATCH v10 05/32] i386: move whpx accel files into whpx/, Claudio Fontana, 2020/12/10
- [PATCH v10 01/32] accel/tcg: split CpusAccel into three TCG variants, Claudio Fontana, 2020/12/10
- [PATCH v10 04/32] i386: move kvm accel files into kvm/, Claudio Fontana, 2020/12/10
- [PATCH v10 06/32] i386: move hax accel files into hax/, Claudio Fontana, 2020/12/10
- [PATCH v10 08/32] i386: move TCG accel files into tcg/, Claudio Fontana, 2020/12/10
- [PATCH v10 07/32] i386: hvf: remove stale MAINTAINERS entry for old hvf stubs, Claudio Fontana, 2020/12/10
- [PATCH v10 09/32] i386: move cpu dump out of helper.c into cpu-dump.c, Claudio Fontana, 2020/12/10
- [PATCH v10 11/32] tcg: cpu_exec_{enter,exit} helpers,
Claudio Fontana <=
- [PATCH v10 10/32] i386: move TCG cpu class initialization out of helper.c, Claudio Fontana, 2020/12/10
- [PATCH v10 13/32] tcg: Make CPUClass.debug_excp_handler optional, Claudio Fontana, 2020/12/10
- [PATCH v10 14/32] cpu: Remove unnecessary noop methods, Claudio Fontana, 2020/12/10
- [PATCH v10 17/32] accel/tcg: split TCG-only code from cpu_exec_realizefn, Claudio Fontana, 2020/12/10
- [PATCH v10 12/32] tcg: make CPUClass.cpu_exec_* optional, Claudio Fontana, 2020/12/10
- [PATCH v10 15/32] cpu: Introduce TCGCpuOperations struct, Claudio Fontana, 2020/12/10
- [PATCH v10 16/32] target/riscv: remove CONFIG_TCG, as it is always TCG, Claudio Fontana, 2020/12/10
- [PATCH v10 18/32] cpu: Move synchronize_from_tb() to tcg_ops, Claudio Fontana, 2020/12/10
- [PATCH v10 22/32] target/arm: do not use cc->do_interrupt for KVM directly, Claudio Fontana, 2020/12/10
- [PATCH v10 24/32] cpu: move cc->transaction_failed to tcg_ops, Claudio Fontana, 2020/12/10