From patchwork Mon Jun 5 16:52:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9766959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3862F60353 for ; Mon, 5 Jun 2017 17:04:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23A6824B5B for ; Mon, 5 Jun 2017 17:04:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 189A126CFC; Mon, 5 Jun 2017 17:04:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id AF72323D5E for ; Mon, 5 Jun 2017 17:04:54 +0000 (UTC) Received: from localhost ([::1]:34405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvQz-0007wz-PP for patchwork-qemu-devel@patchwork.kernel.org; Mon, 05 Jun 2017 13:04:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvFM-0004MS-4w for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHvFL-0003lu-6I for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:52 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:34994) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHvFL-0003ll-1k for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:51 -0400 Received: by mail-qt0-x242.google.com with SMTP id x58so9853265qtc.2 for ; Mon, 05 Jun 2017 09:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=dHaolzdi8TxeO4oboQbPmbdQ0ZaXzgs/IaJhJ90a8K8=; b=ociwgS9Qjt++OoXGFWo5RH67dUTV2oPN0y4KPcyw4CyAZ0G6yQsRbHXaiadMJCdnRA dYde5Su/ysBmz7Dt1N2JHg0SdQNeZu1Dp3NZf+CNvzGx+/4oTmQkNmk6dDSHrTG+QxNX TQ6motXybrcgyzBMSwNmV0639jNX/E9nyKnLfKzfedAVj4hv/OHDyh9nApETQ5/5TuQ5 rKUd8QfSuzlkXeGkG3G8ci+zAB2hieh0HWhRVc89K652/bRgW8wgTaZArCfRqIAYJY/n rEWP09TxYNAG51DOfbJRZ4rem79bVXThdSIwUTdXwyc7hUJkwI75nVOIWUUkh3BvDDOn OSCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=dHaolzdi8TxeO4oboQbPmbdQ0ZaXzgs/IaJhJ90a8K8=; b=aNICLyDsDPkc8oc7k7yxmKcYR+N5BUpC/JvxIIQMK08iUsXLA3zehdXkOSJAGNrvfO jt/cNoTaveXr5cTapfaKeIxBijlu+uD2OQAMQD5N6hEMdRU6+lQ9k54hv+h8sgCKyzAu s+7HUkRkJDyc6PuPljL2YzvQ9nxHX3b46AhCk1nG0g1dZL2r5BIL7g1gq9jP5T91IYKB cxOQT/E4lV5gDMRNJRXBik9j/o1GOlp3R9ikJYjI0g4zh0whATJ+qNIym4huYnX3Bu6l VgoH24hHPF80d0YuTlQhRJZPOImYa+SWa9E0TWD+x3DzOZf0RMb7N3fN85s1V2gbm9LL x5+w== X-Gm-Message-State: AODbwcAqFu9vLNfgk5KbICiF6OHlqQp6eUu09FlzX8bbr8cjsrExy27l baJtQG/jM5ZHjJOEUa0= X-Received: by 10.55.41.102 with SMTP id p99mr23233339qkh.75.1496681569824; Mon, 05 Jun 2017 09:52:49 -0700 (PDT) Received: from bigtime.twiddle.net.com ([2602:47:d954:1500:5e51:4fff:fe40:9c64]) by smtp.gmail.com with ESMTPSA id c6sm1637044qtb.56.2017.06.05.09.52.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2017 09:52:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 5 Jun 2017 09:52:16 -0700 Message-Id: <20170605165233.4135-10-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170605165233.4135-1-rth@twiddle.net> References: <20170605165233.4135-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PULL 09/26] target/i386: optimize cross-page direct jumps in softmmu 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, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Emilio G. Cota" Instead of unconditionally exiting to the exec loop, use the gen_jr helper to jump to the target if it is valid. Perf impact: see next commit's log. Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Message-Id: <1493263764-18657-10-git-send-email-cota@braap.org> Signed-off-by: Richard Henderson --- target/i386/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index f0e48dc..ea113fe 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -2154,9 +2154,9 @@ static inline void gen_goto_tb(DisasContext *s, int tb_num, target_ulong eip) gen_jmp_im(eip); tcg_gen_exit_tb((uintptr_t)s->tb + tb_num); } else { - /* jump to another page: currently not optimized */ + /* jump to another page */ gen_jmp_im(eip); - gen_eob(s); + gen_jr(s, cpu_tmp0); } }