[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/14] accel/tcg: Use cpu_loop_exit_requested() in cpu_loop_exec_
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 11/14] accel/tcg: Use cpu_loop_exit_requested() in cpu_loop_exec_tb() |
Date: |
Sat, 27 Apr 2024 17:57:11 +0200 |
Do not open-code cpu_loop_exit_requested().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
accel/tcg/cpu-exec.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 225e5fbd3e..0329c6423e 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -900,8 +900,6 @@ static inline void cpu_loop_exec_tb(CPUState *cpu,
TranslationBlock *tb,
vaddr pc, TranslationBlock **last_tb,
int *tb_exit)
{
- int32_t insns_left;
-
trace_exec_tb(tb, pc);
tb = cpu_tb_exec(cpu, tb, tb_exit);
if (*tb_exit != TB_EXIT_REQUESTED) {
@@ -910,8 +908,7 @@ static inline void cpu_loop_exec_tb(CPUState *cpu,
TranslationBlock *tb,
}
*last_tb = NULL;
- insns_left = qatomic_read(&cpu->neg.icount_decr.u32);
- if (insns_left < 0) {
+ if (cpu_loop_exit_requested(cpu)) {
/* Something asked us to stop executing chained TBs; just
* continue round the main loop. Whatever requested the exit
* will also have set something else (eg exit_request or
@@ -925,6 +922,8 @@ static inline void cpu_loop_exec_tb(CPUState *cpu,
TranslationBlock *tb,
/* Instruction counter expired. */
assert(icount_enabled());
#ifndef CONFIG_USER_ONLY
+ int32_t insns_left;
+
/* Ensure global icount has gone forward */
icount_update(cpu);
/* Refill decrementer and continue execution. */
--
2.41.0
- Re: [PATCH 05/14] exec/cpu: Indent TARGET_PAGE_foo definitions, (continued)
- [PATCH 06/14] exec/cpu: Remove obsolete PAGE_RESERVED definition, Philippe Mathieu-Daudé, 2024/04/27
- [PATCH 07/14] exec/cpu: Remove duplicated PAGE_PASSTHROUGH definition, Philippe Mathieu-Daudé, 2024/04/27
- [PATCH 08/14] exec/cpu: Extract page-protection definitions to page-prot-common.h, Philippe Mathieu-Daudé, 2024/04/27
- [RFC PATCH 09/14] exec/cpu: Restrict user-specific page definitions, Philippe Mathieu-Daudé, 2024/04/27
- [PATCH 11/14] accel/tcg: Use cpu_loop_exit_requested() in cpu_loop_exec_tb(),
Philippe Mathieu-Daudé <=
- [PATCH 10/14] exec/user: Restrict 'syscall-trace.h' to user emulation, Philippe Mathieu-Daudé, 2024/04/27
- [PATCH 12/14] accel/tcg: Remove pointless initialization of cflags_next_tb, Philippe Mathieu-Daudé, 2024/04/27
- [PATCH 13/14] accel/tcg: Reset TCG specific fields in tcg_cpu_reset_hold(), Philippe Mathieu-Daudé, 2024/04/27
- [PATCH 14/14] accel/tcg: Access tcg_cflags with getter / setter, Philippe Mathieu-Daudé, 2024/04/27