From patchwork Tue Jan 30 00:02:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13536582 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4ED39C47DB3 for ; Tue, 30 Jan 2024 00:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HqH4kbVb5Y32NbzdxpmqI/cn8XpDsFIEdUDhUobE/tg=; b=CPCNGijd5TP+fm WXm0pq7Ckj2lsGbv97bYQdEGKHMzn2U+shlg6Ftm6hli5xa8wnUCtvCyHLj8Ne93bLcYpxlH4egKS yv171LnD/3awO+2tsitZFsv9hJcevJD79KV2LUMF8GJsKLZk0bHzd201cptNEUsgV2j5YZAiswgZE 7Det5R8C3EgR8incIqxDE7YSK7NVb4pYfEp8iXGLphk7F7tCee0M1GA7KrVKs2qD26GlenoRyEl4G M/OEvGgnw1yIFYfdLcyZyVdi04M9L6JPihohUL6Bv+tzeNU2cfYAbeybrbZHqZT+WuNJfoUZNbJMY ie6WQrzmX0FNnrjVdwow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUbly-0000000EflU-3xdV; Tue, 30 Jan 2024 00:14:42 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUblp-0000000Efic-0kVq for linux-arm-kernel@lists.infradead.org; Tue, 30 Jan 2024 00:14:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A9161625C6; Tue, 30 Jan 2024 00:14:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 129CAC433F1; Tue, 30 Jan 2024 00:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706573672; bh=xEARPrXco3uTwEMG96xAAVNItcj/45n5YEk1eOwXClE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rpfJiGmv2ewynNRmxqcFutzROj92ZWWNfnlXznIBeT9B+qAkKvijXcMfnZjwUVhtP NhihLpFTDJjpzw9k4FF+CfxUhaRDUJMAN+z9W44pz/kDQpbI9Z8RnFAkDkGUQgVI9B n4CT+IUSQzEad1xWllVykN+pTeDuMSOYLYDF1t4f6BckgyttiXv0oLdwODzr9OUYXc ls/2WGTTjNuQ+sZlOL9AJl9NrYlrXF1/pgUCqG41PLpCCa5y/5rD0kztRKovoasGB0 57Yc5VeCx+I3SG7p8YWNm/hOdu0+SjuWn7nHfkG3KqTMohlpVrB5+AFbt50tqC9lYG PcoOXd/lDwODw== From: Mark Brown Date: Tue, 30 Jan 2024 00:02:49 +0000 Subject: [PATCH 2/2] arm64/sme: Restore SMCR_EL1.EZT0 on exit from suspend MIME-Version: 1.0 Message-Id: <20240130-arm64-sme-resume-v1-2-0e60ebba18df@kernel.org> References: <20240130-arm64-sme-resume-v1-0-0e60ebba18df@kernel.org> In-Reply-To: <20240130-arm64-sme-resume-v1-0-0e60ebba18df@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=953; i=broonie@kernel.org; h=from:subject:message-id; bh=xEARPrXco3uTwEMG96xAAVNItcj/45n5YEk1eOwXClE=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBluD9i6yBs2MgbbLUzAPKlp1ZuhKTGe0vDXTQl6XYM 5TVEHjqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZbg/YgAKCRAk1otyXVSH0KIZB/ 0VUqbC1WxvC5599zPIxyITE5LsBkJ1mSnsGokZEsNminewQPOex98hDJhyZYzBNMULgL636VUgyLL4 sLiH4tj4vzBEDIuGN4q8lNnLs7PnrNh2tC1+0u9SAHllCPuognJbWsRWZfbejbYxu16Jwci4KqhTjW /TfAx9RQgmbOb4X1qTLpc7Mfd5B7bo4aeJR2ZcLBsRtYGug91XOKzhVX4N4xynZqQatLuzp2A9MK2l qUfvY0yLD11I2dQeVp/3Fcqg1rGLOt8MGRt/I/pfBKJaq3UYLb5ueLUMn9G+I1q9Md2h9NuoSaIBk1 2WysA6QBWN+bsC8h6lTv4xZ30EKYav X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240129_161433_294339_D5DD590B X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 69201208bb13..329782fe39c5 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); }