Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1399915rdb; Sat, 3 Feb 2024 05:03:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5tvRY0KKbLehAy6WmhBRhX+i60gXqYfHxnuld9vIN2j9XLIS7FNSIb4mUpd1RXVFTXhu+ X-Received: by 2002:a92:ca8b:0:b0:363:b1ae:2977 with SMTP id t11-20020a92ca8b000000b00363b1ae2977mr5479343ilo.22.1706965423919; Sat, 03 Feb 2024 05:03:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706965423; cv=pass; d=google.com; s=arc-20160816; b=uTWLHDB7UWjDZqUt6Pp1SS5N4p1rt8/w0yFahXb2LzJnkxF2Fc9G6HPJB6A0AwUyjV u5NDTuRsszkf3NbMWjE/83GrP/oT839YEJBwY7a9zDBifF3FuYWtPxvIOE+2tsGIfPBT aGr3z8CJ2nArxEexvayl721ExbK5YRoNxSJrO3wyyA/qg42iKi9GeHGc8QZsielO+qO8 X8+0WwJeTPyBiMwLjb1sy0XRP4BZNs3FZgXO61i30ZLjlc/9k+ZS3Dw/Kl9bbA9rskIk k1QHe92fuSpeugx1MI5LAgc3fUQHFhpKE6Mm2u83H27hZkLKVYhFYF/+9ZvLbXKJJODG fXdg== 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=IwIVEjt26J9U/k7BiJEpF6+e316yGIxnhxA0S6au5iE=; b=FxPWU6Vs05AzGkUzwM+ot9MZFaPbd7OaJM/meHz22ilycQoKIoAoMMj5YyefGA7OK1 0d/9fGGm9fCM0ITsLWA8tESWCCqb4Lyi+XoWMrMCN7UlrSdKwDOiYIF/BTZCiDFut5tB F5jqcyNHo8dpKFE5uydlj18YxIpFxlCWRsZkEvafrWVnLEg8BePPFXQz4fKIHOwZmr6c zHcRuCK6jQxRuYYpOT9/JHLChwuVCLyLK+6bosvFgvKBoEAb6MmEOQAXzHLlibZyh9f3 wGVawcNxqdnbB1ljSN8ijzwtXEvb30MmYJjb6+S0I5arb56+VlJXmTZNMVRN+weVy7lU O7rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uZgat+VU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-51098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCW4Ttg67O98yswTCEH5ta2vnrbhb+c9kTeohgCBx7vuje2S4piNATNX0YNE6kFWdLG9dKbmcwNdzlUovRgAvBrzhCSzhKV/Zg8hhh3HdA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b23-20020a63d317000000b005dbf22da2c6si3295041pgg.61.2024.02.03.05.03.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 05:03:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uZgat+VU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-51098-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51098-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1BE0B289741 for ; Sat, 3 Feb 2024 13:02:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5F405EE9A; Sat, 3 Feb 2024 13:01:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uZgat+VU" 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 1A15F5EE8D for ; Sat, 3 Feb 2024 13:01:28 +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=1706965289; cv=none; b=hbZ57OCrcnzwxMJRiMdFxrV2rF6U+X7MKk/F4FeXBxrQOnsT/ORAtnxY2N4wQ0an578sN/YkUtZ432eCZREuGbhQNfpsnURYewWEue95d+kVTDPY0lWsWeP7lSER7jxdQgKU6xl5i9fqUoAb9nFFlCvrPSzrk4pm4hE8/y8WJNw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706965289; c=relaxed/simple; bh=EAbTSMPbYo7NkFe23hvp0C1Clui1JNxdOmENIj9lOq4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=E+awT27poWxCZyJwkFiZ3EcXa2VMVLwhqqNjalVAoDLqYb0n6PduQQgFjyTmI0SFLCF0/G/kkzi/huvH2v/ULWflYxzdev2DiB5RhPExIhY7IG8kdF10BnndTJ6PSBV4yups2Ag3u0EJ4KtmmeiWeXUdQ8Kw1otUCYRjE/+DLG8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uZgat+VU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39AFCC433C7; Sat, 3 Feb 2024 13:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706965288; bh=EAbTSMPbYo7NkFe23hvp0C1Clui1JNxdOmENIj9lOq4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uZgat+VUsmUDt+Vq9NXQ25ez0yXRmsrdTc785RA0TkxNDWysZzktZrhq+DvZBQehS 07g9F6qjE9YwLzI3x9kyMI/K+qN22xn05WvQ30rztoXp6xCUGc4yoKJMB5VNreR3f3 jntral71coziR4sPoD0J7Z1M+BaWDcm9r22tGVv/e3XJ4U6bvM71YSJeTlf0Ifkp5d 2CzSOWNtFC+hoEZ/M1z33nLa3Vetjy56LWqGyiQAJmxE09RLyGiPOabhPzpIktTTpm 96udRKseP9jOyeood8fNEVx5FnPpvWD5G1zTuC2Onx+4nPceecdNwHIIFat/TcoJ0L 7NrZhNO/gkMfQ== From: Mark Brown Date: Sat, 03 Feb 2024 13:00:41 +0000 Subject: [PATCH v2 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240203-arm64-sme-resume-v2-2-a1fbaddc4425@kernel.org> References: <20240203-arm64-sme-resume-v2-0-a1fbaddc4425@kernel.org> In-Reply-To: <20240203-arm64-sme-resume-v2-0-a1fbaddc4425@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/pANAwAKASTWi3JdVIfQAcsmYgBlvjkTOxfeXqJXIwfA+1GogU8KWgiTC8jUf6+WEHcU OzK/j2iJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZb45EwAKCRAk1otyXVSH0BBuB/ 4yB73VEdmQiV/eD2xRwFIagUQD/ROfRHWYDTG+vdDY6evFGYyp+o5jMal0EBnScrQhAtiw5/n0c+0T 98naJhKjgE+s923Ed6S3yhb2n7K5HoYTMx3JQABL+vO+yD1TH+e8R6X6ZOATxZHRG/sC3oe53o6t22 thdMDzT2+2Q51RhxgQ1TYuNp36N9Kw4KPUi1skupgKFdislUvyfxpBF7QQbGyBv+A2bMLvcZLfdiwE X2LNyCYfP0AunHT4tht1Cg7jscj/j0/DHX3VSkAKL07ZCmNVjV4XkAsESTRGkTkFrlcxSos+3bbLWX /npT0r/lQlsn6radcopiLw84Z5Ie5e X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB 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); -- 2.30.2