From patchwork Mon Jun 19 18:18:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9797133 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 3355F603F5 for ; Mon, 19 Jun 2017 18:20:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0973028459 for ; Mon, 19 Jun 2017 18:20:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F22762846B; Mon, 19 Jun 2017 18:20:24 +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 C05AE28469 for ; Mon, 19 Jun 2017 18:20:23 +0000 (UTC) Received: from localhost ([::1]:43824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN1HX-0008Op-Jf for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Jun 2017 14:20:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dN1GD-0008MH-OR for qemu-devel@nongnu.org; Mon, 19 Jun 2017 14:18:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dN1GC-0002E8-QI for qemu-devel@nongnu.org; Mon, 19 Jun 2017 14:18:49 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:34186) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dN1GC-0002DC-Kg for qemu-devel@nongnu.org; Mon, 19 Jun 2017 14:18:48 -0400 Received: by mail-pf0-x241.google.com with SMTP id d5so18589017pfe.1 for ; Mon, 19 Jun 2017 11:18:48 -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=RnI0p+Zs1BLQnHTXC4z50Q7FwMA2byk4ZJ+ZEFAZjrCc91gfJwGtzANOuRdoNy8F26 w7bG99qbIZDmLWZWxwYX4zMtX9gD2SbtPD3Z+CotjsuhwvniYlszxLo3TBEpsSDi3Ng8 RaULUuacbvFVXTAaYv7FcoFnJwE6uKaQ9geREBMUlKTCzoc/AA5ICQPFcjkbRjYMxv3Q hdfPSvefkSkBBNqzSVj6UfniZbui/zziguMYhAWQNEnUMBL+HwclM6WNnhdOlQs11UXs 5uADCvWljw9tH9YkbYHO6lCOgNVXAuwrGkH7DN1LAkd+eb6D4bTo+TaUmb4qIeh+NIWa 5rTA== 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=cLa9io7fIl9ReP1Xu5ZqhqKDOPJvCaBoHZDog5m+AmVamQ1Y/qabYk60H5ZiMyCFTz zstIrElwPvKespt+Jg83gTn0qZ7+PdaJLJeFlbhHSbVKSJci8idAkHkx9VuXVQXOrbBK jUk9giUmLNbc+teTOwhe0niVO8cJEtL+Jrtzz31/3ifvH831JEW/PgKYDrHMkTS+oRmA hFHX2oMjY/xlNYZeJpmh4jSBO6Fe7t8MUhT/XhTeXFmlxVuuChwSv2FdY+u3wfb50s++ 54NfJrUYQA1xBnFyuBUWFq1/vAc88Wyz1b6IaxJI7RTozkkg8BwKoeXdNRNR56w5NupM SMZA== X-Gm-Message-State: AKS2vOzpBHXkSIOtlOMG68C73gdFyzE6kwqTCTUXVTzzlrPU2eMcmDTz RJ74edoOcXJo+X4r9nk= X-Received: by 10.84.224.199 with SMTP id k7mr534704pln.207.1497896327650; Mon, 19 Jun 2017 11:18:47 -0700 (PDT) Received: from pike.twiddle.net (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id e63sm22917171pfb.18.2017.06.19.11.18.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jun 2017 11:18:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 19 Jun 2017 11:18:32 -0700 Message-Id: <20170619181839.25249-6-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170619181839.25249-1-rth@twiddle.net> References: <20170619181839.25249-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PULL 05/12] 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);