Re: [PATCH 1/2] arm64/sme: Restore SMCR on exit from suspend

From: Mark Brown
Date: Tue Jan 30 2024 - 07:26:39 EST


On Tue, Jan 30, 2024 at 10:53:42AM +0000, Dave Martin wrote:
> On Tue, Jan 30, 2024 at 12:02:48AM +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.

> Are any other regs affected?

> What about SMPRI_EL1? That seems to be initialised once and for all in
> cpufeatures, so I'd guess it might be affected.

Ah, yes - we should do that too, thanks. At present we map SMPRI_EL1
out using EL2 controls and just set it to 0 on init so I keep forgetting
about it, I wrote a few lines of code years ago.

> Also, what about the _EL2 regs if the kernel is resuming at EL2
> (without VHE -- or if SME && !VHE not a thing?)

Yeah, I was somewhat confused about where the EL2 handling was in the
resume path and was hoping that if we weren't just rerunning the initial
setup someone would tell me what I'm missing (which appeared to be what
was happening).

The hardware will always have VHE but we could be running nVHE (eg, for
pKVM) so not using it.

Attachment: signature.asc
Description: PGP signature