From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56861) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agx79-0000R6-IF for qemu-devel@nongnu.org; Fri, 18 Mar 2016 12:19:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agx75-0002vX-MN for qemu-devel@nongnu.org; Fri, 18 Mar 2016 12:19:03 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:36028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agx75-0002vR-GB for qemu-devel@nongnu.org; Fri, 18 Mar 2016 12:18:59 -0400 Received: by mail-wm0-x236.google.com with SMTP id l124so37154362wmf.1 for ; Fri, 18 Mar 2016 09:18:59 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 18 Mar 2016 16:18:43 +0000 Message-Id: <1458317932-1875-3-git-send-email-alex.bennee@linaro.org> In-Reply-To: <1458317932-1875-1-git-send-email-alex.bennee@linaro.org> References: <1458317932-1875-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [RFC v1 02/11] cpu-exec: elide more icount code if CONFIG_USER_ONLY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mttcg@listserver.greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, serge.fdrv@gmail.com, cota@braap.org Cc: Peter Crosthwaite , mark.burton@greensocs.com, qemu-devel@nongnu.org, pbonzini@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Alex Bennée --- v1 - #ifndef replay code to match elided functions --- cpu-exec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpu-exec.c b/cpu-exec.c index 52f25de..e71113e 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -183,6 +183,7 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, uint8_t *tb_ptr) 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, @@ -208,6 +209,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, @@ -427,12 +429,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 */ @@ -553,6 +557,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. */ @@ -572,6 +579,7 @@ int cpu_exec(CPUState *cpu) cpu_loop_exit(cpu); } break; +#endif } default: break; -- 2.7.3