public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Andy Lutomirski <luto@kernel.org>
Cc: "Bae, Chang Seok" <chang.seok.bae@intel.com>,
	 Dave Hansen <dave.hansen@intel.com>,  X86 ML <x86@kernel.org>,
	 LKML <linux-kernel@vger.kernel.org>,
	linux-abi@vger.kernel.org,
	libc-alpha@sourceware.org <libc-alpha@sourceware.org>,
	 Rich Felker <dalias@libc.org>,  Kyle Huey <me@kylehuey.com>,
	 Keno Fischer <keno@juliacomputing.com>
Subject: Re: Candidate Linux ABI for Intel AMX and hypothetical new related features
Date: Mon, 12 Apr 2021 16:19:29 +0200	[thread overview]
Message-ID: <87lf9nk2ku.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CALCETrW2QHa2TLvnUuVxAAheqcbSZ-5_WRXtDSAGcbG8N+gtdQ@mail.gmail.com> (Andy Lutomirski's message of "Fri, 26 Mar 2021 16:12:25 -0700")

* Andy Lutomirski:

> Optionally we make AVX-512 also default off, which fixes what is
> arguably a serious ABI break with AVX-512: lots of programs, following
> POSIX (!), seem to think that they know much much space to allocate
> for sigaltstack().   AVX-512 is too big.
>
> Thoughts?

Maybe we could have done this in 2016 when I reported this for the first
time.  Now it is too late, as more and more software is using
CPUID-based detection for AVX-512.  Our users have been using AVX-512
hardware for quite some time now, and I haven't seen *that* many issues
resulting from the context size.  That isn't to say that problems do not
exist, but they are more of the kind that the increased stack usage
means that areas of the stack that used to be zero no longer are, so
users encounter different side effects from uninitialized-variable bugs.

How much software depends on the signal handler data layout?  The %zmm
state does not appear to be exposed today, so perhaps some savings could
be had there.

The suggestion to make CPUID trap doesn't sound workable to me.  At
least in the past, it's been suggested as a serializing instruction to
be used alongside RDTSC, which makes it rather time-critical for some
applications.

Even today, signal handlers do not really compose well in the sense that
multiple libraries can use them and collaborate without being aware of
each other (like they can divide up TLS memory with the help of the
dynamic linker, or carve out address space using mmap).  Proposals to
set special process-wide flags only make that situation worse.  Code
that installs a signal handler often does not have control on which
thread an asynchronous signal is delivered, or which code it interrupts.
A single process-wide flag cannot capture that accurately, even if it is
per signal number.

There is some work on handlers that do not save GP registers, for
userspace interrupts.  But I do not think that generalizes to existing
signal handlers because floating point is widely used in signal handlers
today (at least implicitly).

The rseq extension might work conceptually, but it requires to make
operations idempotent, with periodic checkpoint, and of course
inline/flatten all calls.  And it requires compiler work, the present
model based on inline asm hacks doesn't look workable.  Maybe that works
for AMX.  I have not checked if there is yet any public documentation of
the programming model.

I think someone expressed the sentiment (maybe on another thread) that
the current CPU feature enablement process does not work.  I do not
agree.  Currently it is only necessary to upgrade the kernel and maybe
glibc (but not in all cases), and then you are good to go.  You can keep
using your old libraries, old compilers, and even old assemblers if you
are okay with .byte hacks.  You do not need special userspace libraries,
new compilers for different languages, special firmware or binary blobs.
Overall, it just works.

On x86, we are really bad about actually using CPU features pervasively,
but that is a different story.

Thanks,
Florian


  parent reply	other threads:[~2021-04-12 14:19 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 23:12 Andy Lutomirski
2021-03-26 23:18 ` Andy Lutomirski
2021-03-27  3:39   ` Len Brown
2021-03-27  9:14     ` Borislav Petkov
2021-03-27  9:58     ` Greg KH
2021-03-29 15:47       ` Len Brown
2021-03-29 16:38         ` Len Brown
2021-03-29 16:48           ` Florian Weimer
2021-03-29 18:14           ` Andy Lutomirski
2021-03-29 18:16         ` Andy Lutomirski
2021-03-29 22:38           ` Len Brown
2021-03-30  5:08             ` Andy Lutomirski
2021-03-30  5:50               ` Noah Goldstein
2021-03-30 17:01               ` Len Brown
2021-03-30 17:05                 ` Andy Lutomirski
2021-03-30 17:56                   ` Len Brown
2021-03-30 19:12                     ` Dave Hansen
2021-03-30 20:20                       ` Andy Lutomirski
2021-03-30 20:42                         ` Len Brown
2021-03-30 22:01                           ` David Laight
2021-03-31 16:31                             ` Len Brown
2021-03-31 16:53                               ` Andy Lutomirski
2021-03-31 21:42                                 ` Robert O'Callahan
2021-03-31 22:11                                   ` Len Brown
2021-03-31 22:28                                 ` Len Brown
2021-03-31 22:45                                   ` Andy Lutomirski
2021-04-09 20:52                                     ` Len Brown
2021-04-09 21:44                                       ` Andy Lutomirski
2021-04-11 19:07                                         ` Len Brown
2021-04-12  7:59                                           ` David Laight
2021-04-12 12:19                                           ` Borislav Petkov
2021-04-12 17:14                                           ` Sean Christopherson
2021-03-31 22:52                                   ` Borislav Petkov
2021-04-09 20:55                                     ` Len Brown
2021-03-28  0:53   ` Thomas Gleixner
2021-03-29  7:27     ` Peter Zijlstra
2021-03-29 15:06     ` Dave Hansen
2021-03-31  8:24 ` Borislav Petkov
2021-04-12 14:19 ` Florian Weimer [this message]
2021-04-12 14:31   ` Borislav Petkov
2021-04-12 14:38     ` Florian Weimer
2021-04-12 15:08       ` Borislav Petkov
2021-04-12 15:10       ` Andy Lutomirski
2021-04-12 15:21   ` Andy Lutomirski
2021-04-12 23:46     ` Len Brown
2021-04-13  0:17       ` Thomas Gleixner
2021-04-13  1:25         ` Len Brown
2021-04-13  3:43       ` Willy Tarreau
2021-04-13 19:51         ` Len Brown
2021-04-14  9:58           ` Borislav Petkov
2021-04-14 10:06             ` Willy Tarreau
2021-04-14 10:08               ` Borislav Petkov
2021-04-14 21:57             ` Len Brown
2021-04-15  4:43               ` Borislav Petkov
2021-04-15  5:29                 ` Willy Tarreau
2021-04-15  5:47                   ` Borislav Petkov
2021-04-16 22:05                     ` Len Brown
2021-04-19 14:14                       ` Borislav Petkov
2021-04-19 18:18                         ` Len Brown
2021-04-19 19:15                           ` Borislav Petkov
2021-04-19 21:33                             ` Len Brown
2021-04-19 21:58                               ` Borislav Petkov
2021-04-23 19:35                                 ` Len Brown
2021-04-23 19:57                                   ` Borislav Petkov
2021-05-02 15:27                                     ` Len Brown
2021-05-03  5:18                                       ` Florian Weimer
2021-05-03 13:43                                         ` Dave Hansen
2021-05-03 13:47                                           ` Florian Weimer
2021-05-03 14:14                                             ` Dave Hansen
2021-05-07 18:44                                           ` Thomas Gleixner
2021-05-07 18:50                                             ` Andy Lutomirski
2021-05-07 19:22                                               ` Thomas Gleixner
2021-05-08  9:45                                       ` Thomas Gleixner
2021-05-18 20:39                                         ` Len Brown
2021-05-19 23:29                                           ` Andy Lutomirski
2021-05-20 19:16                                             ` Len Brown
2021-05-17  9:45                                       ` Thomas Gleixner
2021-05-17  9:56                                         ` Florian Weimer
2021-05-17 10:18                                           ` Thomas Gleixner
2021-05-21 16:29                                           ` Len Brown
2021-05-17 13:49                                         ` Arjan van de Ven
2021-05-20 15:35                                         ` Len Brown
2021-05-20 20:54                                           ` Thomas Gleixner
2021-05-20 21:13                                             ` Dave Hansen
2021-05-20 21:41                                               ` Len Brown
2021-05-20 22:53                                                 ` Dave Hansen
2021-05-21  9:41                                                   ` Thomas Gleixner
2021-05-21 14:44                                                   ` Florian Weimer
2021-05-21 14:49                                                     ` Peter Zijlstra
2021-06-23 15:06                                                       ` Florian Weimer
2021-06-23 23:11                                                         ` Len Brown
     [not found]                                                           ` <93e3b500-5992-a674-18e6-445d1db7b1f0@metux.net>
2021-06-28 12:49                                                             ` Florian Weimer
     [not found]                                                               ` <84be3cfd-e825-ae75-bbae-2bbd3360daa7@metux.net>
2021-06-30 12:41                                                                 ` Willy Tarreau
2021-06-30 13:55                                                                 ` Arjan van de Ven
2021-06-30 15:20                                                                   ` Len Brown
2021-05-21 16:14                                                     ` Dave Hansen
2021-05-21 16:19                                                       ` Florian Weimer
2021-05-21 16:26                                                         ` Len Brown
2021-05-21 16:28                                                         ` Dave Hansen
2021-05-21 16:31                                                         ` Andy Lutomirski
2021-05-21 19:10                                                           ` Thomas Gleixner
2021-05-21 20:07                                                             ` Andy Lutomirski
2021-05-21 21:43                                                               ` Thomas Gleixner
2021-05-21 22:07                                                             ` Len Brown
2021-05-21 22:46                                                               ` Thomas Gleixner
2021-05-21 23:31                                                                 ` Len Brown
2021-05-22  7:16                                                                   ` Florian Weimer
2021-05-22 23:55                                                                     ` Andy Lutomirski
2021-05-21 23:06                                                               ` Dave Hansen
2021-05-21 23:08                                                                 ` Len Brown
2021-05-21 19:05                                                         ` Thomas Gleixner
2021-05-20 21:22                                             ` Len Brown
2021-05-20 21:41                                               ` Thomas Gleixner
2021-05-20 21:49                                                 ` Len Brown
2021-05-21  9:26                                                   ` Thomas Gleixner
2021-04-19 23:52                               ` Paul Eggert
2021-04-13 20:16       ` Andy Lutomirski
2021-04-13 22:47         ` Len Brown
2021-04-13 22:58           ` Andy Lutomirski
2021-04-14 21:48             ` Len Brown
2021-04-15 16:24               ` Andy Lutomirski
2021-04-15 17:00                 ` Dave Hansen
2021-04-15 17:38                   ` Andy Lutomirski
2021-04-16 21:54                 ` Len Brown
2021-04-16 22:03                   ` Andy Lutomirski
2021-04-16 22:10                     ` Len Brown
2021-04-16 22:14                       ` Andy Lutomirski
2021-04-17  1:57                         ` Len Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lf9nk2ku.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=chang.seok.bae@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-abi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).