From patchwork Tue Feb 13 23:06:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 200735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp872483dyb; Tue, 13 Feb 2024 15:38:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVZ+Q3BYl06fxkIqStx12hKeH4dcU4Ty4Gzl0FZbftZHrFHkC86bq8TqQpcy3hq90p4rC5izN/XkIiHw5/s4oflWVfEkA== X-Google-Smtp-Source: AGHT+IF6szP7psvGDt9jIUvt+f8hreqE7Qn7pjssUiCI0WfsKPhGmuGYqI+ocE0gyKp36AxBtKVF X-Received: by 2002:a05:6a00:2daa:b0:6e0:6c89:e308 with SMTP id fb42-20020a056a002daa00b006e06c89e308mr785265pfb.3.1707867489940; Tue, 13 Feb 2024 15:38:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707867489; cv=pass; d=google.com; s=arc-20160816; b=cRt1rbTcnoVj0fZGb7HnAfUOPFhUIW+0I+apt3luRb5y859f2xXfwfIQVRhLNu2DNn l3WqD5SJzzrADLzrk+JB7z/8QwV0pQ7uP9Zoib+gAO3eGYKFk0WQ41cCDiI2YlPcryjO tYgk85bnrkKJ0GjnIu3iPasOPz/H9LuQF+wqzQUzhXiA9EXV55VYVDTBLU0rhEkWlEnR OplW4XTCChnj1rz3980PXArTUlcC3DK6/gOBt0zvjW7j29ZH5hkEnGHHhlx3xANTTw/S pAbdXwDdfo790+94ShUGQP4aNNfakWHto4oU8uCrxzCyknTD1pQznzZLIoM02Jwy1/wx SFig== 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=I3EuBAqhoVY3arqxnqkAhPRPYi1UKYqs4tDEnjae4W0=; fh=rvy4n2J7CQvr8uAoyWFklZLG3ce3Zq8THza+MTAJGsY=; b=R9Nis2mjldp7Q2syCXzF1cAvLZP9xlBH5GQ61ZzhupIwEh6Mz6vnuNg9D/euuY18xx TLudfK/M5VST4iEPq3KIno8thcwJKcRbDPGFLpYCjtheo4QnKd9ef1oWWPYLTb97vm0D rT67XUblaVR3Mx8WJNHwx0fdKwE1OLxoDuse3qEY/0BzY/s5hdSndNxOlJGTmAp96V7F +Jwq6+cQVyVXE40ppV79KBlw7eEhPEA7BwxLkz+SMYzeiNWybE05xUW5k8ByKvBBlBcO zKWet16M1RmK6OL4mvNRbtQkKhb95HPP3Zw4mOiHaQ2jo+CstWH/IurG8qhdRBlv3hmk rkhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hAJ8LHag; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64507-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64507-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCUgCvkuIslICx+H7/9F+fDJbfi2kaGevnOkIrwXUXwaH/clmM0Vbu4SaSEPxlv9ZsZLjPGwTaOd1TB3dcXVpRRFpcwReg== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id p21-20020a637415000000b005dc528d603bsi2623345pgc.675.2024.02.13.15.38.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 15:38:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64507-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hAJ8LHag; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-64507-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64507-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7509FB236A2 for ; Tue, 13 Feb 2024 23:08:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB5A9634FA; Tue, 13 Feb 2024 23:07:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hAJ8LHag" 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 44CDB633E9 for ; Tue, 13 Feb 2024 23:07:17 +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=1707865638; cv=none; b=oZ48Ja3Dkav+Qhyx0cV/38KCkBczeLC/gRnfsU4o1NwhqpYL+aHqIeF1JC4dgseohOysJriTfJMF19PrdCnEtNW6ejmGTOu9ga+7B7tkWsVTSkBVDsTKfpF2thP5ofBVDr1OQplWZ3XgjB5RYv8vNDNUZX0Vd6WqFzzrSyVkGwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707865638; c=relaxed/simple; bh=EAbTSMPbYo7NkFe23hvp0C1Clui1JNxdOmENIj9lOq4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eyOlYLjqqxsstEnv/9LWjL3xh0Mecp+YYQbUPMDMXxgFgos+Tm/ziDnmfUrvJf3S1tKVsnbMKCvyBGj/fqyWwG0w+29oIBHpUgBrlfofTSKRBr+bdzE2vMol5bX7g8r1c+YN+uuYMjigKx1AKiTmlES2uuARFlJA7a+OW7tHVgs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hAJ8LHag; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61A2EC43399; Tue, 13 Feb 2024 23:07:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707865637; bh=EAbTSMPbYo7NkFe23hvp0C1Clui1JNxdOmENIj9lOq4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hAJ8LHaghvkkxiqweYcM+tjPbcoozyj5+8nI1gtLU/uVOCVrHD7A9LBc0o/34npev SK1vQzANlK3ndNgpc/RLlEWZi8l46QgqfgZAATTea1mP2gJWG7LpxoM9M/AQX/bZdh KU/1RK7GCoTOG17RZJl40JGHJO5ReH1kycxLs5ax9hg/0utXfaaJVgfLGDeu4/JX9K VsKAt4OVe3KZpNIG88AnBijgOFUlG0qECnDyIFqig/6TWlYOaQn2kOwM99tqWnQhic w7xb1AG+v4dSLu/NxhQMaqLNVVI1fDRdZrpcIbNVanXzZcSHdhHjbRSCVN92jJw5sX k4P3ED7ZIg1zA== From: Mark Brown Date: Tue, 13 Feb 2024 23:06:33 +0000 Subject: [PATCH v3 2/2] arm64/sme: Restore SMCR_EL1.EZT0 on exit from suspend Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240213-arm64-sme-resume-v3-2-17e05e493471@kernel.org> References: <20240213-arm64-sme-resume-v3-0-17e05e493471@kernel.org> In-Reply-To: <20240213-arm64-sme-resume-v3-0-17e05e493471@kernel.org> To: Catalin Marinas , Will Deacon Cc: Dave Martin , Jackson Cooper-Driver , 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=986; i=broonie@kernel.org; h=from:subject:message-id; bh=EAbTSMPbYo7NkFe23hvp0C1Clui1JNxdOmENIj9lOq4=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBly/Yf2kx5jbZv4Nhm4KK9MO6SBlZ5G5dJiR7zhNs8 y2ljCYqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZcv2HwAKCRAk1otyXVSH0OLCB/ wIv2Gm5BjBWurapN1ify5+sQprymBHlpMubMEOS4g3KPoR522jMOGZh3OxMw/l0X3TiSza46yYr7Cr OH5chMq2fJnNrbOsO/jsBLE2wiHdLCdI8AYmlBmKRVJijQU486QLCnKVckNHph9svDlQIx8GPzCp3N JeR3Q+L2salvs5LqJO2jnCsrC9iVQqPaU4nozI4eWcSvRkHWf+51QK7Viy8blrlXZP4irrh3XobJRI o9uwhnXaNwGPnd0V31PDawbO190djWiylohffo0Xba5PSGDus/4gvqmE+1OizjoTi1P7NN3GZoDZqa fVhSQTM57RcDXbF8TuKZo+6p03+e26 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790828860988870386 X-GMAIL-MSGID: 1790828860988870386 The fields in SMCR_EL1 reset to an architecturally UNKNOWN value. Since we do not otherwise manage the traps configured in this register at runtime we need to reconfigure them after a suspend in case nothing else was kind enough to preserve them for us. Do so for SMCR_EL1.EZT0. Fixes: d4913eee152d (arm64/sme: Add basic enumeration for SME2) Reported-by: Jackson Cooper-Driver 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 8d2a5824d5d3..7a7c056f0647 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1320,6 +1320,8 @@ void sme_suspend_exit(void) if (system_supports_fa64()) smcr |= SMCR_ELx_FA64; + if (system_supports_sme2()) + smcr |= SMCR_ELx_EZT0; write_sysreg_s(smcr, SYS_SMCR_EL1); write_sysreg_s(0, SYS_SMPRI_EL1);