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: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: Compatibility issues around <sys/platform/x86.h>
Date: Tue, 22 Dec 2020 03:42:00 -0800	[thread overview]
Message-ID: <CAMe9rOou-HJMMcfdBRfhWvWDN7X+t45FGRxyeTzix5ZTqCYuJA@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOroqXkJepOQ3aAKnc8hG1y9QxVU+H9XfodirG1COSYsow@mail.gmail.com>

On Mon, Dec 21, 2020 at 9:05 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Mon, Dec 21, 2020 at 5:00 AM Florian Weimer <fweimer@redhat.com> wrote:
> >
> > I finally had some time to review the <sys/platform/x86.h> interface.
> >
> > I have two major concerns:
> >
> > (a) Placement of struct cpu_features in _rtld_global_ro
> >
> > This means that backporting new feature support changes the internal
> > GLIBC_PRIVATE ABI. Consequently, there's a race condition during
> > in-place updates where loading binaries can fail in obscure ways, due to
> > the change in _rtld_global_ro offsets.  We should really avoid this.
>
> This applies to all members in _rtld_global_ro.
>
> > (c) The COMMON_CPUID_INDEX_MAX handshake does not work.
> >
> > __x86_get_cpu_features returns NULL if its argument is too large.  This
> > effectively disables *all* feature bits, not just those beyond
> > COMMON_CPUID_INDEX_MAX. This means that if you build with a header that
>
> Can you open a glibc bug?  It shouldn't be too hard to fix.  I can take
> a look if you don't have time.

https://sourceware.org/bugzilla/show_bug.cgi?id=27104

A patch is posted at

https://sourceware.org/pipermail/libc-alpha/2020-December/120968.html

> > is too new, an application may fail due to the lack of detected features
> > when running on an older glibc version.  Ideally, only the newly added
> > CPU features would be detected as missing in this scenario.  Simply
> > recompiling an application with a newer header should not result in any
> > detection changes.
> >
> >
> > Not quite a major concern is that this feature is not usable from IFUNC
> > resolvers with BIND_NOW, which I consider an important use of CPU
> > feature selection.  I do not have a good solution here that can be
> > implemented in time for glibc 2.33.  I expect that a proper solution
> > will require some binutils work.
>
> Can you open a glibc bug?
>
> > I'm going to work on this with priority this week and hope to have
> > patches posted by the 24th.
> >
> > Thanks,
> > Florian
> > --
> > Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
> > Commercial register: Amtsgericht Muenchen, HRB 153243,
> > Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
> >
>
>
> --
> H.J.



-- 
H.J.

  parent reply	other threads:[~2020-12-22 11:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21 13:00 Florian Weimer
2020-12-21 17:05 ` H.J. Lu
2020-12-21 17:15   ` Adhemerval Zanella
2020-12-22 11:42     ` H.J. Lu
2020-12-22 12:43       ` Adhemerval Zanella
2020-12-22 12:57         ` H.J. Lu
2020-12-22 11:42   ` H.J. Lu [this message]
2020-12-22 13:32   ` 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=CAMe9rOou-HJMMcfdBRfhWvWDN7X+t45FGRxyeTzix5ZTqCYuJA@mail.gmail.com \
    --to=hjl.tools@gmail.com \
    --cc=fweimer@redhat.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).