From patchwork Wed Oct 23 15:00:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 177310 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp893303ill; Wed, 23 Oct 2019 08:36:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxIt0Gh7UdYYF7okMnQxNnjOG8ZBTb68UV9M5xFGFDea7AuPy5KeeCGe01I6cOIbJoz+yf X-Received: by 2002:aa7:cc18:: with SMTP id q24mr11142214edt.150.1571845002665; Wed, 23 Oct 2019 08:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571845002; cv=none; d=google.com; s=arc-20160816; b=NaH3aPKw+M5ImT1LY73PmVAd0EMNhY/s/UWfEtwkYPrXkE4K+BP2yOc2YcczHVyaDd drA7NyPyGnznGDnnspPDpQdlWiWPpjTrAlqCd6vKGyqSy6vcT42yB5MpB4CMvyjMJ5wR s1DC5N80qs53JH6srD3rqCjRf1XcbpHZCk5UDqnqW0QX2tEKwCbqQq8DpIvEp/2B+2vs 8faS8VC1khr0JzRTqyZ6Oxwb04TI5h0Xtn1Wo5m1letOOYEp9i9N7J4SEE+l2IawhSRM 0YiKv0OQXfux2Rs/dmSffmTaPdZC1YBnZHac8+FlvL3mUmJtj1QBeqY1gGZczAdm7YZk h2vw== 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=lF+qrGWUZMwyNoKMUCZs8OSc3juO6V0AHjgSSQ9oaSGyONv3N9Ncdm1eV5ca3Uye8m vxiOuwLGgTIfppfzPxdhjwVsuAoUXfGw6z9HYmQDWIeGwVfmfdcXDpAiW60IbKYxgJQK t/lcysDl3Fq9FQraMCIzpaket3nJZlyVwmL4acKK0sjOEu8RoeYieWFipNPX7IhJVUYe AWWiXeLT46Whrx9ffIkWZB5U8jQWLCM0nCp2887W+mmF4Az0GP0Ba9T4C8FgMfKlin1T sx+nZxzd1LP3r3PyDTizrcBrdASOXdb1kFKWh/R9Fg8FSrUMfhCG1Bb3jYvcn67V3wjx FLWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PgnrO0uP; 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 j16si5885525eda.161.2019.10.23.08.36.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Oct 2019 08:36:42 -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=PgnrO0uP; 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]:39620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNIgi-0003mC-Tj for patch@linaro.org; Wed, 23 Oct 2019 11:36:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35407) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNI8w-0008F8-Sj for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNI8s-0001In-CY for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:46 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:34018) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNI8r-0000zn-Ux for qemu-devel@nongnu.org; Wed, 23 Oct 2019 11:01:42 -0400 Received: by mail-qk1-x741.google.com with SMTP id f18so19439027qkm.1 for ; Wed, 23 Oct 2019 08:01:06 -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=PgnrO0uPpTiYTYsbXPpY87h8Z0eBFe3G++ZOjFoT6Wu3rV+AblsG3Jrtl/PhuHdYq8 DplElLgxVtc81TN7i+dBHdKGP/hcZZqP64CmIX8TqdP7rV4V6p3Begod0zD7ceggmlQC RXxeCK1syyeLApzjg17+yPc0D6vOcJnCflqlR7YeboQbls0QJJVCp/wFtvBH2ReJ6lM+ vkJ67izP6YTWzKKXwtbPIEDPZRc5gTjKxs9u0ngb2+02A9KASpBkc5b09ZRH6/APzcAV QmrLUlVbmej/KoVE3QWUJ2vlWNiAljtW5ZoPOkJjdg+JDgwjC8Y096KCS1VTDONvpVqy 2D5g== 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=gD8wRZ6h4mP4TRABoH1RNfLpM92goPq/5r1v2td4koFg1lQVmeaEoiItOQDMWxTH5c VdL4psg8mzmHoUSD7ZjL/7sq7rAgTYrB2kQI9OXDYZGzi0jlN17ySQoU2O9EcPNahC9f 0fqnKEzqGgH6UEM220skpSAWmsWoSebG2i1s8sP7JgdV2mDJU/shWkJT+9c+S9g5lV4h bWGgYQsfaYxD+DT6lyMlatLCvYL0Hid2hFK/AfOUVsEorEVxX+o++VZiScdPUzaTvOhu Xf9Kjrfc+7615mzV9AlLQlQSZo1bdDmIHOtnuziTmyptBDZpeUcSTdb3+CmfIkYQhjVO mEDg== X-Gm-Message-State: APjAAAXg+ZefMM1FPaLc5+wR3hk1L3nl061TIPLW2N9570ZddM2TRYEv qerEzA0cYDNCTUULshWvuNl1CZrhudg= X-Received: by 2002:a37:4dca:: with SMTP id a193mr8751748qkb.292.1571842865717; Wed, 23 Oct 2019 08:01:05 -0700 (PDT) Received: from localhost.localdomain (198-4-20-64.static.cosmoweb.net. [64.20.4.198]) by smtp.gmail.com with ESMTPSA id l189sm11030168qke.69.2019.10.23.08.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 08:01:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v9 03/24] target/arm: Split out rebuild_hflags_common_32 Date: Wed, 23 Oct 2019 11:00:36 -0400 Message-Id: <20191023150057.25731-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191023150057.25731-1-richard.henderson@linaro.org> References: <20191023150057.25731-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::741 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