aboutsummaryrefslogtreecommitdiff
path: root/accel/tcg/cpu-exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel/tcg/cpu-exec.c')
-rw-r--r--accel/tcg/cpu-exec.c16
1 files changed, 9 insertions, 7 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) {