New x86-64 micro-architecture levels

sourceware.org
4 min read
fairly difficult
Article URL: https://sourceware.org/pipermail/libc-alpha/2020-July/116135.html Comments URL: https://news.ycombinator.com/item?id=25029913 Points: 2 # Comments: 0
New x86-64 micro-architecture levels

Most Linux distributions still compile against the original x86-64 baseline that was based on the AMD K8 (minus the 3DNow! parts, for Intel EM64T compatibility). There has been an attempt to use the existing AT_PLATFORM-based loading mechanism in the glibc dynamic linker to enable a selection of optimized libraries. But the general selection mechanism in glibc is problematic: hwcaps subdirectory selection in the dynamic loader We also have the problem that the glibc version of "haswell" is distinct from GCC's -march=haswell (and presumably other compilers): Definition of "haswell" platform is inconsistent with GCC And that the selection criteria are not what people expect: Epyc and other current AMD CPUs do not select the "haswell" platform subdirectory Since the hwcaps-based selection does not work well regardless of architecture (even in cases the kernel provides glibc with data), I worked on a new mechanism that does not have the problems associated with the old mechanism: [PATCH 00/30] RFC: elf: glibc-hwcaps support (Don't be concerned that these patches have not been reviewed; we are busy preparing the glibc 2.32 release, and these changes do not alter the glibc ABI itself, so they do not have immediate priority. I'm fairly confident that a version of these changes will make it into glibc 2.33, and I hope to backport them into Fedora 33, Fedora 32, and Red Hat Enterprise Linux 8.4. Debian as well, but I have never done anything like it there, so I don't know if the patches will be accepted.) Out of the box, this should work fairly well for IBM POWER and Z, where there is a clear progression of silicon versions (at least on paper —virtualization may blur the picture somewhat). However, for x86, we do not have such a clear progression of micro-architecture versions. This is not just as a result of the AMD/Intel competition, but also due to ongoing product differentiation within one chip vendor. I think we need these levels…
Read full article