From patchwork Fri Aug 8 12:18:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 35110 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f197.google.com (mail-yk0-f197.google.com [209.85.160.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9CBA721457 for ; Fri, 8 Aug 2014 12:19:37 +0000 (UTC) Received: by mail-yk0-f197.google.com with SMTP id 142sf16461419ykq.4 for ; Fri, 08 Aug 2014 05:19:37 -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:cc: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=hd6O8ctynPdBUuHvpZoCDJge32zbg6/ND3kwzuIeLy4=; b=iDOvM2xi2wqbDke/CEEZLIunm8KM5DmGAwv9R1sYeB4i5Wyj31qHsAT+p4pdn/RSt/ Vdmn1NGEqxuN1rP+yviM2D7BvqKtFA7HJyCt3h2fbqzY2+yFtqYGTvLlDaxjKqcJERMA 3dnIMjWKLlEdxp+734DfkurCemPd5RxWkJX7VPLoKq1alTyqtzKlE7nOqpJPTo8kPBnv rIEAt1QuPfo0P8FKxcYbboFVn18PEGNer6FevYPmzOzkjpZnM2M6cLhwa0gA40cHy/FY zmprfpZ8holXzFuw+U1yqasx9PqDjUHJdO0ZJPavXBDSyvPZFCLML77Ua3Ez+HKSHU5u odIQ== X-Gm-Message-State: ALoCoQlzOrtdKxClhS8PM0p0n5j6lhKoIAYlIusIhxsn+T4NTgTP+nEl8z8pDIhAFcfhTi2e3OF9 X-Received: by 10.236.204.38 with SMTP id g26mr4622159yho.43.1407500377450; Fri, 08 Aug 2014 05:19:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.228 with SMTP id 91ls513142qgr.70.gmail; Fri, 08 Aug 2014 05:19:37 -0700 (PDT) X-Received: by 10.52.83.227 with SMTP id t3mr6625603vdy.20.1407500377306; Fri, 08 Aug 2014 05:19:37 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id b11si2812336vdv.62.2014.08.08.05.19.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Aug 2014 05:19:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id le20so8285084vcb.0 for ; Fri, 08 Aug 2014 05:19:37 -0700 (PDT) X-Received: by 10.52.160.10 with SMTP id xg10mr6414426vdb.1.1407500377223; Fri, 08 Aug 2014 05:19:37 -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 tc5csp118099vcb; Fri, 8 Aug 2014 05:19:36 -0700 (PDT) X-Received: by 10.224.79.139 with SMTP id p11mr11051806qak.93.1407500376652; Fri, 08 Aug 2014 05:19:36 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f89si9992884qgf.112.2014.08.08.05.19.36 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 08 Aug 2014 05:19:36 -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]:50804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFj8x-0002Ob-WB for patch@linaro.org; Fri, 08 Aug 2014 08:19:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFj7q-0001IL-OY for qemu-devel@nongnu.org; Fri, 08 Aug 2014 08:18:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XFj7o-0007HD-Lq for qemu-devel@nongnu.org; Fri, 08 Aug 2014 08:18:26 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XFj7o-0007Fb-F8 for qemu-devel@nongnu.org; Fri, 08 Aug 2014 08:18:24 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1XFj7e-0002pE-S5; Fri, 08 Aug 2014 13:18:14 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 8 Aug 2014 13:18:11 +0100 Message-Id: <1407500294-10804-9-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1407500294-10804-1-git-send-email-peter.maydell@linaro.org> References: <1407500294-10804-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: David Long Subject: [Qemu-devel] [PATCH 08/11] 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.169 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 --- 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 33b5025..aa731bf 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -232,9 +232,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; } }