From patchwork Fri Jun 26 15:13:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 191822 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp583667ilg; Fri, 26 Jun 2020 08:20:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjN5RM3zGQHYBHsgFgFQVSfym0hu2KhapIep8IUnVomyxX0OWyMgs1cMt9gcN5ZaRJ4ML8 X-Received: by 2002:a25:8b0c:: with SMTP id i12mr5545309ybl.499.1593184836293; Fri, 26 Jun 2020 08:20:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593184836; cv=none; d=google.com; s=arc-20160816; b=vSRNHok6HXqe5HwD7fUXvp3beDo9moJevIiylakMdbPbRg1jlCdd2PKRCtPLi+vAmq UMGU+FRKL3za/Bb8cDDm//7kclMuTj3oc5DyQub2zRL12nKl/RFyD7QCp2kylrNck1DZ aYmL8G2USx4vliURtrzq2zVOPJLUEp4Rce1TkoXOQ/+AJgbJZH25tc/ekdvt6skt/ap3 6MjAAvBXsfbXmCOSPIRjLARrWGhvd3W1SQWmRwE/B/rwb54v+LuovCrkXu4+YSV7+fkz ts4DIHKR9APfAHPwuCOSH4binbDgfTd+YG+fnBDvKVADyO0JZ41CU54zjFz93kp+D8Bj WBzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=aWyt2cysYoyz/Pja0/FYad6jYHqTEkVsxAonTLdhkWs=; b=STnH/DIcoCa8xW+695N1K+DtDt8XkJtJSnC8ZW06apZzReUM4L5IiajMk0LMva4h97 t6o3H3fUm1d8BDzTHBQ3WQcF902bh0qaXTLmf10U2r6N1ByH1+S6btzNaXYGq/h0zFbg 5Vf6QgyAxIq/NOFvk3BgwauT4W+VzGxpQjAcgOp3GeKVgbiI4ZICbSVQS/18AwgrsXTn zd92ngGYG4ioogpvFeDUXDI3D4Kv6EFnxNkISckNFxXFWMGv4/GD7U0aeolr5sjF6VvI 3xxAgGhxJkdZ6c9iRsb2mfGcAvih6FkLhJcA5w+hqD+iurt0J7RGAHB25H6xe4S0MJfe JU+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O7kd4ngp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e127si25349260ybf.458.2020.06.26.08.20.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jun 2020 08:20:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O7kd4ngp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joq9b-00033i-Jw for patch@linaro.org; Fri, 26 Jun 2020 11:20:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joq43-0002Fp-J3 for qemu-devel@nongnu.org; Fri, 26 Jun 2020 11:14:51 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:34836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1joq3z-0006LE-2V for qemu-devel@nongnu.org; Fri, 26 Jun 2020 11:14:51 -0400 Received: by mail-wr1-x429.google.com with SMTP id g18so9901223wrm.2 for ; Fri, 26 Jun 2020 08:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=aWyt2cysYoyz/Pja0/FYad6jYHqTEkVsxAonTLdhkWs=; b=O7kd4ngpgu/XuXsazTZP+VFT3/vqRpsgnmP/p7RwNPzKgmiwc2nxKIns7kFWvYJbOa b6FeksKAPlOugRq4Fciwy4bkwCyRFafxdMam3H97c5L0z8g8X/CgX/xH/If8gABqC+2X NMJO71IT7070+Z4NZai3cGcOYVlbcICFgIcizYwKT96gKUsNjGmmmp6+WHiDnnIRKgpg 2TriMCjVeaxhELVd1J3ODkiz7f+1M2eLnaoHKILcS+LBOt0Thcgo/gQCxwcz8UVh1z3L bJGraVHVp2bP03EtoDmsVhhb+FZ//FGFbDb2+zHtq0L9+SP7xthjY+UBg0C1ivy89vM6 zmuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aWyt2cysYoyz/Pja0/FYad6jYHqTEkVsxAonTLdhkWs=; b=msCcRSekkA/xiZjGX/XIeHCaWgYUpIzxkY7wvijX8TZjuYCqj+0iuLh3GckNV3d/3v M6vqrqM16WYBc6dCISZ96Rxze7c/KuOuLi3l1EXoIy51v2m9Q3FZ+quaryi67zzmm+Gl N902TtHTgUBTg9RTjnN9/Dgr0TYkbzwdHprxkIJghovRx25hEZLUJENZnO6lziRVZo5x snPzLBdgtKA8Bj0Z9u3df34tVeNRLzyRcy9WnD0FFsnY+e3QP1nKJlZbsVLBEzfGT50Q qfTH1LzprWA459/ar5ryACrPT042LG/IeDl1JrVC74zeGmXWddIQ9mTLN+HW11SVlWA2 xaHA== X-Gm-Message-State: AOAM532fmTpdyy0pLmhx6ps0BvoImlcpMtasc5NY1uRkQVjVDh5zSM7t 213EtwEffbRRFaBBRvKPTMDJbtlOSQhYYg== X-Received: by 2002:adf:c404:: with SMTP id v4mr4127858wrf.85.1593184485264; Fri, 26 Jun 2020 08:14:45 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id w13sm37838852wrr.67.2020.06.26.08.14.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 08:14:44 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 17/57] target/arm: Rename DISAS_UPDATE to DISAS_UPDATE_EXIT Date: Fri, 26 Jun 2020 16:13:44 +0100 Message-Id: <20200626151424.30117-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200626151424.30117-1-peter.maydell@linaro.org> References: <20200626151424.30117-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x429.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Emphasize that the is_jmp option exits to the main loop. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20200626033144.790098-6-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/translate.h | 14 ++++++++------ target/arm/translate-a64.c | 8 ++++---- target/arm/translate-vfp.inc.c | 4 ++-- target/arm/translate.c | 12 ++++++------ 4 files changed, 20 insertions(+), 18 deletions(-) -- 2.20.1 diff --git a/target/arm/translate.h b/target/arm/translate.h index 19650a9e2d7..d5edef2943f 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -148,7 +148,8 @@ static inline void disas_set_insn_syndrome(DisasContext *s, uint32_t syn) /* is_jmp field values */ #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ -#define DISAS_UPDATE DISAS_TARGET_1 /* cpu state was modified dynamically */ +/* CPU state was modified dynamically; exit to main loop for interrupts. */ +#define DISAS_UPDATE_EXIT DISAS_TARGET_1 /* These instructions trap after executing, so the A32/T32 decoder must * defer them until after the conditional execution state has been updated. * WFI also needs special handling when single-stepping. @@ -164,11 +165,12 @@ static inline void disas_set_insn_syndrome(DisasContext *s, uint32_t syn) * custom end-of-TB code) */ #define DISAS_BX_EXCRET DISAS_TARGET_8 -/* For instructions which want an immediate exit to the main loop, - * as opposed to attempting to use lookup_and_goto_ptr. Unlike - * DISAS_UPDATE this doesn't write the PC on exiting the translation - * loop so you need to ensure something (gen_a64_set_pc_im or runtime - * helper) has done so before we reach return from cpu_tb_exec. +/* + * For instructions which want an immediate exit to the main loop, as opposed + * to attempting to use lookup_and_goto_ptr. Unlike DISAS_UPDATE_EXIT, this + * doesn't write the PC on exiting the translation loop so you need to ensure + * something (gen_a64_set_pc_im or runtime helper) has done so before we reach + * return from cpu_tb_exec. */ #define DISAS_EXIT DISAS_TARGET_9 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 4cef862c415..e4795ae100c 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -1616,7 +1616,7 @@ static void handle_msr_i(DisasContext *s, uint32_t insn, gen_helper_msr_i_daifclear(cpu_env, t1); tcg_temp_free_i32(t1); /* For DAIFClear, exit the cpu loop to re-evaluate pending IRQs. */ - s->base.is_jmp = DISAS_UPDATE; + s->base.is_jmp = DISAS_UPDATE_EXIT; break; default: @@ -1795,7 +1795,7 @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread, if ((tb_cflags(s->base.tb) & CF_USE_ICOUNT) && (ri->type & ARM_CP_IO)) { /* I/O operations must end the TB here (whether read or write) */ - s->base.is_jmp = DISAS_UPDATE; + s->base.is_jmp = DISAS_UPDATE_EXIT; } if (!isread && !(ri->type & ARM_CP_SUPPRESS_TB_END)) { /* @@ -1810,7 +1810,7 @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread, * but allow this to be suppressed by the register definition * (usually only necessary to work around guest bugs). */ - s->base.is_jmp = DISAS_UPDATE; + s->base.is_jmp = DISAS_UPDATE_EXIT; } } @@ -14292,7 +14292,7 @@ static void aarch64_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) gen_goto_tb(dc, 1, dc->base.pc_next); break; default: - case DISAS_UPDATE: + case DISAS_UPDATE_EXIT: gen_a64_set_pc_im(dc->base.pc_next); /* fall through */ case DISAS_EXIT: diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index bf31b186578..afa8a5f8885 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -123,7 +123,7 @@ static bool full_vfp_access_check(DisasContext *s, bool ignore_vfp_enabled) * this to be the last insn in the TB). */ if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { - s->base.is_jmp = DISAS_UPDATE; + s->base.is_jmp = DISAS_UPDATE_EXIT; gen_io_start(); } gen_helper_v7m_preserve_fp_state(cpu_env); @@ -2860,6 +2860,6 @@ static bool trans_VLLDM_VLSTM(DisasContext *s, arg_VLLDM_VLSTM *a) tcg_temp_free_i32(fptr); /* End the TB, because we have updated FP control bits */ - s->base.is_jmp = DISAS_UPDATE; + s->base.is_jmp = DISAS_UPDATE_EXIT; return true; } diff --git a/target/arm/translate.c b/target/arm/translate.c index 795964da1f1..146ff5ddc24 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -2775,7 +2775,7 @@ static void gen_msr_banked(DisasContext *s, int r, int sysm, int rn) tcg_temp_free_i32(tcg_tgtmode); tcg_temp_free_i32(tcg_regno); tcg_temp_free_i32(tcg_reg); - s->base.is_jmp = DISAS_UPDATE; + s->base.is_jmp = DISAS_UPDATE_EXIT; } static void gen_mrs_banked(DisasContext *s, int r, int sysm, int rn) @@ -2797,7 +2797,7 @@ static void gen_mrs_banked(DisasContext *s, int r, int sysm, int rn) tcg_temp_free_i32(tcg_tgtmode); tcg_temp_free_i32(tcg_regno); store_reg(s, rn, tcg_reg); - s->base.is_jmp = DISAS_UPDATE; + s->base.is_jmp = DISAS_UPDATE_EXIT; } /* Store value to PC as for an exception return (ie don't @@ -5114,7 +5114,7 @@ static void gen_srs(DisasContext *s, tcg_temp_free_i32(tmp); } tcg_temp_free_i32(addr); - s->base.is_jmp = DISAS_UPDATE; + s->base.is_jmp = DISAS_UPDATE_EXIT; } /* Generate a label used for skipping this instruction */ @@ -8160,7 +8160,7 @@ static bool trans_SETEND(DisasContext *s, arg_SETEND *a) } if (a->E != (s->be_data == MO_BE)) { gen_helper_setend(cpu_env); - s->base.is_jmp = DISAS_UPDATE; + s->base.is_jmp = DISAS_UPDATE_EXIT; } return true; } @@ -8873,7 +8873,7 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) break; case DISAS_NEXT: case DISAS_TOO_MANY: - case DISAS_UPDATE: + case DISAS_UPDATE_EXIT: gen_set_pc_im(dc, dc->base.pc_next); /* fall through */ default: @@ -8900,7 +8900,7 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) case DISAS_JUMP: gen_goto_ptr(); break; - case DISAS_UPDATE: + case DISAS_UPDATE_EXIT: gen_set_pc_im(dc, dc->base.pc_next); /* fall through */ default: