[PATCH v1 12/38] arm64/sme: Provide ABI documentation for SME

Szabolcs Nagy szabolcs.nagy at arm.com
Mon Oct 11 07:19:37 PDT 2021


The 10/11/2021 14:23, Mark Brown wrote:
> On Mon, Oct 11, 2021 at 02:17:30PM +0100, Szabolcs Nagy wrote:
> 
> > > +* PSTATE.SM and PSTATE.ZA, the streaming mode vector length and the ZA
> > > +  register state are tracked per thread.
> 
> > can you add a note that there is a new TPIDR2_EL0
> > per thread and on thread creation it's 0 (and i
> > guess unchanged on fork).
> 
> Sure.  It's actually reset to 0 on fork() - would that be a problem?

yes, i think fork should not change it. (just like the
normal thread pointer is unchanged in the child process)

tpidr2 is used in the sme pcs by the lazy za save scheme.
(cc += Richard Sandiford, who wrote the specs)

if fork resets tpidr2 then returning to a stack frame
that set tpidr2 could cause clobbered za state.
(userspace can fix this up, but if we want this case
to work then it's better to fix it on the kernel side)




More information about the linux-arm-kernel mailing list