[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/58] tcg: Pass last_tb by value to tb_find_fast()
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 04/58] tcg: Pass last_tb by value to tb_find_fast() |
Date: |
Tue, 13 Sep 2016 19:15:35 +0200 |
From: Sergey Fedorov <address@hidden>
This is a small clean up. tb_find_fast() is a final consumer of this
variable so no need to pass it by reference. 'last_tb' is always updated
by subsequent cpu_loop_exec_tb() in cpu_exec().
This change also simplifies calling cpu_exec_nocache() in
cpu_handle_exception().
Signed-off-by: Sergey Fedorov <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
cpu-exec.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/cpu-exec.c b/cpu-exec.c
index 5d9710a..cf511f1 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -320,7 +320,7 @@ found:
}
static inline TranslationBlock *tb_find_fast(CPUState *cpu,
- TranslationBlock **last_tb,
+ TranslationBlock *last_tb,
int tb_exit)
{
CPUArchState *env = (CPUArchState *)cpu->env_ptr;
@@ -342,7 +342,7 @@ static inline TranslationBlock *tb_find_fast(CPUState *cpu,
/* Ensure that no TB jump will be modified as the
* translation buffer has been flushed.
*/
- *last_tb = NULL;
+ last_tb = NULL;
cpu->tb_flushed = false;
}
#ifndef CONFIG_USER_ONLY
@@ -351,12 +351,12 @@ static inline TranslationBlock *tb_find_fast(CPUState
*cpu,
* spanning two pages because the mapping for the second page can change.
*/
if (tb->page_addr[1] != -1) {
- *last_tb = NULL;
+ last_tb = NULL;
}
#endif
/* See if we can patch the calling TB. */
- if (*last_tb && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
- tb_add_jump(*last_tb, tb_exit, tb);
+ if (last_tb && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
+ tb_add_jump(last_tb, tb_exit, tb);
}
tb_unlock();
return tb;
@@ -437,8 +437,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int
*ret)
} else if (replay_has_exception()
&& cpu->icount_decr.u16.low + cpu->icount_extra == 0) {
/* try to cause an exception pending in the log */
- TranslationBlock *last_tb = NULL; /* Avoid chaining TBs */
- cpu_exec_nocache(cpu, 1, tb_find_fast(cpu, &last_tb, 0), true);
+ cpu_exec_nocache(cpu, 1, tb_find_fast(cpu, NULL, 0), true);
*ret = -1;
return true;
#endif
@@ -621,7 +620,7 @@ int cpu_exec(CPUState *cpu)
cpu->tb_flushed = false; /* reset before first TB lookup */
for(;;) {
cpu_handle_interrupt(cpu, &last_tb);
- tb = tb_find_fast(cpu, &last_tb, tb_exit);
+ tb = tb_find_fast(cpu, last_tb, tb_exit);
cpu_loop_exec_tb(cpu, tb, &last_tb, &tb_exit, &sc);
/* Try to align the host and virtual clocks
if the guest is in advance */
--
1.8.3.1
- [Qemu-devel] [PULL 00/58] First round of misc patches for QEMU 2.8, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 01/58] qtail: clean up direct access to tqe_prev field, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 04/58] tcg: Pass last_tb by value to tb_find_fast(),
Paolo Bonzini <=
- [Qemu-devel] [PULL 03/58] util: fix some coding style issue, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 05/58] tcg: Prepare safe tb_jmp_cache lookup out of tb_lock, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 08/58] tcg: set up tb->page_addr before insertion, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 02/58] util/qemu-sockets: revert Yoda Conditions to normal, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 07/58] tcg: Prepare TB invalidation for lockless TB lookup, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 11/58] tcg: Merge tb_find_slow() and tb_find_fast(), Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 09/58] tcg: cpu-exec: remove tb_lock from the hot-path, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 12/58] tcg: rename tb_find_physical(), Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 06/58] tcg: Prepare safe access to tb_flushed out of tb_lock, Paolo Bonzini, 2016/09/13
- [Qemu-devel] [PULL 10/58] tcg: Avoid bouncing tb_lock between tb_gen_code() and tb_add_jump(), Paolo Bonzini, 2016/09/13