From patchwork Thu Oct 17 18:50:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 176698 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1357333ill; Thu, 17 Oct 2019 12:08:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxHUt6YCzsVU1e+vPwuzsGlfYqtaZI6ZBI/rE3kxeEhHX9EvlNmmkdfNO6X4M0vZRHe9zf X-Received: by 2002:ae9:c00f:: with SMTP id u15mr4719599qkk.281.1571339300559; Thu, 17 Oct 2019 12:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571339300; cv=none; d=google.com; s=arc-20160816; b=ph78WpsdzwZPq4ftKZ1awWUXSc4VfcrT+kjby9YjgGfl2WTeCaWuEipY28/gYB2agg JmKGpmLCiH2vbTrkoXp/0H59Yv5RyvsAXl3jyYKE4GJgkM5TfE11n3mBObwxNE/5zI7I XFjjHoSyFyjyGXVPWzUflGcJMqxeOjQohz6nqwVg2qNJ0gJ0zCWgipEc4vBcQMfAzafU hRo5i2Xe0uYVwn4UEV/NMEDvE7jHMGA2wO49Qw62fohRvt8MHzrCSxStmu8p8sm3G0Vj JCkhplS8VqiTpxpWUFS3O339RfoUQHRW+Sa5ZnlMhjOM6GQL1LvnLqe6+BRZGNS+UaFJ UsmQ== 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=EExBny+oAa/2RvpDTj0xViQxKJSM6o83jutlTagIpwU=; b=w6B9jICmtKXMSaAe3sDtxOmpJsEiIdqNZL46+jolzJ+v62HThT07tZUovxXG6fdl1M gZCOEuR6Td6Q1zPjowvpajETFKjvv3kU5PZZNzyW6cLwA4yCsFKuHR+KEuvGLTT0h3pa oommyUlnvgVzRW/98qjUt1Vfi3lAUVyc+9TwSYTokfvKl3UAv10ScEHFDmXi1gWelvsT QLNrtSl7itZPqlR2G5AY+9YnI79Ugmk4TbEqm/IbFGkWUExZFE+mu2vCP7guJmWXhoGh g4m1lJVRiyVTdV8mZZMuCoo3iUUMbcQTAVyUMQVIoh5Pp9Va5fIdfflQF5m/1dPfrQJa cScg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NxvEpzHc; 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 i15si3191676qvi.69.2019.10.17.12.08.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Oct 2019 12:08:20 -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=NxvEpzHc; 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]:57314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLB8G-0004Va-0b for patch@linaro.org; Thu, 17 Oct 2019 15:08:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35173) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLArz-0001Dm-8y for qemu-devel@nongnu.org; Thu, 17 Oct 2019 14:51:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLArt-0000tA-0U for qemu-devel@nongnu.org; Thu, 17 Oct 2019 14:51:28 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:36821) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLArs-0000sf-MF for qemu-devel@nongnu.org; Thu, 17 Oct 2019 14:51:24 -0400 Received: by mail-pl1-x643.google.com with SMTP id j11so1564823plk.3 for ; Thu, 17 Oct 2019 11:51:23 -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=EExBny+oAa/2RvpDTj0xViQxKJSM6o83jutlTagIpwU=; b=NxvEpzHc9miC/SMKdGOWl7jKJnrn+I+GOrYGHIZY96dtR4Je9HPB41aY1uD00I7Y1b PPBNBcc+DRmf72mohzLzaEnuLezbbll1E8ES8BcgAZx/mZc09f0RUWHGx5FC3ZE4t0jF 2swxCSMPXVmgDKAkm6bcm8OJ6GLmMT09IN3t2PYgbNDUQVmucX9aHNQXUO77Ksbr4YGp pAIN9d4nC2yBYqacG0hJSWRGTib1TkHvZuuqe5a03NNdEmIKiLHMHCrZfMSb4jeBpGjU 59nNDoEidi45CW07mhH0cJtGFqeMO+UQVDb9NC8/s+Pe1WDGUUaHvUEz5JU2rhsl+0J6 gxYA== 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=EExBny+oAa/2RvpDTj0xViQxKJSM6o83jutlTagIpwU=; b=bo6Zi+EyRPu9ogNVn3RfIf4tUe4f1BQjQKP/iA3fHc0CRewQIbW699iS9xk56KaYVM WxPn1FwbN+L63zyX1EF8aMC/5u9jIuB/f1WRTgxemTKfikTH8ffAXPongWj7rWQYqHtc GKeWMNcfkbKbklpwVvlhc0L4JWLy5eHMnLJtrTd5ZC8YtqVHF86H+MMbGPE8E3Qh2Id7 sp4W/pZE/zATzORk3LGOFn1SXVYcSQoqtSo41ghnvSyt5q5BRy8LJVUHhSyelhfJ5aLH uca2/xlwdvpuPdWr5AvrFBcHRIuj6e7Ij4mVVJpw/RoWdmM/rxeoLZXYL9YQ/0dyLUh2 sxPw== X-Gm-Message-State: APjAAAUaV4DlFXIdnS8n3scWpV3vIrfO922QwiE3fH/YKNAlF7QDhKZL 1CwerU35nwQgax3uEDSlqFS1jPGOe0M= X-Received: by 2002:a17:902:8601:: with SMTP id f1mr5665293plo.144.1571338282782; Thu, 17 Oct 2019 11:51:22 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id s97sm5009256pjc.4.2019.10.17.11.51.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 11:51:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 08/20] target/arm: Split out rebuild_hflags_aprofile Date: Thu, 17 Oct 2019 11:50:58 -0700 Message-Id: <20191017185110.539-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017185110.539-1-richard.henderson@linaro.org> References: <20191017185110.539-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::643 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_ANY bits that will be cached, and are used by A-profile. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/helper.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/target/arm/helper.c b/target/arm/helper.c index d1cd54cc93..ddd21edfcf 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11106,18 +11106,28 @@ static uint32_t rebuild_hflags_m32(CPUARMState *env, int fp_el, return rebuild_hflags_common_32(env, fp_el, mmu_idx, flags); } +static uint32_t rebuild_hflags_aprofile(CPUARMState *env) +{ + int flags = 0; + + flags = FIELD_DP32(flags, TBFLAG_ANY, DEBUG_TARGET_EL, + arm_debug_target_el(env)); + return flags; +} + static uint32_t rebuild_hflags_a32(CPUARMState *env, int fp_el, ARMMMUIdx mmu_idx) { - return rebuild_hflags_common_32(env, fp_el, mmu_idx, 0); + uint32_t flags = rebuild_hflags_aprofile(env); + return rebuild_hflags_common_32(env, fp_el, mmu_idx, flags); } static uint32_t rebuild_hflags_a64(CPUARMState *env, int el, int fp_el, ARMMMUIdx mmu_idx) { + uint32_t flags = rebuild_hflags_aprofile(env); ARMMMUIdx stage1 = stage_1_mmu_idx(mmu_idx); ARMVAParameters p0 = aa64_va_parameters_both(env, 0, stage1); - uint32_t flags = 0; uint64_t sctlr; int tbii, tbid; @@ -11262,12 +11272,6 @@ void cpu_get_tb_cpu_state(CPUARMState *env, target_ulong *pc, } } - if (!arm_feature(env, ARM_FEATURE_M)) { - int target_el = arm_debug_target_el(env); - - flags = FIELD_DP32(flags, TBFLAG_ANY, DEBUG_TARGET_EL, target_el); - } - *pflags = flags; *cs_base = 0; }