From nobody Sun May 19 04:55:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1562065298; cv=none; d=zoho.com; s=zohoarc; b=NEYJr9ch6pRYAi97NPS18zqvvt+sNlfgmqjbhSjqFF+KXlgrwGIAOy9UMVUwMtLyDKzbANRKDD84NR0nthUj1wMFghEwDDueUQSAZQ6SFJTm5aTIEmtQI3pkJKKCgE1WBRAicXz10F1eC1rdkBSn2jhgUPBeOng3CnWwSqzgsMo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562065298; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=dFW5jDXd47eVSqWLVl3XFZrae6CQN8W7M3/mFqL/1BQ=; b=X//xdDWTHUvNUUL7NC11lcD6PjfnIDkV7rbU6ZGIFbOGWc2cI67pZyACmyuXCYkeiS0xgRDI7mO/Fw4shRCaF9r5/g/ltbIKu6VDJMb8r7VE33Vz5jHVNKUgfmy8Q3Y2pQ82HFRQpla7BphWUOVGez3ST+9dyti0ALKVZ6VTIrE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1562065297981564.3110189766664; Tue, 2 Jul 2019 04:01:37 -0700 (PDT) Received: from localhost ([::1]:51616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiGXV-0002KX-J3 for importer@patchew.org; Tue, 02 Jul 2019 07:01:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51131) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiGKH-0005zu-5W for qemu-devel@nongnu.org; Tue, 02 Jul 2019 06:47:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiGKG-0008Ve-48 for qemu-devel@nongnu.org; Tue, 02 Jul 2019 06:47:53 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:34691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hiGKF-00081H-O6 for qemu-devel@nongnu.org; Tue, 02 Jul 2019 06:47:52 -0400 Received: by mail-wr1-x444.google.com with SMTP id u18so710075wru.1 for ; Tue, 02 Jul 2019 03:47:35 -0700 (PDT) Received: from localhost.localdomain (93-34-153-63.ip50.fastwebnet.it. [93.34.153.63]) by smtp.gmail.com with ESMTPSA id f7sm16460138wrv.38.2019.07.02.03.47.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 03:47:33 -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; bh=dFW5jDXd47eVSqWLVl3XFZrae6CQN8W7M3/mFqL/1BQ=; b=RNuTbdqRYnqxHkpVXF+a4IgBnoP7Dk/E0esPNj1XgmnlHR2ZaFxt/VFh36jBxQXWKb nrgn8Zgo8y7vNbjHTZo6AtYUvO2b6NCdzUKDbY/lK1C8pRbqgRGmP+BUtwwgNpNPWivs xY0uiyEUSifY/IOYs/MBJ3/qzFvCeqjPEYqvHZkaT2qa/ghh2t35b2WIptUJjCVBJMT/ mqa3LN6JNqVjULiG80SsNMQ6MFJSnZOiv3084KH0hWYvKV5g7BSyRh3+GeiNbgXtrgKS fnO7wAwBLbytf/Hc+oLtBh88oJ4RlX8WsMNXos4MK0cj2mi9zpOJCOppFQdYWAI78d/b uVnA== 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; bh=dFW5jDXd47eVSqWLVl3XFZrae6CQN8W7M3/mFqL/1BQ=; b=hcRzQ8LxNmcaKC8PuEKfK66dlhaVWjcYDZgmGqh7YMMlnQ9TbRxSImgYdCX34d+dAx N04hxCBcqH60Iam2BB7TM2SSRRhEykDIdSTnvHwtBh3fdKVK68gwQbdheien7f5qwus7 aKNFaiDWkRc3/6n74e4by/A4ooAR5RiZ8Lg3eH8lj6LcIv0lmQ9P3FwsyirOSOQo2Ra0 dyMi3Z3rZHZWSCl9ylDZEZK2kcDJvKC9DF33RxpILE89rwgTUrPms7NKnYSjo/8lgRfR 8rvVO5QFbvrNGerlQ8XrGgIRJE3PCCOy1hYfc1lCQ/iKFox5na7PkRT2cHuFbvrWrl+i Wybw== X-Gm-Message-State: APjAAAVjgpaLAEj/HFYTWRmmfLcCtwFUhJbqAQQA4PrcXFt88WgABMNG D50bJ74L9K992XmoGGZrnfCJs2f5szW1eg== X-Google-Smtp-Source: APXvYqyx4883bHkDua9NksEdabG+NP2IL4XKvNp3QkORzM7+RoTBhrDMPqQ8i6fQTP9/sDpG/wlbBg== X-Received: by 2002:a5d:4a46:: with SMTP id v6mr22952767wrs.105.1562064454008; Tue, 02 Jul 2019 03:47:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 2 Jul 2019 12:47:32 +0200 Message-Id: <20190702104732.31154-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 Subject: [Qemu-devel] [PATCH for-4.1] target/arm: Fix sve_zcr_len_for_el 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 Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Off by one error in the EL2 and EL3 tests. Remove the test against EL3 entirely, since it must always be true. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- This bug resulted in an infinite loop in the kernel's initialization of SVE with EL2 and VHE enabled. It's probably worth including in 4.1, even though VHE itself won't be included. r~ --- target/arm/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index b87bf903a1..210fa06188 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5570,10 +5570,10 @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int e= l) if (el <=3D 1) { zcr_len =3D MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[1]); } - if (el < 2 && arm_feature(env, ARM_FEATURE_EL2)) { + if (el <=3D 2 && arm_feature(env, ARM_FEATURE_EL2)) { zcr_len =3D MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[2]); } - if (el < 3 && arm_feature(env, ARM_FEATURE_EL3)) { + if (arm_feature(env, ARM_FEATURE_EL3)) { zcr_len =3D MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[3]); } return zcr_len; --=20 2.17.1