Linus Torvalds Comes Out Against "Completely Broken" x86_64 Feature Levels

Written by Michael Larabel in Linux Kernel on 5 December 2024 at 06:54 AM EST. 65 Comments
LINUX KERNEL
With the new Linux kernel patches posted yesterday for cleaning up x86 32-bit kernels on x86_64 CPUs as part of that patch series was introducing new Kconfig build options around the x86_64 micro-architecture feature levels. It turns out though that Torvalds is completely against how the x86_64 feature levels are handled by the compiler toolchain folks and doesn't want to see it invading the kernel.

As a refresher around the x86_64 micro-architecture feature levels, compiler toolchain folks came up with different levels/versions for representing common sets of x86_64 ISA extensions introduced over the years. Over the x86_64 baseline, the x86_64-v2 mandates SSE3/SSE4.2 and other extensions around older AMD Bulldozer and Intel Nehalem CPUs, x86_64-v3 brings AVX/AVX2, BMI2, FMA, and other new extensions from the Intel Haswell and AMD Excavator days, and x86_64-v4 mandates AVX-512 support on top of the v3 extensions.

In response to one of the patches reworking the CPU compiler flags in the x86 Kconfig bits, Linus Torvalds responded:
"The whole "v2", "v3", "v4" etc naming seems to be some crazy glibc artifact and is stupid and needs to die.

It has no relevance to anything. Please do *not* introduce that mind-fart into the kernel sources.

I have no idea who came up with the "microarchitecture levels" garbage, but as far as I can tell, it's entirely unofficial, and it's a completely broken model.

There is a very real model for microarchitectural features, and it's the CPUID bits. Trying to linearize those bits is technically wrong, since these things simply aren't some kind of linear progression.

And worse, it's a "simplification" that literally adds complexity. Now instead of asking "does this CPU support the cmpxchgb16 instruction?", the question instead becomes one of "what the hell does 'v3' mean again?"

So no. We are *NOT* introducing that idiocy in the kernel."

Linus does raise a valid point on the linearization of the feature levels as Intel is currently stuck in an odd position given that their newer laptop/desktop CPUs do not support AVX-512 and then with AVX10 there is both 256-bit and 512-bit options, among other complexities in the handling.

x86_64 CPUs


The creator of Linux further added that he's in favor of the reduced complexity of the x86_64 build options with most of the compiler tuning to specific CPUs not really being worthwhile for the kernel. It's likely the Linux kernel will just keep to generic x86_64 and possibly a "-march=native" option for just optimizing for the local system.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week