aboutsummaryrefslogtreecommitdiff
path: root/accel
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2017-10-13 12:22:28 -0700
committerRichard Henderson <richard.henderson@linaro.org>2017-10-24 13:53:42 -0700
commit416986d3f97329655e30da7271a2d11c6d707b06 (patch)
tree60548880c8d50ff6d919f002597924620e957f9c /accel
parent0cf8a44c2f56ba884c2f6db47d27fbb24975daa3 (diff)
tcg: Remove CF_IGNORE_ICOUNT
Now that we have curr_cflags, we can include CF_USE_ICOUNT early and then remove it as necessary. Reviewed-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'accel')
-rw-r--r--accel/tcg/cpu-exec.c16
-rw-r--r--accel/tcg/translate-all.c3
2 files changed, 9 insertions, 10 deletions
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 849b54d0b0..b44c7941aa 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -198,17 +198,19 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
TranslationBlock *orig_tb, bool ignore_icount)
{
TranslationBlock *tb;
+ uint32_t cflags = curr_cflags() | CF_NOCACHE;
+
+ if (ignore_icount) {
+ cflags &= ~CF_USE_ICOUNT;
+ }
/* Should never happen.
We only end up here when an existing TB is too long. */
- if (max_cycles > CF_COUNT_MASK)
- max_cycles = CF_COUNT_MASK;
+ cflags |= MIN(max_cycles, CF_COUNT_MASK);
tb_lock();
- tb = tb_gen_code(cpu, orig_tb->pc, orig_tb->cs_base, orig_tb->flags,
- max_cycles | CF_NOCACHE
- | (ignore_icount ? CF_IGNORE_ICOUNT : 0)
- | curr_cflags());
+ tb = tb_gen_code(cpu, orig_tb->pc, orig_tb->cs_base,
+ orig_tb->flags, cflags);
tb->orig_tb = orig_tb;
tb_unlock();
@@ -229,7 +231,7 @@ void cpu_exec_step_atomic(CPUState *cpu)
TranslationBlock *tb;
target_ulong cs_base, pc;
uint32_t flags;
- uint32_t cflags = 1 | CF_IGNORE_ICOUNT;
+ uint32_t cflags = 1;
uint32_t cf_mask = cflags & CF_HASH_MASK;
if (sigsetjmp(cpu->jmp_env, 0) == 0) {
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index dcd47cd692..9fa94340dd 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1274,9 +1274,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
assert_memory_lock();
phys_pc = get_page_addr_code(env, pc);
- if (use_icount && !(cflags & CF_IGNORE_ICOUNT)) {
- cflags |= CF_USE_ICOUNT;
- }
tb = tb_alloc(pc);
if (unlikely(!tb)) {