Re: Candidate Linux ABI for Intel AMX and hypothetical new related features

From: Andy Lutomirski
Date: Wed May 19 2021 - 19:29:39 EST


On 5/18/21 1:39 PM, Len Brown wrote:
> On Sat, May 8, 2021 at 5:45 AM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
>> Where is #6 which describes the signal interaction?
>
> #6 Per the current ABI, Linux gives signal handlers access to all of
> the hardware architectural state.
>
> #6a Signal Stack is on User Stack
>
> The architectural state is pushed on the user stack in uncompressed
> XSTATE format.
>
> It is established that there exists application code that counts on
> this opaque state being complete so that it can do a user-space
> XRESTORE instead of a sigreturn(2).

Is this established?

Note that the specific case of a user program doing XRSTOR will work
just fine if we omit the allocation of non-in-use states from the
buffer, at least by my reading of the pseudocode. The case that would
break is if user code then assumes that it can XSAVE back to the same
buffer.

> (My opinion is that not breaking
> that legacy code is a requirement, and I'm actually shocked this view
> is not unanimous)
>
It's pretty unanimous. But the legacy code that's broken has to
actually exist for this to apply.