public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Compatibility issues around <sys/platform/x86.h>
@ 2020-12-21 13:00 Florian Weimer
  2020-12-21 17:05 ` H.J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2020-12-21 13:00 UTC (permalink / raw)
  To: libc-alpha

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.

(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
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.

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-12-22 13:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21 13:00 Compatibility issues around <sys/platform/x86.h> 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
2020-12-22 13:32   ` Florian Weimer

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).