second, sync-alloc syscall

From: Borislav Petkov
Date: Thu May 27 2021 - 07:14:48 EST


On Tue, May 25, 2021 at 08:38:16PM -0400, Len Brown wrote:
> 7. In addition, a 2nd system call to request that buffers be
> pre-allocated is available. This is a per task system call. This
> synchronous allocate system call will return an error code if it
> fails, which will also likely result in program exit.

...

> Unclear if we have consensus on the need for a synchronous allocation
> system call (#7 above). Observe that this system call does not
> improve the likelihood of failure or the timing of failure.

Just when I was thinking that the use case for this is for application
writers to run this upfront and prealloc everything and *then* start
computations. I.e., to not risk doing some work and then get killed
later on the AMX buffer alloc failure and thus lose that work.

> An #NM-based allocation and be done at exactly the same spot by
> simply touching a TMM register. The benefit of this system call is
> that it returns an error code to the caller, versus the program
> being delivered a SIGSEGV at the offending instruction pointer. Both
> will likely result in the program exiting, and at the same point in
> execution.

So if this second syscall doesn't sound really great, I'd say we stick
to the #NM-based allocation and keep this one in the bag for now and
take it out only if it turns out that it makes sense as a use case.

As tglx said: it is easy to add stuff later. It is a lot harder - even
impossible - to remove already present machinery.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette