From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avu9S-0006US-MU for qemu-devel@nongnu.org; Thu, 28 Apr 2016 18:11:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avu9R-0006Zv-Oe for qemu-devel@nongnu.org; Thu, 28 Apr 2016 18:11:14 -0400 Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:33498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avu9R-0006ZZ-H9 for qemu-devel@nongnu.org; Thu, 28 Apr 2016 18:11:13 -0400 Received: by mail-lf0-x233.google.com with SMTP id y84so99617377lfc.0 for ; Thu, 28 Apr 2016 15:11:13 -0700 (PDT) From: Sergey Fedorov Date: Fri, 29 Apr 2016 01:10:56 +0300 Message-Id: <1461881459-14297-4-git-send-email-sergey.fedorov@linaro.org> In-Reply-To: <1461881459-14297-1-git-send-email-sergey.fedorov@linaro.org> References: <1461881459-14297-1-git-send-email-sergey.fedorov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v6 3/6] cpu-exec: elide more icount code if CONFIG_USER_ONLY List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Sergey Fedorov , Paolo Bonzini , Peter Crosthwaite , Richard Henderson , Sergey Fedorov From: Paolo Bonzini Signed-off-by: Paolo Bonzini [Alex Bennée: #ifndef replay code to match elided functions] Signed-off-by: Alex Bennée Signed-off-by: Sergey Fedorov --- cpu-exec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpu-exec.c b/cpu-exec.c index 02a49070b9dd..bd831b5a12f9 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 */ @@ -542,6 +546,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. */ @@ -561,6 +568,7 @@ int cpu_exec(CPUState *cpu) cpu_loop_exit(cpu); } break; +#endif } default: break; -- 2.8.1