public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>,
	Joseph Myers <joseph@codesourcery.com>
Subject: Re: [PATCH v3] x86: Disable x86-64 level marker [BZ #27318]
Date: Mon, 1 Mar 2021 10:00:44 -0800	[thread overview]
Message-ID: <CAMe9rOrgFKh-y5-weOOgd5j6WD4LghkiJM5EjoJmNsZMJvEdpA@mail.gmail.com> (raw)
In-Reply-To: <878s76eu2x.fsf@oldenburg.str.redhat.com>

On Mon, Mar 1, 2021 at 8:06 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Florian Weimer:
>
> > * H. J. Lu via Libc-alpha:
> >
> >> On Mon, Feb 22, 2021 at 2:40 AM Florian Weimer <fweimer@redhat.com> wrote:
> >>> I think this will produce an #error for if there is a lone -mavx in
> >>> addition to x86-64-v2 coverage in the compiler.  The first block would
> >>> define ISA_V2, but the second block produces the error.  I assume that
> >>> causes inclusion of the build note to be skipped.
> >>
> >> Correct.
> >
> > Okay, that explains why the checks are the way they are.  Thanks.
> >
> >>> Is this really helpful?  If glibc was built to run with on x86-64-v2
> >>> CPUs with some extra, wouldn't it still make sense to perform the
> >>> x86-64-v2 diagnostic upon startup?
> >>
> >> Since libc.so now contains x86-64-v2 + extra, we can't mark it as
> >> x86-64-v2 since it may UD on x86-64-v2 machines.  Or we can
> >> change the meaning of the ISA level marker from "this shared library
> >> REQUIRES ONLY x86-64-v2 to run" to "this shared library WON'T
> >> run without x86-64-v2".
> >
> > I think the loader check is worthwhile to add because otherwise people
> > will end up with half-working systems.  In my experience, this can lead
> > to lots of bug reports because people assume that if only some things
> > are crashing, it must be a distribution bug.  So the loader check is
> > quite valuable for documenting an baseline increase.
> >
> > I also think that the ELF markers are valuable if they specify the exact
> > ABI level to which the object has been built.  But I do think we need
> > GCC and perhaps binutils support for generating them because otherwise,
> > new GCC features may silently build glibc with the wrong ABI level.  For
> > example, with this patch and building on GCC 10 with
> > -march=icelake-server, it seems like I still get a property note:
> >
> > Displaying notes found in: .note.gnu.property
> >   Owner                Data size      Description
> >   GNU                  0x00000010     NT_GNU_PROPERTY_TYPE_0        Properties: <procesor-specific type 0xc0008002 data: 0f 00 00 00 >
> >
> > But -march=icelake-server is a superset of x86-64-v4, so that's not
> > correct, I think.  glibc can't know a bout all these extra features, so
> > the generated note will always be misleading.  A note produced elsewhere
> > in the toolchain would not have this problem.
> >
> > But we could still check for all the preprocessor macros we know that
> > should constitute x86-64-v2 &c, and error out in the dynamic loader if
> > there isn't support for them in the current process.
>
> Any further comments here?
>
> This bug keeps hitting more and more people.
>
> I think we should do the following: (a) disable the build note
> generation in glibc, (b) backport --list-diagnostics or something
> similar.  The second part will hopefully help with analyzing failures
> due to CPU support mismatches.

My patch does (a).  But I think the ISA level meaning should be changed
from "works on processors with the ISA level" to "require processors with
the ISA level to work".

-- 
H.J.

  reply	other threads:[~2021-03-01 18:01 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 21:51 [PATCH] x86: Require full ISA support for " H.J. Lu
2021-02-02 23:11 ` Joseph Myers
2021-02-02 23:16   ` H.J. Lu
2021-02-03 14:14     ` Joseph Myers
2021-02-03 15:09       ` [PATCH v2] " H.J. Lu
2021-02-04 10:38         ` Florian Weimer
2021-02-04 13:22           ` H.J. Lu
2021-02-04 22:55             ` Andreas K. Hüttel
2021-02-04 23:09               ` H.J. Lu
2021-02-07 10:27                 ` Florian Weimer
2021-02-07 15:05                   ` H.J. Lu
2021-02-08 15:06                     ` Florian Weimer
2021-02-08 16:09                       ` H.J. Lu
2021-02-09  0:29                         ` [PATCH v3] x86: Disable " H.J. Lu
2021-02-22 10:40                           ` Florian Weimer
2021-02-22 12:51                             ` H.J. Lu
2021-02-22 13:51                               ` Florian Weimer
2021-03-01 16:07                                 ` Florian Weimer
2021-03-01 18:00                                   ` H.J. Lu [this message]
2021-03-01 18:06                                     ` Florian Weimer
2021-03-01 19:09                                       ` H.J. Lu
2021-03-03 13:37                                         ` [PATCH v4] x86: Set minimum " H.J. Lu
2021-03-05 19:43                                           ` Florian Weimer
2021-03-06 15:23                                             ` [PATCH v5] " H.J. Lu
2021-03-06 15:42                                               ` Florian Weimer
2021-03-06 15:58                                                 ` [2.33][PATCH] " H.J. Lu
2021-02-08 13:35               ` [PATCH v2] x86: Require full ISA support for " Nix
2021-02-03  9:29 ` [PATCH] " Florian Weimer

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=CAMe9rOrgFKh-y5-weOOgd5j6WD4LghkiJM5EjoJmNsZMJvEdpA@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.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).