Re: [PATCH] x86: add more x86-64 micro-architecture levels
From: Hanabishi
Date: Tue Sep 17 2024 - 17:33:48 EST
On 9/15/24 12:49, Borislav Petkov wrote:
Patches like this one appear off and on on the mailing list and each
time I ask what's the upside of maintaining this complexity?
Besides, there are already well-known patches exist for years. So why reinventing the wheel here?
E.g. graysky patch used by ZEN kernel:
https://github.com/zen-kernel/zen-kernel/commit/6f32b8af8ccdb56ef2856db3631eea55b79378c6
It contains way more architectures, includig ISA levels.
On 9/15/24 11:05, John wrote:
GCC 11.1 and Clang 12.0[1] allow for the following new generic
64-bit levels: x86-64-v2, x86-64-v3, and x86-64-v4. This commit
adds them as options accessible under:
Processor type and features --->
Processor family --->
Anyway, this whole thing is actually more complicated than simply setting '-march'.
Vector instructions are known to be problematic for the kernel, so they are disabled by KBUILD_CFLAGS.
If you want to go with higher ISA levels than the kernel expects, an additional patch like this is required:
https://github.com/zen-kernel/zen-kernel/commit/addc601c58e035e28153deeb6d441b91f1a50247