From patchwork Tue Aug 19 18:09:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 35659 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 158282034C for ; Tue, 19 Aug 2014 18:17:09 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id eb12sf45166076oac.1 for ; Tue, 19 Aug 2014 11:17:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=sZjCziCN/p0xr6ds5ziH09XnYKeED3YRaAtnDZv/hPQ=; b=VUT2l1GLdu46K6OMGJssjeQtqzKTmhXejhzV6NZnlxMY/T152HCe4qCqGEm6wR3moN Y3J8dhviaIj3ssLixXhNJErcMcVt8Eg5WflWPwqcHraLs/V02Do2AeRLQWTzF743oEMI w7EmIRIlxSZvifRVovxqFvaHr2z1Etn6sQsyGY80+rBNSCf2pGKPRKNXkDc/Wt1/BAad mOX/O9SMKsu9IjCbHBwfOSfm1u36QiFMI0Y2OoRrk4FfvBjRw6DnnQB7nRb1/xeg8fs2 eTLFA6s3z8lyZGho6kjsCdquOR5M34Ju/x6vY1ZOhwnN8FcjlS+CC0rI4SooqovqCMQC Zfuw== X-Gm-Message-State: ALoCoQk+xyi6HjL8QsceywhEKqcS0ym+h9TWcmt3mpAJ/zCVlsRdjf9cnlSCiG+x0HQ5Ibp/qVar X-Received: by 10.42.207.146 with SMTP id fy18mr23252295icb.12.1408472228687; Tue, 19 Aug 2014 11:17:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.42.87 with SMTP id b81ls2879835qga.19.gmail; Tue, 19 Aug 2014 11:17:08 -0700 (PDT) X-Received: by 10.220.74.10 with SMTP id s10mr1770770vcj.61.1408472228588; Tue, 19 Aug 2014 11:17:08 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id qd5si9298461vdb.5.2014.08.19.11.17.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 11:17:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ik5so7792568vcb.20 for ; Tue, 19 Aug 2014 11:17:08 -0700 (PDT) X-Received: by 10.220.187.134 with SMTP id cw6mr1028715vcb.71.1408472228507; Tue, 19 Aug 2014 11:17:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp260481vcb; Tue, 19 Aug 2014 11:17:08 -0700 (PDT) X-Received: by 10.140.93.161 with SMTP id d30mr65669372qge.53.1408472227881; Tue, 19 Aug 2014 11:17:07 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r79si3043264qgr.78.2014.08.19.11.17.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Aug 2014 11:17:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:52472 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJnxz-00025Q-Br for patch@linaro.org; Tue, 19 Aug 2014 14:17:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJns8-00018v-6g for qemu-devel@nongnu.org; Tue, 19 Aug 2014 14:11:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJns2-000461-8t for qemu-devel@nongnu.org; Tue, 19 Aug 2014 14:11:04 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:42051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJns2-0003wv-30 for qemu-devel@nongnu.org; Tue, 19 Aug 2014 14:10:58 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1XJnqq-0000hx-N3 for qemu-devel@nongnu.org; Tue, 19 Aug 2014 19:09:44 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 19 Aug 2014 19:09:34 +0100 Message-Id: <1408471784-2652-10-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1408471784-2652-1-git-send-email-peter.maydell@linaro.org> References: <1408471784-2652-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 81.2.115.146 Subject: [Qemu-devel] [PULL 09/19] target-arm: A64: Avoid duplicate exit_tb(0) in non-linked goto_tb X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 If gen_goto_tb() decides not to link the two TBs, then the fallback path generates unnecessary code: * if singlestep is enabled then we generate unreachable code after the gen_exception_internal(EXCP_DEBUG) * if singlestep is disabled then we will generate exit_tb(0) twice, once in gen_goto_tb() and once coming out of the main loop with is_jmp set to DISAS_JUMP Correct these deficiencies by only emitting exit_tb() in the non-singlestep case, in which case we can use DISAS_TB_JUMP to suppress the main-loop exit_tb(). Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias --- target-arm/translate-a64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index 2e21948..21a997f 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -234,9 +234,10 @@ static inline void gen_goto_tb(DisasContext *s, int n, uint64_t dest) gen_a64_set_pc_im(dest); if (s->singlestep_enabled) { gen_exception_internal(EXCP_DEBUG); + } else { + tcg_gen_exit_tb(0); + s->is_jmp = DISAS_TB_JUMP; } - tcg_gen_exit_tb(0); - s->is_jmp = DISAS_JUMP; } }