From patchwork Fri Oct 11 15:55:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 175987 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp943345ill; Fri, 11 Oct 2019 08:59:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUlmzLb8Yj1pkLS6rAeWk94Z9d/TD8CKj1+LwTONKjCiKUmLNNWA3wDrpjMbcJF/OiSNeo X-Received: by 2002:ae9:e20c:: with SMTP id c12mr16560218qkc.149.1570809555932; Fri, 11 Oct 2019 08:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570809555; cv=none; d=google.com; s=arc-20160816; b=GvtwNTagYohz9WwtvW1afQwxh7j0NKAykLAog0F+9W/p5Sw1k+fOnUAfAij97B1Rrd qC9+A3VHjElbr5Z9DOdWNoYiAptJbtUYF/xQy7tv9jwy9DEppTwiJq11p7T37WXpCzai qbr9qQXsKoICrnxnoUnsujMgc9EkogTJcw0hYWWqlvGGOrZ2j1JoWaRLxeUEAxaqjuph P5v4tKMHSdKjn50x6sxCd1nltkU38lEYd8n6YQ9qF+m7g7E2fpu3WEatrW1eJwrs12bU H0Ai0uEqJGJ0uCDuCqOcjs8UbDjTqs1rH8Sz38t2rPBCZkj6NSfj6qnF1dRmk34wlVpU aR6Q== 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:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=JZ4FcxbCDDWJsqSaXfQWATqqO+tlQqneKyRyH+pvJoM=; b=x68RX/QJSC3ZyZnC/y7QVi/PzJKOdIPZ4PwQC7zdwh44KZf4AIw/Kp32JMSoeirVD+ y7RolcXT1O8JTse4la/noVYwZpxVG4wsc+0lBe7tQ0ix25CF8Z+6NxvJ4857+49HiVCA AQsPjet4j6RwYyiDuKxx20ksYCaETrzl8av5cAf7Qtr2MyQ1/5meHnHMJyXzaruk6YML RYZTwU0TPQ6/6NE4mP5AeTcVpNu7cPYhxA5Z1UbWBBFrc0HBetbQ4EO7i5t2EiGWrsLL mty0K+T31MKCGup40irV8rPP7AW7jum2w9ul8hkwaRJNPrhX8Utvktk5BAKwFwIMtt+K lc/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VoKm83e3; 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 f21si10805720qtg.296.2019.10.11.08.59.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Oct 2019 08:59:15 -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=VoKm83e3; 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]:52868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIxJz-0007Dl-6J for patch@linaro.org; Fri, 11 Oct 2019 11:59:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33585) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIxGl-0002GZ-KF for qemu-devel@nongnu.org; Fri, 11 Oct 2019 11:55:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIxGj-0007aC-DG for qemu-devel@nongnu.org; Fri, 11 Oct 2019 11:55:54 -0400 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]:37864) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iIxGj-0007ZB-9X for qemu-devel@nongnu.org; Fri, 11 Oct 2019 11:55:53 -0400 Received: by mail-yb1-xb42.google.com with SMTP id z125so3257328ybc.4 for ; Fri, 11 Oct 2019 08:55:52 -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=JZ4FcxbCDDWJsqSaXfQWATqqO+tlQqneKyRyH+pvJoM=; b=VoKm83e3fCwHAtGn1hsDLYwwFA2FmbBEeuMbI1Wuu/C6nJEnbuJOeozqfZHTgZz0fG KT4A2Gwyamd8MUTe82jS3tbMnjnezUBxRPYzzG1nCFYrc7QpVo5/8RSkITGpYKXx5IDT n7f2NbeOwcxfOTZPJ2oY586SKGWp/w2AiIbmX0filRsQ1i5jngKKkB0j4rjwRHr4xl4y ojDUy4RHKfQbYi9FuvvuZlii37W4Gp1J6vdlz9cgXaA6GlYRYuBJnYhvooEptfAJEMiZ iZb2v1abw/Wdaqh5J04itKQK/TLxgKrUzjEJHSsFvMWM2b2+SiuGy7kBanCAiVaO6iph KTxQ== 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=JZ4FcxbCDDWJsqSaXfQWATqqO+tlQqneKyRyH+pvJoM=; b=rKSWgBvtlbd37ad984cvoyKfEGAU/WnAhH8Bdacr0ldUm9T1viBK8rrA1vblM4ELXb K4s4vOxZ+hKqjU3fQ6LUmGtRe+aOd2NDP8jUZAUsU6P+5ROL5DvZd7oLF+zlBxrx9JmK MniRJkNqROQbvstI3SiLSeFeDJTYd5BZO+ldhDc6zyAlrWuqZJHr5gC8wLdBPwAJ9qBO qd/d+GquzEF9levpwE/gRUHZh34MtlXcl1aOSdi3iGcJ7GGMiUORbufkEJFsou28CcGz veHMoRbJfysvSdKdbxQbzS7jSQ57HlP2ZSeN5YqInL+PItnS3rYBQJ9gOBpEuDJHct8k c2mQ== X-Gm-Message-State: APjAAAVGpKzIy291kZvrAOWmI3e6wjLsopYhj/+4isv3VsNG8rXxDCJo RXeFYFKHtD0y3zXirJjd9HlTyBMapN8= X-Received: by 2002:a25:7b44:: with SMTP id w65mr10012844ybc.393.1570809351386; Fri, 11 Oct 2019 08:55:51 -0700 (PDT) Received: from cloudburst.gateway.pace.com (67.216.151.25.pool.hargray.net. [67.216.151.25]) by smtp.gmail.com with ESMTPSA id d17sm2473139ywb.95.2019.10.11.08.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 08:55:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v6 03/20] target/arm: Split out rebuild_hflags_common_32 Date: Fri, 11 Oct 2019 11:55:29 -0400 Message-Id: <20191011155546.14342-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011155546.14342-1-richard.henderson@linaro.org> References: <20191011155546.14342-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::b42 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: laurent.desnogues@gmail.com, 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 Reviewed-by: Alex Bennée 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