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: 786247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 3x5qQ817M1z9s8V for ; Tue, 11 Jul 2017 01:49:04 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hsjvlJSB"; dkim-atps=neutral Received: from localhost ([::1]:41506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUavP-000670-NY for incoming@patchwork.ozlabs.org; Mon, 10 Jul 2017 11:48:39 -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=20Benn=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=20Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.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(-) 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);