Re: Candidate Linux ABI for Intel AMX and hypothetical new related features
From: Len Brown
Date: Thu May 20 2021 - 15:16:38 EST
On Wed, May 19, 2021 at 7:29 PM Andy Lutomirski <luto@xxxxxxxxxx> wrote:
> > 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.
Yes, your understanding is correct -- XRESTOR works as one would expect.
> The case that would
> break is if user code then assumes that it can XSAVE back to the same
> buffer.
The other case that would break is if the concept of what features
were supported
(eg. XCR0) changed between when the context was saved and when it was
subsequently restored. Yes, if a feature appeared, you'd get INIT;
but if a feature went away, you would fault.
I've been told that user-space software exists that does this. If I can find
specific examples, I'll share that.
thanks,
Len Brown, Intel Open Source Technology Center