From patchwork Thu Mar 12 19:41:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 184509 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp954051ile; Thu, 12 Mar 2020 12:46:16 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsJCOJ+AFztIO0U3POV+XegteeOocunnN1fdlV6N/86RuFi6AwkuR2MrdauuIg8xsNFW/sT X-Received: by 2002:a37:4b97:: with SMTP id y145mr1752390qka.167.1584042376313; Thu, 12 Mar 2020 12:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584042376; cv=none; d=google.com; s=arc-20160816; b=Q9GMniAG60w0lTloP4d0Q48Ajp42yBU5kjOlElsBEDqt1fVkcnTGUlT2SFsi8aQoyG TFt0UOYbUZFblq4CGrsR+wryMxBcbousjqqxTdU3Xe0NutsxsY/tyg7/l2YCIoSLTyx9 NY2WM6+wm0NEb6QM2aELBmo1EBl90yOdMNqo7hHY1N1tb+wn+3rnX1vVpnV3DMQ8FYCA QKLTFPPvykdpnq5L/VLm+Rf1QaS//Zeg9jOaSOtPVDN2+uLcQ/d9UDZL78ugw0oBonZh uaKIiA+rtL0+ZRYP5mqjbZ8X2fjmirJZx9i3nYdw/4IHd+YUzR2x1V5rLiH2mvp3PAeT KZLw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=/pGqR0ZT/lu7yV5pm4MglVp61s4Mp3dEdpOqchZImpI=; b=goYsGRQzYQKBFu42Mg1CwtOPjIpArA8nSjs1yHG0gXEDKLgSEze+JXsdVsDej2j0tq Vmy96z7j+3Tw8lFUmzS/9eMFbnjEs7YChrIGFJ4cKprtMIZuw6vK5MnPTatC7fXDUN8E Iv8HkG+80W0bLU732DjYUNIAoyHrP6mypvC+Rhpv0kVVAASIql9yogIYfXzM6e4lqRYj JUKNkVxk9mY69bNgQWoDi8rwjVO5V41Ey9g5y16qpETX93nOwKrf2W1X6my+HcFOHfnh 3ovb1kKzgHqMhdN9CUuAe5mboeTAH8yS8XvEU4Nf3LakpVrnsYzgY482xCtgn/BhUiQn GS4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZjnJenYd; 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 w27si3580643qtt.239.2020.03.12.12.46.16 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Mar 2020 12:46:16 -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=ZjnJenYd; 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]:49244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCTmZ-00087L-Lc for patch@linaro.org; Thu, 12 Mar 2020 15:46:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45073) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCTiw-0004oc-My for qemu-devel@nongnu.org; Thu, 12 Mar 2020 15:42:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCTiv-0001kM-8i for qemu-devel@nongnu.org; Thu, 12 Mar 2020 15:42:30 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:36111) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jCTiv-0001jo-2h for qemu-devel@nongnu.org; Thu, 12 Mar 2020 15:42:29 -0400 Received: by mail-pl1-x631.google.com with SMTP id g2so569031plo.3 for ; Thu, 12 Mar 2020 12:42:29 -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=/pGqR0ZT/lu7yV5pm4MglVp61s4Mp3dEdpOqchZImpI=; b=ZjnJenYdXVG6ygE/hvwGUgJolEbNN7rTg4fkKZlbbgupjYkXXQpCk5HCZaC/BRndAg Sb2EC7oePEBHntT7+/ntA22H6yJ8EdKr79Qw4nUcT/O1YaVEE4UTIBRFNbekNmnDYJKl W2Yltewzxm04aQie/Qs+zlIZodGj85e5JlaZlt6qonWkzt9cu+TKUVljnHDMW1vBiu8t xdqNi6kOadEmGDExWf0aLVYMo8cfT3S4NPA7NDnv/ueaG4b91LRLZVDPNYEyzT/kUfAD v0OUYnYjwPzcSTQIIRFwZssBgvDk+8Xa63ur6oT4fDF4MySzIHQ1IqS9W0qh9LZM9c8h WSBA== 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=/pGqR0ZT/lu7yV5pm4MglVp61s4Mp3dEdpOqchZImpI=; b=AQ3KhLVpXRER8KQLutMohjabm8sItCp7LtNQw3JSlMgV1/OwpXw7BCHcnY8rvE3/AK oylMCgZrZ4HGjox8N+Jf73in82GNdCvGLY2m4GOK58vEPdSgo8kLz3Plwfm7Uu/FMQ41 g75ZCT4HGrAZYoAKMgAkTDAWYAiBFzB6Lkpz3ZHxjnZIdTGt1YSJWYjs3I9UCzrOiuk9 wAjPxRiPEJWJZ12xrvl12CzA9baOvslc4IvmpnqPE0zQojisPsSa3n/XO7gHczvr/VYp fPMdyoZNILAI/k1fXMIGhHw/aOvlLYGcikqMdG+/bfrZIF+GU1RatFIkeOrPiQOVxqqU 4adw== X-Gm-Message-State: ANhLgQ3qyuz+Hh9dI05h4hrVF9X3qV338FoFG62KeZ3ox6Upp04lxvnk lOX3VUgD5O/zVskCm/oaOT0HbDVR7Zs= X-Received: by 2002:a17:90a:aa83:: with SMTP id l3mr5721193pjq.5.1584042147577; Thu, 12 Mar 2020 12:42:27 -0700 (PDT) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id g69sm6824842pje.34.2020.03.12.12.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 12:42:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v6 05/42] target/arm: Rename DISAS_UPDATE to DISAS_UPDATE_EXIT Date: Thu, 12 Mar 2020 12:41:42 -0700 Message-Id: <20200312194219.24406-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200312194219.24406-1-richard.henderson@linaro.org> References: <20200312194219.24406-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::631 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Emphasize that the is_jmp option exits to the main loop. Signed-off-by: Richard Henderson --- target/arm/translate.h | 14 ++++++++------ target/arm/translate-a64.c | 8 ++++---- target/arm/translate-vfp.inc.c | 2 +- target/arm/translate.c | 12 ++++++------ 4 files changed, 19 insertions(+), 17 deletions(-) -- 2.20.1 diff --git a/target/arm/translate.h b/target/arm/translate.h index d9ea0c99cc..41d6cc8db5 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 8fffb52203..a793ec9ee1 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -1661,7 +1661,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: @@ -1840,7 +1840,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)) { /* @@ -1855,7 +1855,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; } } @@ -14456,7 +14456,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 b087bbd812..454bff6d01 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -2867,6 +2867,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 6259064ea7..5a21766cce 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -2935,7 +2935,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) @@ -2957,7 +2957,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 @@ -7635,7 +7635,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 */ @@ -10682,7 +10682,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; } @@ -11419,7 +11419,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: @@ -11446,7 +11446,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: