From patchwork Tue Feb 13 15:32:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 200498 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp624546dyb; Tue, 13 Feb 2024 07:46:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU5LqL+PpJOcDxX8zZLgm7UQWjAgc99+7lUd4sdLumFuPSp1owSWzb9rOhOUhWsNSlD6rph+g7RpjW6GLSxCeYA8QFfVw== X-Google-Smtp-Source: AGHT+IGufzDfmwGSllhREIMRyycKHMB/lBEZA2Sq2AadTyd1MWzgs1h57bjuWjzBQ7UoAsEyYpWk X-Received: by 2002:a05:6402:1352:b0:562:b2:2165 with SMTP id y18-20020a056402135200b0056200b22165mr45212edw.6.1707839212137; Tue, 13 Feb 2024 07:46:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707839212; cv=pass; d=google.com; s=arc-20160816; b=qXlvoLHVJMmzOyd63SftyVQWsJNIasflH/97Z6HF6eQGhMqEE7zoJpEeRYGsb0SmVN UC6knay+lfoV0kcf/CZ+D0IdBaCFUPEcnhSDYgO/6tB1Rhben0d0eM3lGYWFR9Nh8EIy RXYAzMWAQKzl0lC1OanYDcU/A8X9ZRfgxtHJVgZ+HTxKwC4a3iWru9R7cBSxM/XN1094 C/XsDzx4JZj/Vzey/azei1e4A1V/xwVdzn+J+BfEMZd1002oZUFoGvvlTgb9vWHtP+Bw PxIbRQn6rM4j0HWEDdVTMzgLJALxXuGSPeE+3JjLEX6krXi242ubwFiTp9argphXc5Ii D16A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=N1dVOB++ua4tNiADTC0ZCNiYV5zQAcNXPwTsPyQt/a8=; fh=EpbbTwxUnHbZ51FFLeA3RsSXyF2fmEcIAcf9m6OKAco=; b=w3FaRW99HTuJzy7H70CQ5T+bAWrnbNWXaW+mfjmYtGey6jkR4e+fwMd7psqx6BW0W4 6p9mAe9kyGMqNpYcFqufHdesER58x6eWimX4uVjP1FHV/J2vml+4ZPtNjzwhyWuHhM41 666xyCLHqjr/1ZZT90vKG5FejwwnWLz5ofA/aL2LIwcyukxxuOOgYXmbRpaHqg/ckQ6u z6wkVWXJGlzjMjB8Mvxa5OEGBMS0ungCQwjCWPglVpnktOPGtnB51A4eb6aqPdVcIdpH Ni1Y0TKC5PN2ronfNJetwhXoxeLVqXhcM2qvKLhIfFjXNQGcdmJT3vU5MtuanUjb3Yq8 MK3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kd/9uVyy"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63811-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63811-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWo26NptE6coW5r6KDfUtKGaT+jKH1FWBrj2N7M2NcrkTO3vo5RZCxpJFWaSPXFXrJySt+vvoxKgOazoFdAZEwpJRjeqA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w21-20020aa7dcd5000000b00562165e160fsi62186edu.659.2024.02.13.07.46.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 07:46:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63811-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kd/9uVyy"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63811-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63811-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B81401F2525C for ; Tue, 13 Feb 2024 15:36:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9EE8C5F494; Tue, 13 Feb 2024 15:35:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kd/9uVyy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 241265EE79 for ; Tue, 13 Feb 2024 15:35:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707838553; cv=none; b=Mfyl/7JbSUq0TLqmPcYTxVij9ge/TbdjLCJf2tyR/rZ4BKupnjXikcdGGJy6To6vN/BCy7fOYb8Y610XNm5PlIDUGf3y/qPlsA7SQmQB9J151DThRSQgK5U/4CZYGfDYBfmn63MzjQCsVrNLudlGzhkJSoFFiTSOyGkMEPO2BkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707838553; c=relaxed/simple; bh=SUBjxkuKBtRVkvGx34gf818xvgGWgaa/xPYwJFrPRlM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BsKRcHFi7/pkqrHlBciCjumtqavlr4eLFiDXMXE+DMlztzLQTYnK0q9BNzd6+im7H72uFF2DZ0G7Ykbcq9ufn3X9wMJdiW2mZHVbs4u6HwY2DwC6SjU5SGnaMaqXxhC9rftSe8MhdjuyCL8zOGNEGkGVpGZRUTU4PaQzoKoRe+k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kd/9uVyy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 752ABC43399; Tue, 13 Feb 2024 15:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707838552; bh=SUBjxkuKBtRVkvGx34gf818xvgGWgaa/xPYwJFrPRlM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kd/9uVyyIJb5NAJl3o+ZexzNZwJkGOgxeNr2DwrbbuSFfxBuBBnCxfWzrjldxs9b5 fwoK01VQpIJun/p1nejaIMQcLSttc9fgvDlVuV/NPQl/KSsvv2FzNeTHNcOlUmsu3Y +Fg7t9vX/9ybXMMoKbL0ieHkQ7oxJXKE8GF8yM5SXgG8OXZj40nt6U+yttDzgbwFnW HdW4QpVJJrkvZnvRzhaax76ZQIvTjey69jbug2hzpf4sTWczabdocO6Coir8nYd3VI CZzDNzcXpa6G2PhiMPQrcVxw4hvuOv9zrMXvZkwoInPY08oGsds4vA+9mOIVPR4zUO ROIhKq36K23Bw== From: Mark Brown Date: Tue, 13 Feb 2024 15:32:45 +0000 Subject: [PATCH 1/2] arm64/sve: Ensure that all fields in ZCR_EL1 are set to known values Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240213-arm64-fp-init-vec-cr-v1-1-7e7c2d584f26@kernel.org> References: <20240213-arm64-fp-init-vec-cr-v1-0-7e7c2d584f26@kernel.org> In-Reply-To: <20240213-arm64-fp-init-vec-cr-v1-0-7e7c2d584f26@kernel.org> To: Catalin Marinas , Will Deacon Cc: Dave Martin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailer: b4 0.13-dev-a684c X-Developer-Signature: v=1; a=openpgp-sha256; l=849; i=broonie@kernel.org; h=from:subject:message-id; bh=SUBjxkuKBtRVkvGx34gf818xvgGWgaa/xPYwJFrPRlM=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBly4xU8jE97v/JDxRmvJyueiHa2XfsWKq9Yvi56jLQ ptOViZWJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZcuMVAAKCRAk1otyXVSH0DflB/ 9VepOmmsuiVYGDQF13XF2tE56zYQ7dQMtVpBtyjZDXvgXXEI1IA/BeL4nUYq2sfeXiSzMyFFybqImD Gv6EgNRRqoAs1xXNH9TBCJMYZxLx11YF0apQqr8+VRyOCfl8eF99DhSRV+Im5cG/puiNysDr6j0XKi fNxRSdbsfh/y+1upsRPPRWLTOXqCSqDuDkhZz6ZlVpKOUG7zyabwO9v9gMbfSFwbNZUlxjqAXveva/ duOjOXx1Gjr1RcKcSAcQiMOzXb6hHrSU/cDyAtr7ZvowCzXfLiDc5knyWP+ysnEf79QWOfcbw4oVRl H9ox2a/OjlARoFxcgBJ9SVPJ8gVpLr X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790799210044550486 X-GMAIL-MSGID: 1790799210044550486 At present nothing in our CPU initialisation code ever sets unknown fields in ZCR_EL1 to known values, all updates to ZCR_EL1 are read/modify/write sequences for LEN. All the unknown fields are RES0, explicitly initialise them as such to avoid future surprises. Signed-off-by: Mark Brown --- arch/arm64/kernel/fpsimd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index a5dc6f764195..cc3c9ad877a8 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1134,6 +1134,8 @@ void cpu_enable_sve(const struct arm64_cpu_capabilities *__always_unused p) { write_sysreg(read_sysreg(CPACR_EL1) | CPACR_EL1_ZEN_EL1EN, CPACR_EL1); isb(); + + write_sysreg_s(0, SYS_ZCR_EL1); } void __init sve_setup(void)