From nobody Mon Feb 9 23:59:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538762717277820.6185383149849; Fri, 5 Oct 2018 11:05:17 -0700 (PDT) Received: from localhost ([::1]:36393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8UTU-0002bi-48 for importer@patchew.org; Fri, 05 Oct 2018 14:05:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8UIf-00013U-R6 for qemu-devel@nongnu.org; Fri, 05 Oct 2018 13:54:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8UIf-0003Hi-0Y for qemu-devel@nongnu.org; Fri, 05 Oct 2018 13:54:05 -0400 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]:34944) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8UIe-0003HF-Qk for qemu-devel@nongnu.org; Fri, 05 Oct 2018 13:54:04 -0400 Received: by mail-oi1-x232.google.com with SMTP id 22-v6so10096508oiz.2 for ; Fri, 05 Oct 2018 10:54:04 -0700 (PDT) Received: from cloudburst.twiddle.net ([187.217.230.84]) by smtp.gmail.com with ESMTPSA id q10-v6sm2672278otg.31.2018.10.05.10.54.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 10:54:02 -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=J6cZSM5eTgF1dL/g404yUhATpMowIu7KXBvu1wt+GBc=; b=BQ2j+cuBWebj/sXYJI39N+QswsKjdSisJWP+8SXTJw7GSvWiToezJyJqbUYiFPAKIm DqvOwmWzfj+71tNm7WMvoZdFOetnu4H2WTWcXeahODtlNWvKIlWMAlXmc01VrHfdLCRM BVLmgTUk5gfr4nZ7jLfxksKGqbN5/7bBAyxW8= 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=J6cZSM5eTgF1dL/g404yUhATpMowIu7KXBvu1wt+GBc=; b=mAFY7BN7e8qXtj61jjpot8r9njX5oglba1ZI3Gm6Gi6aI22T+Xw/7knr/QCzhtIT5V o6QExKeVenlA5ix5gKi79hgqkFKKNMU/U39kpZnGzmJmvJpVoLsF5aDFQ8+R7jzoz1lo nD3bnup2eZf/j5XBLpQTl0PEKO2lCoxfiTcJ3v3yAacp7BoTi3TNRlb9P9iXT85N673s /Hc23p9tJc8b7o5IYS68bYFOS68JhHUBJ5WXCUDYGtbMbnQOY4ar1hgw8//C8leFJ4mn v0/VpLZXOvkVrAHVweiIczqlZyJRYiSoSTf27K2RLc/8V3csTwUQUglBv/rYUQDFgwqv 9kjg== X-Gm-Message-State: ABuFfoi1h8Y69tIe0NIm18lm5gbT9XSDNSWpnNq9PNFxUBHK8CFGt0b2 N+i+sLpP3BteawGK99LdcnyF3wqlyhjLTOBHgdI= X-Google-Smtp-Source: ACcGV61nP41JNgJfXQ9XkRDkEbSONbeo/6Ax6Scw3/PtvmIz6qETOaznSGexEtlphjhYvr3rQSf+wg== X-Received: by 2002:a54:4f9b:: with SMTP id g27-v6mr360oiy.311.1538762043802; Fri, 05 Oct 2018 10:54:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 12:53:40 -0500 Message-Id: <20181005175350.30752-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005175350.30752-1-richard.henderson@linaro.org> References: <20181005175350.30752-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::232 Subject: [Qemu-devel] [PATCH v3 05/15] target/arm: Adjust aarch64_cpu_dump_state for system mode SVE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use the existing helpers to determine if (1) the fpu is enabled, (2) sve state is enabled, and (3) the current sve vector length. Tested-by: Laurent Desnogues Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.h | 4 ++++ target/arm/helper.c | 6 +++--- target/arm/translate-a64.c | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index a4ee83dc77..da4d3888ea 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -920,6 +920,10 @@ target_ulong do_arm_semihosting(CPUARMState *env); void aarch64_sync_32_to_64(CPUARMState *env); void aarch64_sync_64_to_32(CPUARMState *env); =20 +int fp_exception_el(CPUARMState *env, int cur_el); +int sve_exception_el(CPUARMState *env, int cur_el); +uint32_t sve_zcr_len_for_el(CPUARMState *env, int el); + static inline bool is_a64(CPUARMState *env) { return env->aarch64; diff --git a/target/arm/helper.c b/target/arm/helper.c index 3b8d838dbc..a3a3b9672c 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -4406,7 +4406,7 @@ static const ARMCPRegInfo debug_lpae_cp_reginfo[] =3D= { * take care of raising that exception. * C.f. the ARM pseudocode function CheckSVEEnabled. */ -static int sve_exception_el(CPUARMState *env, int el) +int sve_exception_el(CPUARMState *env, int el) { #ifndef CONFIG_USER_ONLY if (el <=3D 1) { @@ -4464,7 +4464,7 @@ static int sve_exception_el(CPUARMState *env, int el) /* * Given that SVE is enabled, return the vector length for EL. */ -static uint32_t sve_zcr_len_for_el(CPUARMState *env, int el) +uint32_t sve_zcr_len_for_el(CPUARMState *env, int el) { ARMCPU *cpu =3D arm_env_get_cpu(env); uint32_t zcr_len =3D cpu->sve_max_vq - 1; @@ -12547,7 +12547,7 @@ uint32_t HELPER(crc32c)(uint32_t acc, uint32_t val,= uint32_t bytes) /* Return the exception level to which FP-disabled exceptions should * be taken, or 0 if FP is enabled. */ -static int fp_exception_el(CPUARMState *env, int cur_el) +int fp_exception_el(CPUARMState *env, int cur_el) { #ifndef CONFIG_USER_ONLY int fpen; diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 8ca3876707..8a24278d79 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -166,11 +166,15 @@ void aarch64_cpu_dump_state(CPUState *cs, FILE *f, cpu_fprintf(f, "\n"); return; } + if (fp_exception_el(env, el) !=3D 0) { + cpu_fprintf(f, " FPU disabled\n"); + return; + } cpu_fprintf(f, " FPCR=3D%08x FPSR=3D%08x\n", vfp_get_fpcr(env), vfp_get_fpsr(env)); =20 - if (arm_feature(env, ARM_FEATURE_SVE)) { - int j, zcr_len =3D env->vfp.zcr_el[1] & 0xf; /* fix for system mod= e */ + if (arm_feature(env, ARM_FEATURE_SVE) && sve_exception_el(env, el) =3D= =3D 0) { + int j, zcr_len =3D sve_zcr_len_for_el(env, el); =20 for (i =3D 0; i <=3D FFR_PRED_NUM; i++) { bool eol; --=20 2.17.1