From patchwork Fri May 13 00:13:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9087231 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D951FBF29F for ; Fri, 13 May 2016 00:32:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F878201F2 for ; Fri, 13 May 2016 00:32:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7536620154 for ; Fri, 13 May 2016 00:32:45 +0000 (UTC) Received: from localhost ([::1]:60464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1124-0005lR-LH for patchwork-qemu-devel@patchwork.kernel.org; Thu, 12 May 2016 20:32:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b10ld-0002ZO-8m for qemu-devel@nongnu.org; Thu, 12 May 2016 20:15:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b10lX-00033g-9Z for qemu-devel@nongnu.org; Thu, 12 May 2016 20:15:44 -0400 Received: from mail-qg0-x241.google.com ([2607:f8b0:400d:c04::241]:33334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b10lX-00033c-4r for qemu-devel@nongnu.org; Thu, 12 May 2016 20:15:39 -0400 Received: by mail-qg0-x241.google.com with SMTP id 90so6867009qgz.0 for ; Thu, 12 May 2016 17:15:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sqqn5MBmcLfyeiCmdH6ipnwRiz5f46qBQwgO9uYz9yk=; b=i97O0ILdIRxcA3f62PI2hDDwnNu8YAOSjqUjuIp+YSsVhjyzuQaPY8gRcqMNGuvCX7 68eNMMlh+NSPC34L8hsZ2GGMXiR3X6j5Bdig0D5cZJpSWGKr+cajNbGfzQptf3hNHuGb P4GL9fFj511NcR30OkFaIcpvMrNczjRk4+f/KWjDUyCaGXBWsPh+DbWJKLE/MbSa/G5E atpfWP6Gnl8T8WazDP7Vc3UNnjQ3O+DQhJBLe5NpuF7DkpPZ8G8nYXL4dddcFtbNdXIu tPiozk3H74shVbKVvPBFxKkX3JSmnziRwN4tdCsrzq5peD3ttNdeSTqEuvPUPQc1F5a6 /LAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=sqqn5MBmcLfyeiCmdH6ipnwRiz5f46qBQwgO9uYz9yk=; b=K0I9W6dpp5csC16O6gSOtzIBrVOOr3BbN/DLaYMUSXCJQEBIaDufsuBzfJqXTYhZHb zvUKvFmK8Juj9+ZmSAxLnDeTNc3wZ6EuO61gb9uE6NrbtsWlnCDboumD2uywt7NxKiZq s/2J7DPxAuIPM4uzvGOUxALYDRLfHV9wIdL/Ox0N7IzG/sqp8vQT1o18Y6YIDwo9pQhO W/O+dNCBmmDusjZsqq5dQymF+b4c1a/fyJwwe2z+71jl3Qr5O6zMLlp+GpJ3G1bRxhxA PmGSbLhhq5abQ1b/JXdkxBv3CMpi2EPLKZRlgWpJKATh4RRewdybCvdX38rrHQNpVCAR QcKg== X-Gm-Message-State: AOPr4FWlIr1DgiI3RB+dOBtDX6htv7WC1X7wcNwwmzJESh4sHauNRhghtSXWZEDVYc7ZQw== X-Received: by 10.140.85.230 with SMTP id n93mr12417403qgd.7.1463098538888; Thu, 12 May 2016 17:15:38 -0700 (PDT) Received: from bigtime.com ([172.56.44.137]) by smtp.gmail.com with ESMTPSA id w16sm7171321qka.35.2016.05.12.17.15.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 May 2016 17:15:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 12 May 2016 14:13:29 -1000 Message-Id: <1463098420-29113-29-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1463098420-29113-1-git-send-email-rth@twiddle.net> References: <1463098420-29113-1-git-send-email-rth@twiddle.net> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c04::241 Subject: [Qemu-devel] [PULL 28/39] cpu-exec: elide more icount code if CONFIG_USER_ONLY X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Sergey Fedorov , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Richard Henderson --- cpu-exec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpu-exec.c b/cpu-exec.c index 02a4907..bd831b5 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;