From patchwork Tue Aug 20 21:07:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 171856 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp90608ily; Tue, 20 Aug 2019 14:29:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlxvPERYwQAzoVOI1YN0AUmvaW/iSQgamuUUAKMfcjWgRrqe9SU0l5/REuE6SSDQ98kfPn X-Received: by 2002:ae9:c206:: with SMTP id j6mr27542515qkg.14.1566336551168; Tue, 20 Aug 2019 14:29:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566336551; cv=none; d=google.com; s=arc-20160816; b=Kf2WQ2iQR9OvVkdIY9BuUP3ctAG7bSBHxVDN6s+/hu2oEYyRScOdUjgednDmsNiHQq hS1d3TaShC41xp2VTxyVk0fUZVh5Oy7nyF9VgazZb2aBSYIyuEvhqurCupX1n9Z0BJKR dpFLS8+GMiaPj6ylsLbJKLNtHalT21JtuPTmkpd+kq+PJ6iQP2MiGgUj/fKlfGIGZHQ5 hBi9zOwPmUcqSdF03zVogNmhp9FbeysQu3d8+iFLgtsikx8xeVNqrKO4Q2WPPW47uNRf CV/vtnaXXt849O7Wz6ecCXVCQzWeIoP4Qm8pkEjKMAHeTcPs/PwFkQnnVxHOt3MwqLTg 2WKw== 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=yxbpJRWxck0uWFUl/a/sUY0K0yqQ+42Z+aDE0x2Cf9o=; b=NTYMnIMDgkPGSYz5sYZdrbaifuVSg56+X94gwNoabQUsm+LJrhKCRyAyD7B3gxzSwg zf7oPPFlftGOVxA0gIUX1BRQNh8Di7g5PdDe9RdVwfqTdaCSdVVDd7U1kdZ4CsyMVNUv l7XTV7AcKN1jX7OMdgq9nGaiKE25nYyipga3vqcNm7PW0xOJaKfh4k6Kp/rGwIxF/8NL nOUnj2Ed8zYYIVsJJAf/q62xgKQ0RPkH23yoakgfXkwnBjCGSu16IiGN31l3bmpT66At u7WjR6+8HcfIhTO7yBZcZ23xlTaCPKboT3UWqU9kxCZ2TYI9uO3+xWgw3jcYVeU4Pvje XYLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eij0cmVB; 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 x38si8859912qtk.117.2019.08.20.14.29.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Aug 2019 14:29:11 -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=eij0cmVB; 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]:41982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Bgk-0001rx-DQ for patch@linaro.org; Tue, 20 Aug 2019 17:29:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53901) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0BM0-0000JP-L4 for qemu-devel@nongnu.org; Tue, 20 Aug 2019 17:07:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0BLz-00009u-90 for qemu-devel@nongnu.org; Tue, 20 Aug 2019 17:07:44 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:40082) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0BLz-0008T8-04 for qemu-devel@nongnu.org; Tue, 20 Aug 2019 17:07:43 -0400 Received: by mail-pg1-x544.google.com with SMTP id w10so10801pgj.7 for ; Tue, 20 Aug 2019 14:07:35 -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=yxbpJRWxck0uWFUl/a/sUY0K0yqQ+42Z+aDE0x2Cf9o=; b=eij0cmVBA9PsJOVyV7dPQAbrVthpOec9elcRG0WGQNG8pWWE6SJDrp5R164UbPGBH7 XBYuLshgkBzAWQTHj1e5neird9jVbxxyyU2BdsOIZbvLXY/GTNhZAQFDRuGAhzxv7tsd 6DBdMuQemWY5NirBMv1fWd+5CJJWBcIfkYWFjnkGqfr1HnOxT+dQ+kC6DmS6dOhRXOzm C5AaTtzaIBqN0zjS+UJM5q4nBe7dh50Jnph2RhDxUFaUTIOp8uXE8qPi6yeRgQzonJoG bCIMR6hT0Aq6pqOCjAuXB/EKPkuifO5Zbp5x2FYg0Vt7NKLcw+gNzFVSSPk3OM0gBrmE QtEA== 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=yxbpJRWxck0uWFUl/a/sUY0K0yqQ+42Z+aDE0x2Cf9o=; b=ZnuZcOIf4lYJfzUQG2LQ9y5Qz/pJJJiaNJDClD+X/T8FkrhTti74vvGI4RrEHblgAr 6p2kXPDyqbfIFsSfNvU+Y9VU2tHywAQgx4GRE6LU98n7Pb+9vwxv3XN6KswtGDGj7IrZ 3TIjy6TaQQFMJDhTAeGkADZ1ESE02asAMctr/YiLTORq1YsnOMY0fTFpVOc3X4f1IWR+ pgW3T3UoN0NfWfBkmg/BNzDL1WQHouLruLfgqhXao3tnXm/B7tSLoTfhdQAavmrG5SpJ Ciz78rIz1/BaxMrASSJaot4SVCCr5tfWkhAVE+Q24ny7ab3ui72M+t6gryNK8J6Uar3S Ckeg== X-Gm-Message-State: APjAAAWceFCZwbHdu36QEWPMO+kNsSS0iYO0i+bVvJJh6IE85CDGRva1 WqlXfcbhwdECFpRIFCDeE/PFMz/vOHI= X-Received: by 2002:aa7:92d2:: with SMTP id k18mr32011830pfa.153.1566335253852; Tue, 20 Aug 2019 14:07:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Aug 2019 14:07:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 20 Aug 2019 14:07:11 -0700 Message-Id: <20190820210720.18976-9-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::544 Subject: [Qemu-devel] [PATCH v5 08/17] target/arm: Split out rebuild_hflags_aprofile 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. 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 0fea62dc12..fc071f95db 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11068,18 +11068,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; @@ -11224,12 +11234,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; }