From patchwork Thu Jan 27 06:34:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 537090 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp5158028imr; Wed, 26 Jan 2022 22:49:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgW4yqqpYaOwvXVfD5JkJfiLqJLXsNhDISW5t7Uj6w9GKSEJro8SNfaipEbcXRgVv2N8Nw X-Received: by 2002:a25:cb12:: with SMTP id b18mr3723328ybg.439.1643266141286; Wed, 26 Jan 2022 22:49:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643266141; cv=none; d=google.com; s=arc-20160816; b=RieZg3DtvrzsafKNZkdsaUZtJYKVFpMOkX3mKXj7mKhpL8vd+ATc3USwPHrxNgNZb3 Aot/qKT+0M8tTbFmtWDR6Bvch831f9S9kBABCHv+2Fa3htdJY/DfD0MXyORC3/jfV1S0 cpXAsMBOP8kFIdWxJrdHW5r0ckHCJgc37TEYgtMeEjhWbAMU5xfh8Az7AuU2PQpulFFY THoOjiCRa0DsienHlm+sqWoPKCdurxS8xUaAKilfoemtietCpLtWvsTgMHCKZNZBxbWs I9a2oY5MQ1ePTzt8d2pokDegWoVtg1vgcLEEoBA6wLdgsRc2MfeKdBis8NMslWN520ee HJ1g== 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=E75DjW4QVNIQo9iQ7CSqAeo7IxlAo+AuZWRbk+594s4=; b=0AM2cwVLiHaFuaAJrPkSe2ostMTw9bYgITcXFLJ3+rO9FDqn4oX7rhGfACzaLLKthe XG2ka1heQYR9WAEQqGhUCDV5RHbTUchUwHhIfIuUcnpVAWmmIir/DMAD3d2azenp03wQ +xcEmsJs5kFITVWoMrnT76PUpr+TqP6VlBm9Ycza5P+jmsBPirMRGPs9uIJAUZjBdDSy KFkQTdP9JkgCv9le76LnBVsLiI3CqCStq5eUkBvvk5etsWf91y8F5R6Dzcp3jBBQAhCD 60L/P+lhiVCMySXZ3Q2bftq9xAoXKXlN0dcn4/PmGuhY+CtDSvIz0tBCUzkK3R6SrqI0 6vbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Rs3dXyFl; 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 d8si25313034ybc.256.2022.01.26.22.49.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Jan 2022 22:49:01 -0800 (PST) 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=Rs3dXyFl; 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]:55158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCyaa-0005rK-5M for patch@linaro.org; Thu, 27 Jan 2022 01:49:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCyMh-00043s-D8 for qemu-devel@nongnu.org; Thu, 27 Jan 2022 01:34:41 -0500 Received: from [2607:f8b0:4864:20::1036] (port=38563 helo=mail-pj1-x1036.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCyMf-0005ib-PN for qemu-devel@nongnu.org; Thu, 27 Jan 2022 01:34:38 -0500 Received: by mail-pj1-x1036.google.com with SMTP id d12-20020a17090a628c00b001b4f47e2f51so6583112pjj.3 for ; Wed, 26 Jan 2022 22:34:37 -0800 (PST) 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=E75DjW4QVNIQo9iQ7CSqAeo7IxlAo+AuZWRbk+594s4=; b=Rs3dXyFlt76aY9nfZGtdOqYTIllhdbtDsJjTrXpaojxuneTJQubSdUoPBw6BMLhxgU 4pxj7sy2q4HMrNidZL33uc3TN4aMLX5ndC2UFkyPZ8UztVmOb9wo4aBS2nqgXg+M5stm ubFY2y+7z9FhY3fOP9NeVeigjDBk7GvHRk1IZtYQSwQBpjZ0KdtC7ehgZQoZ7VnrWm/4 lOMRmeb4NNogoOqf9RFF+H1YkjMw+Q+BJCr2kKgUj0MS43PXNngdYiQc3vQLoIF8zIYZ e8zoYfln9i/jlfmXM8vD2EVqsvdvpcvi8BSfzAw952fSrnW1pWVz7An6Xk+Z8YI7cG03 p8zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E75DjW4QVNIQo9iQ7CSqAeo7IxlAo+AuZWRbk+594s4=; b=DAQgBx5OlBF4bPY3kH9yLQGkuC9hFLvf3Bt+iEB+8NI+dwCyHNTCmpJYlTtmkrmO1a 2F8jnkLWVP8g9YzxlcHAge/NcPiIGG1qmn/sMXYUfiT+T1ETWjxPj3Aa9JIwbKJ1p0GA yGrHJEM3FBYyDupMGTBmdTabLDhHSJTc47h/SKyJSgSeoPLdjYulwj0IZ9944VbOV7ei FLUIceHd0QQjTDhb87yftxJIBnBsY3tG6O3e2Rqicqmime7meVa5IhTGLi541iQOtsZm lIFo+YKYRavA5tA8vD2kyU9tm+iVBc1HfRy6Hc/LAm20oq5h89u/A/4+PXuxdMxcItXc 11Dw== X-Gm-Message-State: AOAM532UNV+UIQa31yiULhHNOSxN5+ZCM87Id0nBxmNYjAgnxe2om903 PQpIpk/pmqs75AS3TIRRLWtu+yop+bCbQING X-Received: by 2002:a17:902:8d96:: with SMTP id v22mr2471111plo.77.1643265276453; Wed, 26 Jan 2022 22:34:36 -0800 (PST) Received: from localhost.localdomain (alanje.lnk.telstra.net. [120.151.179.201]) by smtp.gmail.com with ESMTPSA id y20sm4231855pfi.78.2022.01.26.22.34.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 22:34:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/4] target/arm: Fix sve_zcr_len_for_el for VHE mode running Date: Thu, 27 Jan 2022 17:34:25 +1100 Message-Id: <20220127063428.30212-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127063428.30212-1-richard.henderson@linaro.org> References: <20220127063428.30212-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1036 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yuzenghui@huawei.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When HCR_EL2.{E2H,TGE} == '11', ZCR_EL1 is unused. Reported-by: Zenghui Yu Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Reviewed-by: Zenghui Yu --- target/arm/helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index cfca0f5ba6..d9ee2ba5f4 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6225,7 +6225,8 @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int el) ARMCPU *cpu = env_archcpu(env); uint32_t zcr_len = cpu->sve_max_vq - 1; - if (el <= 1) { + if (el <= 1 && + (arm_hcr_el2_eff(env) & (HCR_E2H | HCR_TGE)) != (HCR_E2H | HCR_TGE)) { zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[1]); } if (el <= 2 && arm_feature(env, ARM_FEATURE_EL2)) { From patchwork Thu Jan 27 06:34:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 537091 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp5169283imr; Wed, 26 Jan 2022 23:11:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgW2R8uO5PmXpkIPmotYLN3ioaH9PCmYy7HsYsh13m4MRh0K3qmsYHl4WBB9WUa6G90oEq X-Received: by 2002:a25:7743:: with SMTP id s64mr3766168ybc.621.1643267508650; Wed, 26 Jan 2022 23:11:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643267508; cv=none; d=google.com; s=arc-20160816; b=JglkZnjILhKYClLL5LGyElLtrllyglVqErvBM3W06/z+LgNHlTrlxz9DIF+gcf2Ee5 2CWJ80UIwNHxDkYzkNRWAihHrKfUtFwXwrMJe9/qXmfMrPaTYrK6QVMtGORTE8lD38gM a+kAjKriUwIAy3OL9alBWZwYtxLXUcUZ8p/fN+Q9w91mJzGvxBWL1iwxr9F0dovUGHto Jz6EBsV+YYHWbHb6dZYOzPAasGpV4k2HjeXgMtQzDlreuaanL2frYCECBtSo+yxyhsCb bPZUVpgKlhXUjqaDyLXnAwMyQuIgzwYLoXO6y7et2tyfCpp9OWUTT7lP+3qqF5E0prrz 6/ug== 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=OnCbwXhM9/o/J8yHFW89wxfhUkfvaIKD6NjXHeW3Thc=; b=EIo/fSdxohlLl3bj/7cCqVukKqb/JsdLqDhAa6UIMqt2GjQZuq/K4fAjSjb4fSzCyD HIUrSZpnIvEsYreocNXfmow68CQAgV6eOUZQdx5WLk1iGJJX+onSJRIpLC0HHeh/p4GH DRCsLYcnpNRnL2bPJygu+6ZGm7Vz19AFAv0gYo68lIITmSISsnibcxkX5YZOkFUrREZg uhLl3QUVuRPX/XCV9sjMDGfojEHBEm7Y0YRID67f1oFKs2oIK9glupuq2FRRoINUwr4p Rj0z377nOJtYeKhvC5EFoiY0D89H8n6YzY2EYor4MHtDWvmqMZfCMxPal92ULdX09xx1 fH0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=APGbKKDA; 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 u64si19644680ybb.587.2022.01.26.23.11.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Jan 2022 23:11:48 -0800 (PST) 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=APGbKKDA; 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]:60526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCywd-0003Hj-Sd for patch@linaro.org; Thu, 27 Jan 2022 02:11:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCyMj-000444-Eu for qemu-devel@nongnu.org; Thu, 27 Jan 2022 01:34:41 -0500 Received: from [2607:f8b0:4864:20::436] (port=42576 helo=mail-pf1-x436.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCyMi-0005iy-0U for qemu-devel@nongnu.org; Thu, 27 Jan 2022 01:34:41 -0500 Received: by mail-pf1-x436.google.com with SMTP id i65so1768200pfc.9 for ; Wed, 26 Jan 2022 22:34:39 -0800 (PST) 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=OnCbwXhM9/o/J8yHFW89wxfhUkfvaIKD6NjXHeW3Thc=; b=APGbKKDARtRzYgk0pW3JYlGmeECbs7z71LfffzOQJOWZHVOFqcKFeMw1u8KElSBS8R /t1e455RPe9PLWoTM0eP5cSXjynSQ3mZuDeEu3j0Imgbz31wlBfyPZ4BiAgZI4HCeLSg roIEjoQHA6MMeIWZ6tAWvHYeB654evQeEg69xS/Oyfna6XgWn/3P5wMRFckPtsGK7hdy 6tNXfUWZB/y2TKLgW0TlhGR7x24gbZeatW11cKeCk8fEc7OBAC5Ffe0Ve+NU15Ac8p1v NffvyEU0c1LeSvC2Ur5zbrMXTYyl0v1rmnmISr55aS2g8qyaHCVLWNCgwK5Imly2VtHU AGmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OnCbwXhM9/o/J8yHFW89wxfhUkfvaIKD6NjXHeW3Thc=; b=FhwChfqV/f+/51atJX5UP4XCsT9hd+gv+H+46FoDwLBUQziO9DnZUB4yp4W//I9aIe sMzTF0ZrvnDCq/MgjEbXDV4QQOxEp9aOWCF94RBNuE61mb80ldSGFAPWcGjYeg1S++8q Zj+pPd380ei3WYUu9r2plF5pSVS2OHW79LOYCsjcIWUxXIO8DhCZTmZyiqoyT4HLjobR ud0AwNzH7Nrr7AZ0HOnxUhn5ziBBBYAJ5os+cJoJtR2740Rv1fDDtpENL4Ltdh6PnCv9 /Vvy1vcEQ+mojvSaOUg5GUnQ2aLcU2dSOgX4wEbM2FOJcOPcLaElCGHuqn5ch8Zgmg+0 LKxw== X-Gm-Message-State: AOAM531VUyDKPZnxNab1WFgh2yppxN3QFGCGW5IBRdEU+BneIdh2lF4L a8nOXBydrOSwxqA93R/+P5mQlwbt4vdyyjvT X-Received: by 2002:aa7:88c9:: with SMTP id k9mr1882623pff.58.1643265278574; Wed, 26 Jan 2022 22:34:38 -0800 (PST) Received: from localhost.localdomain (alanje.lnk.telstra.net. [120.151.179.201]) by smtp.gmail.com with ESMTPSA id y20sm4231855pfi.78.2022.01.26.22.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 22:34:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/4] target/arm: Tidy sve_exception_el for CPACR_EL1 access Date: Thu, 27 Jan 2022 17:34:26 +1100 Message-Id: <20220127063428.30212-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127063428.30212-1-richard.henderson@linaro.org> References: <20220127063428.30212-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::436 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yuzenghui@huawei.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Extract entire fields for ZEN and FPEN, rather than testing specific bits. This makes it easier to follow the code versus the ARM spec. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Reviewed-by: Zenghui Yu --- target/arm/helper.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index d9ee2ba5f4..cd48560786 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6154,30 +6154,28 @@ int sve_exception_el(CPUARMState *env, int el) uint64_t hcr_el2 = arm_hcr_el2_eff(env); if (el <= 1 && (hcr_el2 & (HCR_E2H | HCR_TGE)) != (HCR_E2H | HCR_TGE)) { - bool disabled = false; - - /* The CPACR.ZEN controls traps to EL1: - * 0, 2 : trap EL0 and EL1 accesses - * 1 : trap only EL0 accesses - * 3 : trap no accesses - */ - if (!extract32(env->cp15.cpacr_el1, 16, 1)) { - disabled = true; - } else if (!extract32(env->cp15.cpacr_el1, 17, 1)) { - disabled = el == 0; - } - if (disabled) { + /* Check CPACR.ZEN. */ + switch (extract32(env->cp15.cpacr_el1, 16, 2)) { + case 1: + if (el != 0) { + break; + } + /* fall through */ + case 0: + case 2: /* route_to_el2 */ return hcr_el2 & HCR_TGE ? 2 : 1; } /* Check CPACR.FPEN. */ - if (!extract32(env->cp15.cpacr_el1, 20, 1)) { - disabled = true; - } else if (!extract32(env->cp15.cpacr_el1, 21, 1)) { - disabled = el == 0; - } - if (disabled) { + switch (extract32(env->cp15.cpacr_el1, 20, 2)) { + case 1: + if (el != 0) { + break; + } + /* fall through */ + case 0: + case 2: return 0; } } From patchwork Thu Jan 27 06:34:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 537093 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp5182645imr; Wed, 26 Jan 2022 23:38:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+iPnJ+F1DseasPaDvZJ+QQwyMAlGV9f9wAz4UDQbv0QFbDb3duCkj825b5zq1UCM6ItR4 X-Received: by 2002:a05:622a:45:: with SMTP id y5mr1743645qtw.154.1643269087503; Wed, 26 Jan 2022 23:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643269087; cv=none; d=google.com; s=arc-20160816; b=xLowpzYzJhXrE6PKFg9v4fEGAwKM2NB8OggkTfw828UfP/6miaDX6EbJORsxso+2k5 y7X27illWCYWhxKbT98Jeb/6WUkn4HqspM3xyYrvsF+EB9SjlKMQsUZJ8uPVzFAihC6j yj4XjGX5g1KXkCOWVkhhfnn8GSveI9GESi4BTG+Fjushu8O0A3GfVlzkkcd3a1BEJUx6 u20oZNDV/sUcA1Z3Ku2Ug2MYbh5K6a5P8Effn50i87pKr0/wvWfrd8XcLuLAIvPQRqZH kK8SVi4eK9W2K+bnA9FPWHhNSxyFE/ep/dmQR3zrG58s4ww9YIQHMLDmm1BHc9rtP5Co nGJQ== 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=HwDFJsijN3KKV3amxkEWOLWADJe1maxxFGeKyIOR3PU=; b=u353zNxu4yCKwzVcXOmrHzDl7k+TwaHHZ1F9ShBbsl5kH/QCHpSQ5H+6Sqc87ON5ts 87zba60VKFChzEfZQ7hsIAqJZnZ1JnrZjZZrrRKxCjWfQacSYYyTwBbfkPNp1MZHPDQj LJh1hW9y3kwbiNOb4BaPr2Fef38ZkZlRUPTnlp5gdIUMSj5eqrpP3vguiQivMTMDh6gg jzsxGIOKmzhpHYLVoErcWOk2flpoJtjtDLNHrqBQ61IpahTn6dg37n2wGdmXYuvg3hIP DhY2NEhAgTJjjCO+DhA0/Nmc8KCpXl44wSuH0LNByhWdgKxjcKqT1hBnOiRYCfNrLL+N oC5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=V1p00Vew; 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 gm1si774852qvb.368.2022.01.26.23.38.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Jan 2022 23:38:07 -0800 (PST) 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=V1p00Vew; 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]:46700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCzM6-0006X8-H5 for patch@linaro.org; Thu, 27 Jan 2022 02:38:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCyMz-00046W-JK for qemu-devel@nongnu.org; Thu, 27 Jan 2022 01:35:01 -0500 Received: from [2607:f8b0:4864:20::1033] (port=39636 helo=mail-pj1-x1033.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCyMo-0005jF-By for qemu-devel@nongnu.org; Thu, 27 Jan 2022 01:34:57 -0500 Received: by mail-pj1-x1033.google.com with SMTP id s61-20020a17090a69c300b001b4d0427ea2so6576739pjj.4 for ; Wed, 26 Jan 2022 22:34:42 -0800 (PST) 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=HwDFJsijN3KKV3amxkEWOLWADJe1maxxFGeKyIOR3PU=; b=V1p00VeweS5Uc25Ad+3Wyy6haEL+ELgetSOoQ/vE2U+hHCGLkfqgzl2yyRm0Olhanv tqeqpX8ykPgUYBzmTZAGheH2iwFgcCqSoBubwOu45eys0c5G48Gr54hVq8tRBbWGZu2u Z1zew06GdwO+Gfjx/ct2gtLeXGp9jwkTWEowqW6UdqIpd/oMj8+J+qbQaWHu35VTV7k/ 2PdQDx5YKzzvdpBWKTBi32Dl3A3YS0TTCQxKHw8ywryLKVy6rrvBs4KVt5g5efe8zDTr P9FSwLuvB2/CYMCRPsgb111fJkcFN6Kbos+jNuW4YekdO/VP+QKDhkd8z/m5Hgxnc+SD yBrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HwDFJsijN3KKV3amxkEWOLWADJe1maxxFGeKyIOR3PU=; b=sWS2goHXz5fHtmcJs6o7rxLofQ/wTY0Uy+u5nyGjfha8xmMIkQPl7jB6iL3Z8fvoIi fzCSvZdkkBzSZzOPa6o/W5eGjh01x1gKmrSQDTwd/jG4uA+Ir/WJYI75Lv4d9+oAh3rh 6s+lDSFhFIFB0HImrke4BT+sZcB8W5RKmkvJuXmIk8+RQS6XyeHnqrlx6jxeK/rINWSt +GbGdyBfg6eVotwSrd0JvQAvBaVYSV3CpBzq4DTFxjwwQ7XJ37nMvg+N3Eqrq0bMSnd3 9xvaX/ganOPf1PcWRfYwOLTWJXnh647EtwoVqy5aUznBPF0ijI8fpTanG8Lzamli4XFQ rtyg== X-Gm-Message-State: AOAM533PBADZu7rbJVhSgUtVkt3XX9H+9bfUEwB948Bj5Loh0HZfKZ83 HykatyZkgzuxgMzveGizus2kiVpVrsNEnOQY X-Received: by 2002:a17:90b:1b52:: with SMTP id nv18mr3718066pjb.136.1643265281039; Wed, 26 Jan 2022 22:34:41 -0800 (PST) Received: from localhost.localdomain (alanje.lnk.telstra.net. [120.151.179.201]) by smtp.gmail.com with ESMTPSA id y20sm4231855pfi.78.2022.01.26.22.34.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 22:34:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/4] target/arm: Fix {fp, sve}_exception_el for VHE mode running Date: Thu, 27 Jan 2022 17:34:27 +1100 Message-Id: <20220127063428.30212-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127063428.30212-1-richard.henderson@linaro.org> References: <20220127063428.30212-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1033 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yuzenghui@huawei.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When HCR_EL2.E2H is set, the format of CPTR_EL2 changes to look more like CPACR_EL1, with ZEN and FPEN fields instead of TZ and TFP fields. Reported-by: Zenghui Yu Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/helper.c | 77 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 17 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index cd48560786..ca916139e8 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6180,15 +6180,41 @@ int sve_exception_el(CPUARMState *env, int el) } } - /* CPTR_EL2. Since TZ and TFP are positive, - * they will be zero when EL2 is not present. + /* + * CPTR_EL2 changes format with HCR_EL2.E2H (regardless of TGE). */ - if (el <= 2 && arm_is_el2_enabled(env)) { - if (env->cp15.cptr_el[2] & CPTR_TZ) { - return 2; - } - if (env->cp15.cptr_el[2] & CPTR_TFP) { - return 0; + if (el <= 2) { + if (hcr_el2 & HCR_E2H) { + /* Check CPTR_EL2.ZEN. */ + switch (extract32(env->cp15.cptr_el[2], 16, 2)) { + case 1: + if (el != 0 || !(hcr_el2 & HCR_TGE)) { + break; + } + /* fall through */ + case 0: + case 2: + return 2; + } + + /* Check CPTR_EL2.FPEN. */ + switch (extract32(env->cp15.cptr_el[2], 20, 2)) { + case 1: + if (el == 2 || !(hcr_el2 & HCR_TGE)) { + break; + } + /* fall through */ + case 0: + case 2: + return 0; + } + } else if (arm_is_el2_enabled(env)) { + if (env->cp15.cptr_el[2] & CPTR_TZ) { + return 2; + } + if (env->cp15.cptr_el[2] & CPTR_TFP) { + return 0; + } } } @@ -12909,6 +12935,8 @@ uint32_t HELPER(crc32c)(uint32_t acc, uint32_t val, uint32_t bytes) int fp_exception_el(CPUARMState *env, int cur_el) { #ifndef CONFIG_USER_ONLY + uint64_t hcr_el2; + /* CPACR and the CPTR registers don't exist before v6, so FP is * always accessible */ @@ -12932,13 +12960,15 @@ int fp_exception_el(CPUARMState *env, int cur_el) return 0; } + hcr_el2 = arm_hcr_el2_eff(env); + /* The CPACR controls traps to EL1, or PL1 if we're 32 bit: * 0, 2 : trap EL0 and EL1/PL1 accesses * 1 : trap only EL0 accesses * 3 : trap no accesses * This register is ignored if E2H+TGE are both set. */ - if ((arm_hcr_el2_eff(env) & (HCR_E2H | HCR_TGE)) != (HCR_E2H | HCR_TGE)) { + if ((hcr_el2 & (HCR_E2H | HCR_TGE)) != (HCR_E2H | HCR_TGE)) { int fpen = extract32(env->cp15.cpacr_el1, 20, 2); switch (fpen) { @@ -12979,15 +13009,28 @@ int fp_exception_el(CPUARMState *env, int cur_el) } } - /* For the CPTR registers we don't need to guard with an ARM_FEATURE - * check because zero bits in the registers mean "don't trap". + /* + * CPTR_EL2 is present in v7VE or v8, and changes format + * with HCR_EL2.E2H (regardless of TGE). */ - - /* CPTR_EL2 : present in v7VE or v8 */ - if (cur_el <= 2 && extract32(env->cp15.cptr_el[2], 10, 1) - && arm_is_el2_enabled(env)) { - /* Trap FP ops at EL2, NS-EL1 or NS-EL0 to EL2 */ - return 2; + if (cur_el <= 2) { + if (hcr_el2 & HCR_E2H) { + /* Check CPTR_EL2.FPEN. */ + switch (extract32(env->cp15.cptr_el[2], 20, 2)) { + case 1: + if (cur_el != 0 || !(hcr_el2 & HCR_TGE)) { + break; + } + /* fall through */ + case 0: + case 2: + return 2; + } + } else if (arm_is_el2_enabled(env)) { + if (env->cp15.cptr_el[2] & CPTR_TFP) { + return 2; + } + } } /* CPTR_EL3 : present in v8 */ From patchwork Thu Jan 27 06:34:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 537092 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp5177608imr; Wed, 26 Jan 2022 23:27:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzurjVEQTGPxGuEIH56iPL2s9Y2BqgqOVun3+VYEUPmou3Zolg6W3XA/BzAPsUxQHvzkG0X X-Received: by 2002:a05:620a:17a0:: with SMTP id ay32mr1658960qkb.426.1643268449009; Wed, 26 Jan 2022 23:27:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643268449; cv=none; d=google.com; s=arc-20160816; b=LkBgHLSUFi6/xqAFRtCUjb6MFTJ7nIBBuZULicUnKpn4Qbpn7MIJJq8TEz40LTrgac uqLamPtG7/NEXHg1nwdFv/3EZwb5GiUjRBtKxW9GfNXgOZ2Vba9Sunm5ikUrAjLocfbH 5ZuUQ87wEWJGMWkNP7v6sjPyODDcz5lF8MJ8p9l+Wnss1+4e1uv+opnve+eVpYQd35vS GeeT+Q5I6XN4Hu6u4KWxybzQXA21uoSztHAPWti6bKqVIRKeSlHuwY4hiNO7Cypvqdgz r4awT1aHf3gkphlibniR9tgbDoCRlGyEy16ATgKEcoGCfBzDHhad5XXFKX1uNXNQu2Wh 2FLw== 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=JU8yAS18Zn8UE6eQ0birh8Z76witKI8Q/wDr72MGSnc=; b=FQipOhlDNTjv9bjdSnggeWEM85rKWAWX7mJyaX7urrMABCU+yMJ/5LWBK9AkPah26u eVUQXgIetD/GPQiXqPxr8ggMJSOm0KIKZVJ2PX/TYcZzL1jsVArBMr4TOUl1WJ9duI/E NSPCzWxmiewtjNiMSaPpnShg/4MhWodciCaUZcml4Fli9ustdCcLSQbePJIKtz34a/iS jCg97XNpHABSynj1DyxD2PbfHeh7ScDc9eZ4FGjg/tiNJBjJSLVT6MntKDJXqZPJZnw1 VT9O0WhUiGS/XZYvrX8jNnA5TTlx6jOtXWJgw1VFVy84yeVIgCj+WscQezNJiM2f1b3M WuBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eYkUEFBK; 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 u21si1058031qtc.780.2022.01.26.23.27.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Jan 2022 23:27:28 -0800 (PST) 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=eYkUEFBK; 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]:39758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCzBo-0001O4-I9 for patch@linaro.org; Thu, 27 Jan 2022 02:27:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCyN0-00046X-Ih for qemu-devel@nongnu.org; Thu, 27 Jan 2022 01:35:01 -0500 Received: from [2607:f8b0:4864:20::530] (port=46873 helo=mail-pg1-x530.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nCyMt-0005jV-OJ for qemu-devel@nongnu.org; Thu, 27 Jan 2022 01:34:58 -0500 Received: by mail-pg1-x530.google.com with SMTP id s16so1355349pgs.13 for ; Wed, 26 Jan 2022 22:34:44 -0800 (PST) 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=JU8yAS18Zn8UE6eQ0birh8Z76witKI8Q/wDr72MGSnc=; b=eYkUEFBKjjlKEVHDUtsYLfpArcC4einqAF8n6EINI5zI+s0lHfF+Jk64CneThSUa5Y G0WbTDCpAVxlgQ4/izbPAu7Jvl8mFu6oauaF8W3R+ujx1+OabMGYDqAKvsKK3CksoEgM DATuJOLfTuFpZeaWoMWypFRUSW8c9n6FSkwwJIPwTOKYwy0zWu6frARq3fIfhtu1ce+g 0/eKDFRrQ/ez+2uIcTbBqfwl4K3qtBBM4GMmnsAfEhg/YpoMTWsETPnA/eFIgrv27ZOx 0J119hVLFVaaHP9/j8TA7OecZFRNggTv2rST8Ob5OcGwnhfnOUvlqOw4LrBzbr7jMPj0 mmYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JU8yAS18Zn8UE6eQ0birh8Z76witKI8Q/wDr72MGSnc=; b=LWLR1dttHzUVmIWVEeNQbP2SL9uDcoRfbsiMmTqq/jHeMVwI+fnh2WmsDj8w6BZ1aY aJ9K4SypgKz1WRRSP7Spg0VwR8Ej93Lc8RNSrJHWKC4rx/XLYPcIRRAzmgH1F8yaYLaL 55P9NL66ODUtUUslA4LNOa2TY5JJSWHTiyyjDWx5qHNP5vK3LcDUIYYOFurOuzwe5s52 4x9opZB46dJtE+QiWU4Rclop8BpyJ2/FmBG5DGFZm6BX8MlTfv7QsKJxglIcKqvt3Ids pWXI7+e9VZwxa1bbv60eQTgF8n3sLnu9Ks6cwCWW0on+RnzwPNm9Ca8rzGTCgJJzLidT inXQ== X-Gm-Message-State: AOAM532ziV7YsVhhcwKY5q0tb2TmUrHTuRgZn8ghAiq5bdJ+66hch8g2 OdE7q9erIHjN2sokvDIv+ZGchxXFhxzGox74 X-Received: by 2002:a63:690:: with SMTP id 138mr1794210pgg.364.1643265283401; Wed, 26 Jan 2022 22:34:43 -0800 (PST) Received: from localhost.localdomain (alanje.lnk.telstra.net. [120.151.179.201]) by smtp.gmail.com with ESMTPSA id y20sm4231855pfi.78.2022.01.26.22.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 22:34:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/4] target/arm: Use CPTR_TFP with CPTR_EL3 in fp_exception_el Date: Thu, 27 Jan 2022 17:34:28 +1100 Message-Id: <20220127063428.30212-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127063428.30212-1-richard.henderson@linaro.org> References: <20220127063428.30212-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::530 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yuzenghui@huawei.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use the named bit rather than a bare extract32. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell Reviewed-by: Zenghui Yu --- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index ca916139e8..5610879680 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -13034,7 +13034,7 @@ int fp_exception_el(CPUARMState *env, int cur_el) } /* CPTR_EL3 : present in v8 */ - if (extract32(env->cp15.cptr_el[3], 10, 1)) { + if (env->cp15.cptr_el[3] & CPTR_TFP) { /* Trap all FP ops to EL3 */ return 3; }