[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 3/5] cpu-exec: elide more icount code if CONFIG_U
From: |
Sergey Fedorov |
Subject: |
[Qemu-devel] [PATCH v4 3/5] cpu-exec: elide more icount code if CONFIG_USER_ONLY |
Date: |
Thu, 21 Apr 2016 17:57:20 +0300 |
From: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
[Alex Bennée: #ifndef replay code to match elided functions]
Signed-off-by: Alex Bennée <address@hidden>
Signed-off-by: Sergey Fedorov <address@hidden>
---
cpu-exec.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/cpu-exec.c b/cpu-exec.c
index 4cba4efc92b2..36942340d7e3 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -192,6 +192,7 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu,
TranslationBlock *itb)
return next_tb;
}
+#ifndef CONFIG_USER_ONLY
/* Execute the code without caching the generated code. An interpreter
could be used if available. */
static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
@@ -216,6 +217,7 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
tb_phys_invalidate(tb, -1);
tb_free(tb);
}
+#endif
static TranslationBlock *tb_find_physical(CPUState *cpu,
target_ulong pc,
@@ -430,12 +432,14 @@ int cpu_exec(CPUState *cpu)
}
#endif
}
+#ifndef CONFIG_USER_ONLY
} else if (replay_has_exception()
&& cpu->icount_decr.u16.low + cpu->icount_extra == 0) {
/* try to cause an exception pending in the log */
cpu_exec_nocache(cpu, 1, tb_find_fast(cpu), true);
ret = -1;
break;
+#endif
}
next_tb = 0; /* force lookup of first TB */
@@ -545,6 +549,9 @@ int cpu_exec(CPUState *cpu)
case TB_EXIT_ICOUNT_EXPIRED:
{
/* Instruction counter expired. */
+#ifdef CONFIG_USER_ONLY
+ abort();
+#else
int insns_left = cpu->icount_decr.u32;
if (cpu->icount_extra && insns_left >= 0) {
/* Refill decrementer and continue execution. */
@@ -564,6 +571,7 @@ int cpu_exec(CPUState *cpu)
cpu_loop_exit(cpu);
}
break;
+#endif
}
default:
break;
--
2.8.1
- [Qemu-devel] [PATCH v4 0/5] tcg: Misc clean-up patches, Sergey Fedorov, 2016/04/21
- [Qemu-devel] [PATCH v4 1/5] tcg: code_bitmap is not used by user-mode emulation, Sergey Fedorov, 2016/04/21
- [Qemu-devel] [PATCH v4 3/5] cpu-exec: elide more icount code if CONFIG_USER_ONLY,
Sergey Fedorov <=
- [Qemu-devel] [PATCH v4 2/5] tcg: reorganize tb_find_physical loop, Sergey Fedorov, 2016/04/21
- [Qemu-devel] [PATCH v4 4/5] tcg: Clean up from 'next_tb', Sergey Fedorov, 2016/04/21
- [Qemu-devel] [PATCH v4 5/5] tcg: Rework tb_invalidated_flag, Sergey Fedorov, 2016/04/21
- Re: [Qemu-devel] [PATCH v4 0/5] tcg: Misc clean-up patches, Sergey Fedorov, 2016/04/25