From patchwork Mon Jul 10 15:47:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 107307 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp3595438qge; Mon, 10 Jul 2017 08:50:01 -0700 (PDT) X-Received: by 10.237.43.100 with SMTP id p91mr5055531qtd.130.1499701801146; Mon, 10 Jul 2017 08:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499701801; cv=none; d=google.com; s=arc-20160816; b=pXcTEVOYJnH7bl1y1D++U/fwU1oGxUcFt+OHIsiTKHZ7VQ/hRcIA6PTTYQIVD0xV68 wMlX5mkor87qcF8iItWS1ryA61Ndu+ADRzQSwq8jmccYnVsmt4PcJ2VpdldzkxPaqBjS odDOzuJqpPm422V5oPSzRshPdUAG0hyZpa5WgF/JKTqbISM3KZW5OAgB5NT6IrSwjA0q eqpEeawx+iKE2OBw8ntAfR33hByufZ2NpVnxZgUkcxcz+bXGoQPJzLsPdqlTru6xBtAD orKxL5HjxrnGO0n33YpbSTbU6eUsEOvUyuOl0CuNvxsAcuvCNE2W3VfE5C24AdGK08u8 9TOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=hyKMaKTk7jLtaMWZRLtpBIFzt1M4l1/ZhOCmvMZZZNY=; b=rCy0FGjByOm6AgMyZY8f5k+vx5Ri3IU//vvmIunkK8rCnurRWELMKZ7biW8w7sPx7g 5axsiMDlqDC8FHX9gjGUy6sAXgFwVcbPjXQ3psc97NxJRBvA3rr1J7z01wwu5hlzCQ5b WQhlsQh4INiQD76onzx7SXUX1VjseqtpF6QwL4e1duoxqJ5V42gFkP5SZ2aYbAS1drR/ u3Xvx3WYXd02zv6CcMmjuPDYra3OJDUZRc8gaHqzWhjvLpwmrHyAxQuBfzQkYOOohaq0 HiHdeTBXFOY9LZPbHgcJaWA8OjVpDyVaQ+7Q6fKEJc3GSRzI8N3nEWvsHEcOd4AaYynU Gn5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.b=hsjvlJSB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id f124si10918754qkj.308.2017.07.10.08.49.59 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 10 Jul 2017 08:50:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.b=hsjvlJSB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUawf-0006xS-N2 for patch@linaro.org; Mon, 10 Jul 2017 11:49:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUauj-00061P-W8 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 11:47:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUaui-0003Yg-R6 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 11:47:57 -0400 Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]:36443) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUaui-0003XH-K9 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 11:47:56 -0400 Received: by mail-wr0-x235.google.com with SMTP id c11so144112136wrc.3 for ; Mon, 10 Jul 2017 08:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hyKMaKTk7jLtaMWZRLtpBIFzt1M4l1/ZhOCmvMZZZNY=; b=hsjvlJSBPzASXfWKDL9H2juO5YAVhQ97xDV5xwmr+jMYmL3BPXAbPeUuz+nmdvJJb+ 1+OWJIj1n3hVG4OMnNW0j7qwywvkyiLI7fxObQctuGe0rfhnyjdBooU+S0MRsLEY3s13 R/X6MDeOTTtixrbcfNLm0g4UHMqTt+Ofv79tc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hyKMaKTk7jLtaMWZRLtpBIFzt1M4l1/ZhOCmvMZZZNY=; b=bgGeMEMu+Wi7FLx/eSf2c9j9hnhP14tMAC09BSlmSkHRkUCmRd2uqZdNiOHGZOiaZg AOlEgvbqbD2yEwtxqQX01RJPXrj9tujHbXAUFwODAsyvnfvvq8Xnn/R1ocW73Gsf6OMa 2jHDyADo5KDO4euFSROiSNuWCfHQ00kVn3ptQ2KtHEesXiCC/RdGa3q7f1Q33SKXRH3M bEkGxMmbwcnobmMwN/8mUO6TXyRB1Ns6QZ7rwFCWFYihtHBgzGims3J1nOlsF9bXIA9L 6rr9GcfoPuW/UpeyJtArfwhlYB3L1OI9xKq0c7WJeHnhTs1O9U4DJJojLRl5nHg3gdyl SYCw== X-Gm-Message-State: AIVw110f1fHgpcNMy2fIwufe/VheZ30FjFXa98ZFYNXr7bQy+Na7dcdF SYffhQJnY9R6yp7FokLTCQ== X-Received: by 10.28.156.202 with SMTP id f193mr8115763wme.22.1499701675451; Mon, 10 Jul 2017 08:47:55 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y35sm11384307wrc.51.2017.07.10.08.47.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jul 2017 08:47:52 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id A9CFC3E07CF; Mon, 10 Jul 2017 16:47:49 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, rth@twiddle.net, cota@braap.org Date: Mon, 10 Jul 2017 16:47:47 +0100 Message-Id: <20170710154749.13624-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170710154749.13624-1-alex.bennee@linaro.org> References: <20170710154749.13624-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::235 Subject: [Qemu-devel] [PATCH v1 4/6] target/arm/translate-a64: get rid of DISAS_EXIT 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: "open list:ARM" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We already have an exit condition that declares we should exit to the run-loop because wider CPU state changes have been made. Use DISAS_UPDATE and kill the architecture specific DISAS_EXIT. Signed-off-by: Alex Bennée --- target/arm/translate-a64.c | 3 +-- target/arm/translate.c | 6 ++++-- target/arm/translate.h | 4 ---- 3 files changed, 5 insertions(+), 8 deletions(-) -- 2.13.0 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index fe1c49b565..bde6ca934e 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -1425,7 +1425,7 @@ static void handle_msr_i(DisasContext *s, uint32_t insn, tcg_temp_free_i32(tcg_op); /* For DAIFClear, exit the cpu loop to re-evaluate pending IRQs. */ gen_a64_set_pc_im(s->pc); - s->is_jmp = (op == 0x1f ? DISAS_EXIT : DISAS_JUMP); + s->is_jmp = (op == 0x1f ? DISAS_UPDATE : DISAS_JUMP); break; } default: @@ -11394,7 +11394,6 @@ void gen_intermediate_code_a64(ARMCPU *cpu, TranslationBlock *tb) tcg_gen_exit_tb(0); break; case DISAS_UPDATE: - case DISAS_EXIT: default: tcg_gen_exit_tb(0); break; diff --git a/target/arm/translate.c b/target/arm/translate.c index f9c4aee1b6..e840499c6f 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -1194,11 +1194,13 @@ static void gen_exception_insn(DisasContext *s, int offset, int excp, s->is_jmp = DISAS_EXC; } -/* Force a TB lookup after an instruction that changes the CPU state. */ +/* Force a TB lookup after an instruction that changes the CPU state. + * (other than just the PC) + */ static inline void gen_lookup_tb(DisasContext *s) { tcg_gen_movi_i32(cpu_R[15], s->pc & ~1); - s->is_jmp = DISAS_EXIT; + s->is_jmp = DISAS_UPDATE; } static inline void gen_hlt(DisasContext *s, int imm) diff --git a/target/arm/translate.h b/target/arm/translate.h index 15d383d9af..6b2cc34c33 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -139,10 +139,6 @@ static void disas_set_insn_syndrome(DisasContext *s, uint32_t syn) * custom end-of-TB code) */ #define DISAS_BX_EXCRET 11 -/* For instructions which want an immediate exit to the main loop, - * as opposed to attempting to use lookup_and_goto_ptr. - */ -#define DISAS_EXIT 12 #ifdef TARGET_AARCH64 void a64_translate_init(void);