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) From patchwork Tue Feb 13 15:32:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 200499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp624625dyb; Tue, 13 Feb 2024 07:47:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWaZVGWJpfDcu6PX3s3NEyeU1wU2VSxWyXfvhPdsMrCF+CnBXudSCIo4F1B7ebuC7zyWIFFPZ+ec2+cTudPfic+T0jQqA== X-Google-Smtp-Source: AGHT+IHndsNK/eRF6HkDGg4UOdpJzqDEUVtN4es4tHXwDk7xuKVch5fve4lrbpbExndoFMuE6+xy X-Received: by 2002:a17:906:4688:b0:a3d:2146:5703 with SMTP id a8-20020a170906468800b00a3d21465703mr499557ejr.6.1707839224350; Tue, 13 Feb 2024 07:47:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707839224; cv=pass; d=google.com; s=arc-20160816; b=TXGCDbMO+xTO0NFHW2Yp+3dC/Mte2u3suEvzeD9pX/WaTGWWMIaPBGgFTDKbHrxx3p 27WrNSOH+rjj1HruryhljeSVAL/mPHQOmFOSwryKKXrGGnJ2/ehpCc1PtJTunsm3h7Pr bK1yH2AvAlGEUiDVtzsCphQKiymJbj/yXWFMgzNNRyfzL0mo/tEPniHCykic8M6E41c0 Bg0glF44exfp3dx1q2cA6OCX41F7IzEKa2DVJmdm9LSY23k13i006rRzdbofrc8/h8l6 on2Ug/yv0D19+QMoZT4QaABmooUmmVlGqPQR7j9fGin3sD6l6dZFfjkVV3rzRCC/Vp6x K8pA== 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=ffCN8yCnDUSbozFthrfvqJHMyKLtgP5xk6pxVi86YcY=; fh=oquJAeWXUG8WhDPcjGiKZ7u3gBcNg+XFEO5wLDnlI4g=; b=02+EzqjHQHA+Qw+oRIq5ceLybuKPm2aPvpgz2/pup4jtMuUcD5royqaIOKZENzCeem VOcb2qFYTIE+xqQ3JIiijaGGjW1ynzOZwpqhNnzC6Sn1wgWrOgD2mIWkibxDEJwZjcVj afPOf+6oGa9zMtdg3qXeNo7Tu/BsnCVxQQ96GY7PSYFwHiGuxiRS0IneHjIuKlaQVMxw cYZUXYi4xUYYbh8st7H3Z6ffhw45Ij0Zfdoy0r5KiFtPhPbqiDPLkFw4eSd7L8RHKFFY /SrUpnYr8UVNJHe3CNATWGnGX4LjCa4ihNCKtois61dVcRVoa99lG6+hhnwdAOq9tv2g ZeYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z0CcMPpP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63812-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63812-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXbHFtTRMChOnc/kejgVYvx4dJKoCt88uwmLu+tN3aBq249yqEgMX3dT5Wgf92wcUsgg/ukJ1FFvoc6PgvodVvS98mG1Q== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y15-20020a17090629cf00b00a3d003fd328si778758eje.938.2024.02.13.07.47.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 07:47:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63812-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=Z0CcMPpP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63812-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63812-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 9AC2F1F272BB for ; Tue, 13 Feb 2024 15:36:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 421A25F577; Tue, 13 Feb 2024 15:35:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z0CcMPpP" 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 BFE565F467 for ; Tue, 13 Feb 2024 15:35:54 +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=1707838554; cv=none; b=frRvFGJb7JATspCK7S3z2J/WgleJ8wHnK4K4FVabqTIxR/jKCjYr9wXEIW7V3dVySdLUTgIsu3bldf7lMZXIhGdy8Mep2OBT+D2df9cROjxaubJOgTLwNwdGG2ZZHu5EPdBFVef7bZ7xUF6nG+QiRqHtR0Mwbd6Rq+EnMdgFhtk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707838554; c=relaxed/simple; bh=3QP5xdQgCtutqWVSSb21JK6+dtuADu8WvFbwQO2EMwE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CqI61iJgjkcmn9DjAqkGcLhSDk9OPBeZHy5nZgXtufVPoMP7EW9TS26K/EuCE/lqPNLnFOVYSzVThX9AyX6bYXzoRPmr5HJoKqPadjPhiLBgn1s47kdFezXoiz9nLlMsYq3dj3LCC4IRyzhdS7ccXuLTpzqlNc2sQQyFTMj5T7k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z0CcMPpP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C3C0C433F1; Tue, 13 Feb 2024 15:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707838554; bh=3QP5xdQgCtutqWVSSb21JK6+dtuADu8WvFbwQO2EMwE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Z0CcMPpPKSEqSEkrJ8GWhfqOB59+LE1ZCYDCIWlQUQxGvnHCc5UcuvW7hTvKzjEct VVzNQLvxGHww6+0O28Vk2HqP7LwI8R4iEkLpIOJMm/yhR5IthxW5z8DUGPMUVBzB/S ngXi/4fauKql39WahyPOmof613fXlhQ0Vz0KPKa3tgD4ySdLvBinkNQqbzlB2UYQqB BSuzgpuO6zhhfWmNUyNIAlJ6WiY/gBK44cFnBmKsHsArls4n+GeFanY0QnH9BLIQEQ ZIFOjlouV0DmK1Pd6T4XyzfVRQdtykc1GjSXvelON6WCVhaym3binh+CYHKuEXVeJl Kd/5CjcsEwvRQ== From: Mark Brown Date: Tue, 13 Feb 2024 15:32:46 +0000 Subject: [PATCH 2/2] arm64/sme: Ensure that all fields in SMCR_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-2-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=981; i=broonie@kernel.org; h=from:subject:message-id; bh=3QP5xdQgCtutqWVSSb21JK6+dtuADu8WvFbwQO2EMwE=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBly4xUA3rs0ghZm22tJlDf7DiTmlghGGgzwk5+CB7+ o8iscR+JATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZcuMVAAKCRAk1otyXVSH0A3DB/ 4nCFlJDvs+F0CTlMKwubqM8n+bW2BzQNqbAeq+wTMLRi7W6b6FyPofh0STmmfdePtpS4d1Y4jR16Ce 21nbI1rJfcnJhj0i4VofrhgfcYjvkEVXRJc6GTDWMOgpZj1pOno/HCUbKHZz+icpqMXuqlMRTQu+lg zM+sA2yJpndyJRBtrXYShEiYLdo+tS4Xo+yQgGdXBuf/dN+cUTYRNAHwQxEsK/BHPb9A5UlcF3ApCR XK6RyI+8Z4gRKs0dggA8u6rSIdt4fQjzG+qh0xkn1b7uwrkTP2uJgG0RnZRgehnrNx0gzdlTZVrQeh 8WLSDDH8meCJ2fQkPPMkavpklqjWbA X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790799222157779456 X-GMAIL-MSGID: 1790799222157779456 At present nothing in our CPU initialisation code ever sets unknown fields in SMCR_EL1 to known values, all updates to SMCR_EL1 are read/modify/write sequences. 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index cc3c9ad877a8..f96907b813fa 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1247,6 +1247,9 @@ void cpu_enable_sme(const struct arm64_cpu_capabilities *__always_unused p) write_sysreg(read_sysreg(CPACR_EL1) | CPACR_EL1_SMEN_EL1EN, CPACR_EL1); isb(); + /* Ensure all bits in SMCR are set to known values */ + write_sysreg_s(0, SYS_SMCR_EL1); + /* Allow EL0 to access TPIDR2 */ write_sysreg(read_sysreg(SCTLR_EL1) | SCTLR_ELx_ENTP2, SCTLR_EL1); isb();