From patchwork Tue Jan 30 00:02:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 193749 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp908624dyb; Mon, 29 Jan 2024 16:14:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVu9ioTvf7XDSMNfvpPCj3G/55+A/RjtgHrxA/JT8Qhcp+kTEeQuAr35LiSCu8c4SAHo7u X-Received: by 2002:a05:620a:136f:b0:784:203:6e76 with SMTP id d15-20020a05620a136f00b0078402036e76mr168510qkl.51.1706573697044; Mon, 29 Jan 2024 16:14:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706573697; cv=pass; d=google.com; s=arc-20160816; b=MPUORkLUFfvytFoNNCs4U2ftBml1FrOjawYWcOr4AYYK2MI10WrmSEifoDqf2QI3CO IGQs59NzxDUhBdTdXBsWCBIyoJyWVp5NXMsnhU6aaTAH79snfpRmvhKeOecNJHqAumNK xYdVqa4PgHv+7X+DywxMv7/kSpY5s6va6NRUgRGK91bME5ojwhoZqv5rXf3TBBAYtnuW zz1ULYKBo6nMdei7383stAS0/nD1x8GWJrbTsC1zcjf8olP0uVeRNRIw85JKNDsiZm7q k85Z+dnq8Fxr1KXGy9hK659WNs2VKHyoGGSUZdtSzN/Ls9+jxvoLFmIwFUla0kb8nQur bZ5g== 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=UXIjgYAqUFQRjrkLG8bY68e7SSKhlg2AmsC57IcYojE=; fh=0mGf4Cbu606ATNCCcSl9jdUnQus/lINFItlNRZrR8jk=; b=iNRkovvZ72/9l5Q+QEtgsY623+2dizvc9POVFr9fLMZsc8KYd13i8qHci1AteBbZML ALRzq9MBZMPKZEYiK9edOSIeat614V2uhdH2S05F9wnxL4XgIWGU3+ckBprKT9pUJphB AsE2xQS8/iKmCqnNhf31B7gkIRGfK/YFZbfcxiao1Zt//F6e7ppcIpKf1s3gbgUTF3xZ irgt0myWHBFRpLgDlLHuXf/1MWAwqO0yZ1gEINh2UWmTE9RtuTzrjUzoEGloWzqFMHcS FPauAR3qFqBICW7xvfVMOB8c6FFZCp1AB26v+XVgiyL4LdesXPOUwCWlGEDiv4zYNUvB BCVw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tlhllx2r; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-43665-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43665-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id wv9-20020a05620a5a0900b0078405cec4fcsi1487634qkn.605.2024.01.29.16.14.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 16:14:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43665-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tlhllx2r; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-43665-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43665-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C30351C23340 for ; Tue, 30 Jan 2024 00:14:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85F7426AFC; Tue, 30 Jan 2024 00:14:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tlhllx2r" 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 CB57D125CA for ; Tue, 30 Jan 2024 00:14:30 +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=1706573670; cv=none; b=HbvaUJG0fD7TgTcIHAOWzTIbJS2eSiEvad0C5rZV4buyroZsQWfp/ZHn9OcTh0y2TeTnXc6MiKdNnlmN5JxpHqFOyHoi0dZDcbkTQLms3zjzu8LPyjNdnAlnL+A0Ur+Izz+Q1NfO9SrxjVoMn9C4DIguOnZcJ6GJ9J+EzPftAe8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706573670; c=relaxed/simple; bh=ZTo5ZwG70N90xxtm+/9tRfhfP4BHWTK7W1uC77KuLOk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GeWRSyMjAxoXWEs6WEdcE+KCRhv9cLNSnmmoFD+8MqzoXT9lr4584IgBSpaLp5a2jW8GpXoQN+c7LuEUJeoFJKeZpmD1ZT/APLyCNDuR6cdi0pXkCUPa3Y205WNZ7LfK7UUVaNqQNUk9FapVJ97jWtvBxF1epUyR3N/1ioZnDro= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tlhllx2r; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49F9BC43390; Tue, 30 Jan 2024 00:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706573670; bh=ZTo5ZwG70N90xxtm+/9tRfhfP4BHWTK7W1uC77KuLOk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=tlhllx2rYUBERQO/TVeu+jO1tBlv2SsdA69Fb82Zi8Ueh/FvqjtKAfTleIrzdq11p kVMxq4IxOU5DaXCK2HeNRbeEJFLmPtEuUKL22QmbE7qqwI2ZPmHQnSVC9fLdoLfdpa o567PTPk/6uPl3ln20ArrqRQcw0B3cMCAqy5ivJ8VzCVYAoHX18kk7g5QdzgUOcpre h0/jS3wiG4AjxaF86GEAMr/R4HLB+CORxt+fqzXTQBP7SnpM3iEDZg/IjE7BeUkbEM ZzPqBSoL9h2yxvAdMIHXx26vc9U0Rp9vLO1c0FgM7VkraAa/ZQyE2QPqrcSvtG1hw3 YWJmGl5Hjxodg== From: Mark Brown Date: Tue, 30 Jan 2024 00:02:48 +0000 Subject: [PATCH 1/2] arm64/sme: Restore SMCR 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: <20240130-arm64-sme-resume-v1-1-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=2824; i=broonie@kernel.org; h=from:subject:message-id; bh=ZTo5ZwG70N90xxtm+/9tRfhfP4BHWTK7W1uC77KuLOk=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBluD9hwBczBmoZohtBPPFhLyZwbLluJz2W6O5QONUl 43GzPTKJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZbg/YQAKCRAk1otyXVSH0MtoB/ 9id4s9xk+85E5vWs/iH8YfCgW0RW41QLhxe3supGv4xCY6wCEAyDqGmcDPWBwVxLkHskdh33bVMbRz KBq6U5u9rCXkckAITaFHFf8ycMwqBykW/WLoM1P5B7IdQyzzj6GYj+nzI/nqbECDBPOaQqZatc0nAi 2qFCQ3fwVOxlY+8J5H7bboUrULAD2y5XxyzRcbw5kD3LmFkjSZFOdODvdxm+Mysvgko+ltfNiThi3L +k0/EbQbm/dL3Yhk8uIihyyRm+Y62RYygYlCrFcud3tYuYgAqH1H53Rez3LBngy1TT0jCHYFgF3QZ3 b3RJStCKjjUTSnNWz5AhUNdBpAtsDu X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789472221011956160 X-GMAIL-MSGID: 1789472221011956160 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. The vector length will be restored as part of restoring the SME state for the next SME using task. Fixes: a1f4ccd25cc2 (arm64/sme: Provide Kconfig for SME) Reported-by: Jackson Cooper-Driver Signed-off-by: Mark Brown --- arch/arm64/include/asm/fpsimd.h | 2 ++ arch/arm64/kernel/fpsimd.c | 13 +++++++++++++ arch/arm64/kernel/suspend.c | 3 +++ 3 files changed, 18 insertions(+) diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h index 50e5f25d3024..7780d343ef08 100644 --- a/arch/arm64/include/asm/fpsimd.h +++ b/arch/arm64/include/asm/fpsimd.h @@ -386,6 +386,7 @@ extern void sme_alloc(struct task_struct *task, bool flush); extern unsigned int sme_get_vl(void); extern int sme_set_current_vl(unsigned long arg); extern int sme_get_current_vl(void); +extern void sme_suspend_exit(void); /* * Return how many bytes of memory are required to store the full SME @@ -421,6 +422,7 @@ static inline int sme_max_vl(void) { return 0; } static inline int sme_max_virtualisable_vl(void) { return 0; } static inline int sme_set_current_vl(unsigned long arg) { return -EINVAL; } static inline int sme_get_current_vl(void) { return -EINVAL; } +static inline void sme_suspend_exit(void) { } static inline size_t sme_state_size(struct task_struct const *task) { diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index a5dc6f764195..69201208bb13 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1311,6 +1311,19 @@ void __init sme_setup(void) get_sme_default_vl()); } +void sme_suspend_exit(void) +{ + u64 smcr = 0; + + if (!system_supports_sme()) + return; + + if (system_supports_fa64()) + smcr |= SMCR_ELx_FA64; + + write_sysreg_s(smcr, SYS_SMCR_EL1); +} + #endif /* CONFIG_ARM64_SME */ static void sve_init_regs(void) diff --git a/arch/arm64/kernel/suspend.c b/arch/arm64/kernel/suspend.c index eca4d0435211..eaaff94329cd 100644 --- a/arch/arm64/kernel/suspend.c +++ b/arch/arm64/kernel/suspend.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -80,6 +81,8 @@ void notrace __cpu_suspend_exit(void) */ spectre_v4_enable_mitigation(NULL); + sme_suspend_exit(); + /* Restore additional feature-specific configuration */ ptrauth_suspend_exit(); } 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: 193750 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp908906dyb; Mon, 29 Jan 2024 16:15:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGO+JB90WtvQ/X/SGWEjNlQvV+wz52M1MvMgBc/5UC57Janr/7SnQqvy8iL3+WAi1IjPoy2 X-Received: by 2002:a05:6808:221e:b0:3bd:f014:eddc with SMTP id bd30-20020a056808221e00b003bdf014eddcmr7236917oib.3.1706573729989; Mon, 29 Jan 2024 16:15:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706573729; cv=pass; d=google.com; s=arc-20160816; b=Pk0EyeakBHM8p/+YZKZoxWmmybC0O9EVxjqBOuZNQ6GWJdMTRiQ4735e6cHhb//WDr t32O2OS5uwEvXMfaAlWzVoIBjY1GO2uT36DJ4RJ9y0RibQuRIJVyWlMQbSieU6JwjC6U x/2vGpbw2yVwm2RPel+Pc0W7EwsD4zCMJzlRz87PsDyOgKLU+abGyyiiCCq/z+SrP1jU R2OmX7SsYJqH8HDYbX6zJtbUMebE6AJ98kiEtJCmAftafqdOZrV2Xe78VMo3AziMApxt 7MtzjHX7B09quHBUEI9ak+nHucoG4Ke8GJc7wwkk49cjaXhcGkJLhG1dJ82UwFkkhlzv 8wyg== 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=m+lYsivp3XG9Vn+NuvFwLq1DKUI/T1bkpRexP+jhSP0=; fh=0mGf4Cbu606ATNCCcSl9jdUnQus/lINFItlNRZrR8jk=; b=1FLUk7u80M2IeNaSetZP1aVIXiQOdUIGgdl1GOlvqTgJ5d2UmUtLLiiYua76CfpgK1 yGiahgXXo+TyEoEvbujpWb4mqzaGp4Y4Os8zNfJm0vwe5lX585xijCYLIWZowZFZ2nio Jmkk4lav6hqLQmU+euI+zoueRhUnGAUW6ghETqYOEdm/bauJKdOBYMaWhN5B5hBhIhBZ kh+ToHySAvUIESQ4rtIYKHsVIbPlNxkUvWUj9O0B1nF1XC1c3R2ccAYFLcWuiru0Q8En yRjJlCSofm1fHD7981kfQsUAEuJaelxzotFzh/nJa0HcWUXAw16c0a7Vz+oxjAb98gH7 optw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rpfJiGmv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-43666-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43666-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b129-20020a633487000000b005d760c23e01si6638652pga.462.2024.01.29.16.15.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 16:15:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43666-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rpfJiGmv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-43666-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43666-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 D3AA9B233D5 for ; Tue, 30 Jan 2024 00:15:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9CDE52EAF7; Tue, 30 Jan 2024 00:14:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rpfJiGmv" 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 E394D1F5E6 for ; Tue, 30 Jan 2024 00:14:32 +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=1706573673; cv=none; b=qHHe7hFg3CmAu7Tc+tE5gKMAo/d63aG2X58hZ8HSenXoWk+Kfn4Hc1xWyP6AqQw7tNBGFutVQHiQYQA+lcSwkj2W4sVIgFnTsxEWOuocZkt9jb2KwJhrBSGeb3udQEbL0dp9AVaMhIkl5tIzRC+BDsg3iECa3sBhyk27QSLTJPI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706573673; c=relaxed/simple; bh=xEARPrXco3uTwEMG96xAAVNItcj/45n5YEk1eOwXClE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=j6hh0jhnLUfmnPRpqN6Yqgk8TgBDp56y2bGFjQl5DtsHcGF9nVxkjoWA89X8RfG6hDtqcUIxs89avYHcJfVixHNaNJaaasvkpFU576H/r82SF6ZEfX9K3Bh8sdGxcx+/NQu9fR24nneh6ytz4/bQxeKrOKc/FIviYBmteonZXSo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rpfJiGmv; arc=none smtp.client-ip=10.30.226.201 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789472255446464966 X-GMAIL-MSGID: 1789472255446464966 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); }