[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 01/21] tcg: Implement CPU_LOG_TB_NOCHAIN during ex
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL v2 01/21] tcg: Implement CPU_LOG_TB_NOCHAIN during expansion |
Date: |
Thu, 18 Oct 2018 23:06:36 -0700 |
Rather than test NOCHAIN before linking, do not emit the
goto_tb opcode at all. We already do this for goto_ptr.
Signed-off-by: Richard Henderson <address@hidden>
---
accel/tcg/cpu-exec.c | 2 +-
tcg/tcg-op.c | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 6bcb6d99bd..870027d435 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -416,7 +416,7 @@ static inline TranslationBlock *tb_find(CPUState *cpu,
}
#endif
/* See if we can patch the calling TB. */
- if (last_tb && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
+ if (last_tb) {
tb_add_jump(last_tb, tb_exit, tb);
}
return tb;
diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index daa416a143..7a8015c5a9 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -2586,6 +2586,10 @@ void tcg_gen_exit_tb(TranslationBlock *tb, unsigned idx)
seen this numbered exit before, via tcg_gen_goto_tb. */
tcg_debug_assert(tcg_ctx->goto_tb_issue_mask & (1 << idx));
#endif
+ /* When not chaining, exit without indicating a link. */
+ if (qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
+ val = 0;
+ }
} else {
/* This is an exit via the exitreq label. */
tcg_debug_assert(idx == TB_EXIT_REQUESTED);
@@ -2603,7 +2607,10 @@ void tcg_gen_goto_tb(unsigned idx)
tcg_debug_assert((tcg_ctx->goto_tb_issue_mask & (1 << idx)) == 0);
tcg_ctx->goto_tb_issue_mask |= 1 << idx;
#endif
- tcg_gen_op1i(INDEX_op_goto_tb, idx);
+ /* When not chaining, we simply fall through to the "fallback" exit. */
+ if (!qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) {
+ tcg_gen_op1i(INDEX_op_goto_tb, idx);
+ }
}
void tcg_gen_lookup_and_goto_ptr(void)
--
2.17.2
- [Qemu-devel] [PULL v2 00/21] tcg patch queue, Richard Henderson, 2018/10/19
- [Qemu-devel] [PULL v2 01/21] tcg: Implement CPU_LOG_TB_NOCHAIN during expansion,
Richard Henderson <=
- [Qemu-devel] [PULL v2 02/21] tcg: access cpu->icount_decr.u16.high with atomics, Richard Henderson, 2018/10/19
- [Qemu-devel] [PULL v2 03/21] tcg: fix use of uninitialized variable under CONFIG_PROFILER, Richard Henderson, 2018/10/19
- [Qemu-devel] [PULL v2 04/21] tcg: plug holes in struct TCGProfile, Richard Henderson, 2018/10/19
- [Qemu-devel] [PULL v2 05/21] tcg: distribute tcg_time into TCG contexts, Richard Henderson, 2018/10/19
- [Qemu-devel] [PULL v2 06/21] target/alpha: remove tlb_flush from alpha_cpu_initfn, Richard Henderson, 2018/10/19
- [Qemu-devel] [PULL v2 07/21] target/unicore32: remove tlb_flush from uc32_init_fn, Richard Henderson, 2018/10/19
- [Qemu-devel] [PULL v2 08/21] exec: introduce tlb_init, Richard Henderson, 2018/10/19
- [Qemu-devel] [PULL v2 10/21] cputlb: serialize tlb updates with env->tlb_lock, Richard Henderson, 2018/10/19
- [Qemu-devel] [PULL v2 19/21] target/s390x: Skip wout, cout helpers if op helper does not return, Richard Henderson, 2018/10/19
- [Qemu-devel] [PULL v2 15/21] target/arm: Check HAVE_CMPXCHG128 at translate time, Richard Henderson, 2018/10/19