From patchwork Fri Oct 18 17:44:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 176917 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1180210ill; Fri, 18 Oct 2019 10:45:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyn+RWT3dl26ytmFc53Sp0LD5N06jWUIsYOJeJSUsREfwMrBlbAvOQmp5VSdrRNz2of4LsK X-Received: by 2002:a37:e503:: with SMTP id e3mr10131765qkg.491.1571420727507; Fri, 18 Oct 2019 10:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571420727; cv=none; d=google.com; s=arc-20160816; b=NCWCtsE/0dWhsDP7CqN4Q+B4GukP/6ArrrpToyiUHZPsK/EcFvAQm27FISxCQBj/Ih O0oS2CFWJ8P0pnrhhRMfI1R5Qv+i2bRSVIPNhkjsTm8BD4rK952OiHBzGO28FvZQ804J MU6iEZV8sFcO4AJC9VLGDa6cvQo/bxgSV6DW7nDTy3jZ+iqcKXRFeIxPmlQA9DxZR5Sr W6/CE6+rCQ2PCgeLmOeo1jQprgsEMkoXgdHN7nPsJU4P+Zw4IIEXNo4bvSaexQbbpsMP i4QLSNCGHhbY851Ercv5bYD2T9OujR8eUqoGMEk4qZGDBWTIX3r9psBHsJpSx5s+obQZ Ny3Q== 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=+UgAJ6EhcwGdb7pezBRTrZ79eaC+NjRs0dqrTWfzTFo=; b=eUnFuKCH20i7ryU+dksq6g+SHBmX2R6mcNHvSx+mPYrc1grA5fRhlSD98vqDTP2iSV MT9iAgdHY8kLVYX8oouKMah+dlcwXObdfibW2CG8TCFY10jalQqqKMXmNe23SVHmT1Q8 KDRUp7GixG9ElXMwEKuQ1cmhE2CBvLrCb/pbU8+w1sk0JcPiiuiE43IW7l9KTWGhAkHw RMUghxq4yWrMx8WJjYENRvHe9Sz8TEOvkLRmN5wN+CZrmWGOcZp+opOfb+tP0e7+SS/i Bo64TJQs1HT3vgMq0eCbwi1oU7xxvu4QOe6CnFWMS0jRcE2eJidA0N5f3BeQ+ZeSHCFU 8FQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XlSNcfVE; 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=fail (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 e27si6587889qvd.28.2019.10.18.10.45.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2019 10:45:27 -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=fail header.i=@linaro.org header.s=google header.b=XlSNcfVE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLWJa-0006Ub-4e for patch@linaro.org; Fri, 18 Oct 2019 13:45:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59070) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLWIp-0006P9-O4 for qemu-devel@nongnu.org; Fri, 18 Oct 2019 13:44:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLWIn-0005M1-ST for qemu-devel@nongnu.org; Fri, 18 Oct 2019 13:44:39 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:35084) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLWIn-0005Kq-NG for qemu-devel@nongnu.org; Fri, 18 Oct 2019 13:44:37 -0400 Received: by mail-pl1-x642.google.com with SMTP id c3so3197440plo.2 for ; Fri, 18 Oct 2019 10:44:37 -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=+UgAJ6EhcwGdb7pezBRTrZ79eaC+NjRs0dqrTWfzTFo=; b=XlSNcfVErnQtom0GJDyUW051sL+xfl4993QiT/Izb3Ol9gNuFHuxiuVohqlNjAQ+OE zXTrPvaoTrd+PB4iEhEdvRrzMcFTRnYLYMvd5OdGWpKewCpDx7vOnAvEjHALLuEMdq3i g6oSmw8JPpnS+/K+u1RMC/xBpSnx97gWZcPom0ZoQLCVgJKOjyOjVMwd9ypsfFEBJn/2 iaF5Qn636yH/0x/patzvI1XMGzC1SCr8enowIZazAXTH/ZNaOh5PiVCCs+dd5pdCbbQw ViRY0rdo6TLbmJNk9lJK5Py6vMUpXVQyh6LT96dCpTic4yT6UK4EwL/47GgqCz7SdR14 w3gA== 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=+UgAJ6EhcwGdb7pezBRTrZ79eaC+NjRs0dqrTWfzTFo=; b=AKEdytv+5qgdDQoaxmTwbAcb8xG18vxZoSRaJwgPnVTrDjPr9RdZ0xH+lFYN/AF/Zz tU7lvSDZj2+QLxNb0cQS4lw1v0avuwdxcUWPjFfoCnoU0TlNZpOOEeRb1PjFpJ2/WbZa Dnc1L7szYdIn4JP4NUZsxLxXvIL8tXB9zC+8SYMMibIQC6KM/xiczdJPurN27XRRDfM7 IYssJCZOz2URPTrOtBBR1ACmVv4fiv4gEDlBXQYPawP21keKAljjm9r/tNXF1IibzuO+ YOXg2YCU94Vm6vYzM08nVk13IyUV4PHbv3WCgSouGKVN5vqCb1Za5zvyNktYGo9Eylvn v6yg== X-Gm-Message-State: APjAAAVNpcDb35aVrs/Fsh6Eh9S6L8u0Ya5rTDPLH4I2kBVGt7w6TqHt 57+eujmHXjt+WoXuhXAQAh3ldYhrHao= X-Received: by 2002:a17:902:8507:: with SMTP id bj7mr10594199plb.73.1571420675884; Fri, 18 Oct 2019 10:44:35 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id d20sm7857534pfq.88.2019.10.18.10.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 10:44:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v8 03/22] target/arm: Split out rebuild_hflags_common_32 Date: Fri, 18 Oct 2019 10:44:12 -0700 Message-Id: <20191018174431.1784-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191018174431.1784-1-richard.henderson@linaro.org> References: <20191018174431.1784-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::642 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Create a function to compute the values of the TBFLAG_A32 bits that will be cached, and are used by all profiles. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/helper.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index 69da04786e..f05d042474 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11070,6 +11070,15 @@ static uint32_t rebuild_hflags_common(CPUARMState *env, int fp_el, return flags; } +static uint32_t rebuild_hflags_common_32(CPUARMState *env, int fp_el, + ARMMMUIdx mmu_idx, uint32_t flags) +{ + flags = FIELD_DP32(flags, TBFLAG_A32, SCTLR_B, arm_sctlr_b(env)); + flags = FIELD_DP32(flags, TBFLAG_A32, NS, !access_secure_reg(env)); + + return rebuild_hflags_common(env, fp_el, mmu_idx, flags); +} + static uint32_t rebuild_hflags_a64(CPUARMState *env, int el, int fp_el, ARMMMUIdx mmu_idx) { @@ -11141,7 +11150,7 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, ARMMMUIdx mmu_idx = arm_mmu_idx(env); int current_el = arm_current_el(env); int fp_el = fp_exception_el(env, current_el); - uint32_t flags = 0; + uint32_t flags; if (is_a64(env)) { *pc = env->pc; @@ -11151,12 +11160,11 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, } } else { *pc = env->regs[15]; + flags = rebuild_hflags_common_32(env, fp_el, mmu_idx, 0); flags = FIELD_DP32(flags, TBFLAG_A32, THUMB, env->thumb); flags = FIELD_DP32(flags, TBFLAG_A32, VECLEN, env->vfp.vec_len); flags = FIELD_DP32(flags, TBFLAG_A32, VECSTRIDE, env->vfp.vec_stride); flags = FIELD_DP32(flags, TBFLAG_A32, CONDEXEC, env->condexec_bits); - flags = FIELD_DP32(flags, TBFLAG_A32, SCTLR_B, arm_sctlr_b(env)); - flags = FIELD_DP32(flags, TBFLAG_A32, NS, !access_secure_reg(env)); if (env->vfp.xregs[ARM_VFP_FPEXC] & (1 << 30) || arm_el_is_aa64(env, 1) || arm_feature(env, ARM_FEATURE_M)) { flags = FIELD_DP32(flags, TBFLAG_A32, VFPEN, 1); @@ -11166,8 +11174,6 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, flags = FIELD_DP32(flags, TBFLAG_A32, XSCALE_CPAR, env->cp15.c15_cpar); } - - flags = rebuild_hflags_common(env, fp_el, mmu_idx, flags); } /* The SS_ACTIVE and PSTATE_SS bits correspond to the state machine