lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZbjVTigk0YlGd3mA@e133380.arm.com>
Date: Tue, 30 Jan 2024 10:54:06 +0000
From: Dave Martin <Dave.Martin@....com>
To: Mark Brown <broonie@...nel.org>
Cc: Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>,
	Jackson Cooper-Driver <Jackson.Cooper-Driver@....com>,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] arm64/sme: Restore SMCR_EL1.EZT0 on exit from suspend

On Tue, Jan 30, 2024 at 12:02:49AM +0000, Mark Brown wrote:
> 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 <Jackson.Cooper-Driver@....com>
> Signed-off-by: Mark Brown <broonie@...nel.org>
> ---
>  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;

Ditto comments on patch 1.

Unrelated to this patch, it is worth having a prctl for this?  The
architecture seems to discourage software written for the SME ISA to
implicitly rely on FA64, so it would useful to be able to run with it
disabled even on hardware that supports it.

> +	if (system_supports_sme2())
> +		smcr |= SMCR_ELx_EZT0;

Side question: since ZT0 is likely to be sporadically used, maybe it
is worth having separate lazy restore for it versus the main SME state?
(Not relevant for this series though, and probably best deferred until
there is hardware to benchmark on.  Also, ZT0 is small compared with
the SME state proper...)

[...]

Cheers
---Dave

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ