Re: [PATCH] arm64: suspend: Save and restore TPIDR2_EL0 across CPU suspend
From: Wei Wang
Date: Tue Nov 03 2026 - 13:04:27 EST
On Tue, Nov 3, 2026 at 5:56 AM Mark Brown <broonie@xxxxxxxxxx> wrote:
>
> On Mon, Nov 02, 2026 at 11:48:13PM +0000, Wei Wang wrote:
>
> > On systems with FEAT_SME, TPIDR2_EL0 is part of userspace thread state:
> > the AAPCS64 SME ABI uses it as the ZA lazy-save pointer, and the kernel
> > context-switches it eagerly in tls_thread_switch(). While a task is
> > running, the live register is the only copy of its value.
>
> Thanks for catching this:
>
> Reviewed-by: Mark Brown <broonie@xxxxxxxxxx>
>
Thanks!
> but I think we're missing some other registers, I made the same mistake
> for GCS with GCSPR_EL0 and GCSCRE0_EL1 and I'm not seeing where POR_EL0
> is handled either but possibly it's somewhere I didn't spot. I can look
> into those incrementally once this gets applied (or if you do a v2 and
> roll them in that'd also be great!).
I think you're right. As far as I can see, these are only switched in
process.c and nothing touches them
in the suspend path. Unfortunately the hardware I am testing doesn't
implement GCS or POE per cpuinfo,
so I couldn't test changes there. I'd rather keep this one minimal for
stable and leave those as a follow-up.