From patchwork Wed Jun 14 05:23:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9785365 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 3E92260325 for ; Wed, 14 Jun 2017 05:29:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40F7F2834A for ; Wed, 14 Jun 2017 05:29:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35DB328589; Wed, 14 Jun 2017 05:29:52 +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 A23862834A for ; Wed, 14 Jun 2017 05:29:51 +0000 (UTC) Received: from localhost ([::1]:46470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dL0sI-0007VP-Mu for patchwork-qemu-devel@patchwork.kernel.org; Wed, 14 Jun 2017 01:29:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dL0m4-0001pa-GQ for qemu-devel@nongnu.org; Wed, 14 Jun 2017 01:23:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dL0m3-0007LY-CK for qemu-devel@nongnu.org; Wed, 14 Jun 2017 01:23:24 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:35402) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dL0m3-0007LQ-7r for qemu-devel@nongnu.org; Wed, 14 Jun 2017 01:23:23 -0400 Received: by mail-qt0-x243.google.com with SMTP id x58so39039419qtc.2 for ; Tue, 13 Jun 2017 22:23:23 -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=v2veKfHhEayApjwYm11wqpDdF+adv8/+qfr6Y9YSduc=; b=ePXKF/b/Oyfct66AyYGPj6wJCo1Q/5MyNEchdAQ6beSPUOaDqQP4hEZle3tXSOsrTb oTzwPBhvLyaL5vFJCWafimuyqe13BMGYsLorBTb99R4+JqZV03Q8j913qWDAzpobNHOC MF5Nh9JPU0QkRVOR5YZ24DX+ppw0ictwlhWeF8zPxQfr8NbFLwDhNleRjAp/CcLTZ7QL 81EhrqCDgNScdWuvztAt5oF5G1fYkBK39wYH0ptzWs6bcPN/GCaee4jXkWiZ0YDArOP9 71bWZEU1eWOoVQ5rZ7X44QQUmSLsFM2M36hgtJ7tJg9vXi3ZqWRZwv4E3EqFgau/HhzQ /UYA== 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=v2veKfHhEayApjwYm11wqpDdF+adv8/+qfr6Y9YSduc=; b=GTabBo0sarRklI2L2zmvLI76DwO0LzDHlKB/3IKTUK5q68dJYZEWn9UeUjL3N3mZLq l/j+b8eXKNUPTEGuk1TVONJLoC8zWo/CM8zy09zIppQftOC72Rcy5+MXB0tkEwN4w4sn FMPzHLuec637jTcrBps8HxXVYKqbtbIp2vPI0J9N5QxMK3e8JITYa3sds9XnXMFY4SPJ bLEviur2S8F82qPSVOm5UQRmcA0kJ7QfdO5gJAbnUPOaqlaGl5P36i5Dj3sFm6hIAm7N obLz2E4Dj8WpxKpe2fQjKg3LCmsHup0wIaCx6XP2lOHJ+VakAs/yUUFwhyN4HnEiO4vx Vdyw== X-Gm-Message-State: AKS2vOwjuPSOrbOlmfc/aT/cVutY/ZQWedpVMJjfbvdUzMORJNL6f6WJ 3kKGNAjq/meWDaNBuVQ= X-Received: by 10.237.37.228 with SMTP id y33mr4459975qtc.140.1497417802632; Tue, 13 Jun 2017 22:23:22 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id 34sm10959480qtp.17.2017.06.13.22.23.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 22:23:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 13 Jun 2017 22:23:06 -0700 Message-Id: <20170614052311.13785-6-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170614052311.13785-1-rth@twiddle.net> References: <20170614052311.13785-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::243 Subject: [Qemu-devel] [PULL 05/10] tcg/arm: Use indirect branch for goto_tb 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 Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 5 +---- tcg/arm/tcg-target.inc.c | 17 ++--------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 87ae10b..724ec73 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -301,7 +301,7 @@ static inline void tlb_flush_by_mmuidx_all_cpus_synced(CPUState *cpu, #define CODE_GEN_AVG_BLOCK_SIZE 150 #endif -#if defined(__arm__) || defined(_ARCH_PPC) \ +#if defined(_ARCH_PPC) \ || defined(__x86_64__) || defined(__i386__) \ || defined(__sparc__) || defined(__aarch64__) \ || defined(__s390x__) || defined(__mips__) \ @@ -401,9 +401,6 @@ static inline void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr) #elif defined(__aarch64__) void aarch64_tb_set_jmp_target(uintptr_t jmp_addr, uintptr_t addr); #define tb_set_jmp_target1 aarch64_tb_set_jmp_target -#elif defined(__arm__) -void arm_tb_set_jmp_target(uintptr_t jmp_addr, uintptr_t addr); -#define tb_set_jmp_target1 arm_tb_set_jmp_target #elif defined(__sparc__) || defined(__mips__) void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr); #else diff --git a/tcg/arm/tcg-target.inc.c b/tcg/arm/tcg-target.inc.c index 9f5cb66..fce382f 100644 --- a/tcg/arm/tcg-target.inc.c +++ b/tcg/arm/tcg-target.inc.c @@ -1026,16 +1026,6 @@ static void tcg_out_call(TCGContext *s, tcg_insn_unit *addr) } } -void arm_tb_set_jmp_target(uintptr_t jmp_addr, uintptr_t addr) -{ - tcg_insn_unit *code_ptr = (tcg_insn_unit *)jmp_addr; - tcg_insn_unit *target = (tcg_insn_unit *)addr; - - /* we could use a ldr pc, [pc, #-4] kind of branch and avoid the flush */ - reloc_pc24_atomic(code_ptr, target); - flush_icache_range(jmp_addr, jmp_addr + 4); -} - static inline void tcg_out_goto_label(TCGContext *s, int cond, TCGLabel *l) { if (l->has_value) { @@ -1665,11 +1655,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, } break; case INDEX_op_goto_tb: - if (s->tb_jmp_insn_offset) { - /* Direct jump method */ - s->tb_jmp_insn_offset[args[0]] = tcg_current_code_size(s); - tcg_out_b_noaddr(s, COND_AL); - } else { + tcg_debug_assert(s->tb_jmp_insn_offset == 0); + { /* Indirect jump method */ intptr_t ptr = (intptr_t)(s->tb_jmp_target_addr + args[0]); tcg_out_movi32(s, COND_AL, TCG_REG_R0, ptr & ~0xfff);