From patchwork Tue Aug 20 21:07:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171852 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp86607ily; Tue, 20 Aug 2019 14:24:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0k0x6bbqCRkXCsu43VcnotjhBdRhHLkjpY0sV+4pCq89tweUnL8TGeNjLbLAv00fhjFK2 X-Received: by 2002:aa7:c542:: with SMTP id s2mr33563105edr.164.1566336269399; Tue, 20 Aug 2019 14:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566336269; cv=none; d=google.com; s=arc-20160816; b=sIV3jHPUEBovCy4GdZknF8U6LKUidXtzcAL8Qx12QqdLVv69bUiYZBhdbV6DA0yK18 vN0lgZBwUH6eLwb6x4wITwWPsKIRocvtFXTJ6s854t0n5WrH+lERqK1Fh2k4+Odrt1Dk /w3nnkJbS5BOeE3aRZstdzOsKJfHIGnyYMR5z22oGt7Ugq5C5mck9gAxoB0s5Xa54QH0 f3C+uieDuBiAyRTuJYPrE2K6UsYdKFygyUDzrRjtgmjZaeUTJ+O5UyfLn/zMwTyCt5uM tg3tLU5ysLCW6B/lT+UjxhJz6rJcUfz796YTiQ3bwZ69Y78/9d9RbpMI7YYWI8VceORk ddog== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=ukkPGAVjpyiRXhgCeNuw1onp0A6uGMb4+O/vZ/cyj7c=; b=LzcuXlQZ2i5OfeplzXfeZJrZusasfX3dCl/mdQEcq9iNmxv2hyAma0aOVhLm5559IN dK7pY50LxDjacBUtglcnzWhA3rc0/oO55vKwGe3bYg3j27U93R7eij9uAOZCAgAeirSL OlKAkuYkHxIM7h0WJMk97HwXPrwQfHSxgDimBb2F1GRfdXxUx0MrvH9QPBytFYNxGYJx ElWl4bWcSwhf3pO2P2c6WY3JrVQk04BoCFa/UncKoztyXJL3LPFXC5MG1hnqwEmO5Mwj wEHKPrX/9bI2zWECN77JuZPlBUzRbpKsliE8hqXIYmtCldXDP3TOEH0KsHi6IG5NxZlD UlSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="yuQlPjz/"; 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 b29si10809334edc.265.2019.08.20.14.24.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Aug 2019 14:24:29 -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="yuQlPjz/"; 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]:41880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0BcB-0004tu-NU for patch@linaro.org; Tue, 20 Aug 2019 17:24:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53687) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0BLl-0000GH-QJ for qemu-devel@nongnu.org; Tue, 20 Aug 2019 17:07:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0BLk-0008Ni-MK for qemu-devel@nongnu.org; Tue, 20 Aug 2019 17:07:29 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:43112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0BLk-0008Mr-F4 for qemu-devel@nongnu.org; Tue, 20 Aug 2019 17:07:28 -0400 Received: by mail-pg1-x542.google.com with SMTP id k3so2472pgb.10 for ; Tue, 20 Aug 2019 14:07:28 -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; bh=ukkPGAVjpyiRXhgCeNuw1onp0A6uGMb4+O/vZ/cyj7c=; b=yuQlPjz/D/iLzbeS7LqBhzuxH/9up4FNXsZo2ec1o5fwM9roaHw/umNMOJ4DFxl+tJ OR+TzqhIZQ6rO7+qt0nsk/YePEoFe5HVsmg+EIgaJvbUUcAg6+5RQCdsZtzB7KV2B4p7 tAaJzzX2AISMUzau2vNSAlFlIAlibstjoq73MljAjUfBSTAr6mltZhvUnGu+mEgBbGzg 6IxHGqtpAO5WrzSse/UOfUxQRIY6KQsCvTwnifsuJTOH6Zo6gRXnf0aMzsdiB9ig2Y36 T9o/tUVCFq29I8/8p1hy+2ECG0wY4ff7WR+ItYvQYv8j236RCimt4sLbwHkfZbQNADui cL7g== 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; bh=ukkPGAVjpyiRXhgCeNuw1onp0A6uGMb4+O/vZ/cyj7c=; b=eA/+taZnResoMtHyWT/iOC5s+TAGD6wrmZBsU9C19fbgFddnTPHCLRuIqff9CCHtnS uvHTrLld0IjgxcZxDUdRdzGwA98n1nxbJYWpLHnpj0NDMvViW9J3SkRdQn4ShBnYibLa 917jvQkKZTEgu29jcYojdX5mbg4wuUxT2TEeuuVtwZ9HN8QVxKn2RjaGsb7uChTO7Mk2 mwakfBHapsGHg2sV0I7uLNw7FB+fPXOUDAs5rOKhTfwXwMvFNVkkaLllvioJAnPGywaY B2OD6NmydWk6PPYPDH3IHFSB0z89xVRuaqae2LL1K5YparhioerKI10L1DXRGuUXk8c8 1skQ== X-Gm-Message-State: APjAAAWnNDDNnEtLTRMORtBRpm8OqP5m0MIDv/y9hcojony/zczliMM0 3UZlLwG3NmiRKpRDIF8MTUIWz2tBqfA= X-Received: by 2002:a65:6284:: with SMTP id f4mr27188420pgv.416.1566335247021; Tue, 20 Aug 2019 14:07:27 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id k22sm21690743pfk.157.2019.08.20.14.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 14:07:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 20 Aug 2019 14:07:06 -0700 Message-Id: <20190820210720.18976-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190820210720.18976-1-richard.henderson@linaro.org> References: <20190820210720.18976-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::542 Subject: [Qemu-devel] [PATCH v5 03/17] target/arm: Split out rebuild_hflags_common_32 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. 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 02cb43cf58..1844c13a19 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11032,6 +11032,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) { @@ -11103,7 +11112,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; @@ -11113,12 +11122,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); @@ -11128,8 +11136,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