1
0

release 6.12.4 (preliminary)

This commit is contained in:
2024-12-10 06:44:25 +03:00
parent 9debc8729c
commit 407e7bac82
246 changed files with 4681 additions and 5758 deletions

View File

@@ -1,14 +1,14 @@
From a657df31affbb91d8cb2718e70f42cf8ed6e9a7c Mon Sep 17 00:00:00 2001
From 421120bda34d994c5e0e07a89e2f9c40c53e8e87 Mon Sep 17 00:00:00 2001
From: graysky <therealgraysky AT proton DOT me>
Date: Mon, 16 Sep 2024 05:55:58 -0400
Subject: ZEN: Add graysky's more-ISA-levels-and-uarches
Subject: ZEN: Add graysky's more-uarches
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From https://github.com/graysky2/kernel_compiler_patch
more-ISA-levels-and-uarches-for-kernel-6.8-rc4+.patch
more-ISA-levels-and-uarches-for-kernel-6.1.79+.patch
FEATURES
This patch adds additional tunings via new x86-64 ISA levels and
@@ -111,7 +111,7 @@ See the following experimental evidence supporting this statement:
https://github.com/graysky2/kernel_compiler_patch?tab=readme-ov-file#benchmarks
REQUIREMENTS
linux version 6.8-rc3+
linux version 6.1.79+
gcc version >=9.0 or clang version >=9.0
ACKNOWLEDGMENTS
@@ -123,10 +123,10 @@ REFERENCES
3. https://github.com/graysky2/kernel_gcc_patch/issues/15
4. http://www.linuxforge.net/docs/linux/linux-gcc.php
---
arch/x86/Kconfig.cpu | 363 ++++++++++++++++++++++++++++++--
arch/x86/Makefile | 89 +++++++-
arch/x86/include/asm/vermagic.h | 70 ++++++
3 files changed, 506 insertions(+), 16 deletions(-)
arch/x86/Kconfig.cpu | 359 ++++++++++++++++++++++++++++++--
arch/x86/Makefile | 87 +++++++-
arch/x86/include/asm/vermagic.h | 70 +++++++
3 files changed, 499 insertions(+), 17 deletions(-)
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -483,7 +483,7 @@ REFERENCES
config GENERIC_CPU
bool "Generic-x86-64"
@@ -294,8 +581,32 @@ config GENERIC_CPU
@@ -294,6 +581,26 @@ config GENERIC_CPU
Generic x86-64 CPU.
Run equally well on all x86-64 CPUs.
@@ -509,14 +509,8 @@ REFERENCES
+
endchoice
+config SUPPORT_MARCH_CODEVERS
+ bool
+ default y if (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
+
config X86_GENERIC
bool "Generic x86 support"
depends on X86_32
@@ -308,6 +619,30 @@ config X86_GENERIC
@@ -308,6 +615,30 @@ config X86_GENERIC
This is really intended for distributors who need more
generic optimizations.
@@ -547,7 +541,7 @@ REFERENCES
#
# Define implied options from the CPU selection here
config X86_INTERNODE_CACHE_SHIFT
@@ -318,7 +653,7 @@ config X86_INTERNODE_CACHE_SHIFT
@@ -318,7 +649,7 @@ config X86_INTERNODE_CACHE_SHIFT
config X86_L1_CACHE_SHIFT
int
default "7" if MPENTIUM4 || MPSC
@@ -556,7 +550,7 @@ REFERENCES
default "4" if MELAN || M486SX || M486 || MGEODEGX1
default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
@@ -336,11 +671,11 @@ config X86_ALIGNMENT_16
@@ -336,11 +667,11 @@ config X86_ALIGNMENT_16
config X86_INTEL_USERCOPY
def_bool y
@@ -572,11 +566,13 @@ REFERENCES
# P6_NOPs are a relatively minor optimization that require a family >=
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -179,14 +179,99 @@ else
@@ -182,15 +182,96 @@ else
cflags-$(CONFIG_MK8) += -march=k8
cflags-$(CONFIG_MPSC) += -march=nocona
cflags-$(CONFIG_MCORE2) += -march=core2
cflags-$(CONFIG_MATOM) += -march=atom
- cflags-$(CONFIG_MATOM) += -march=atom
- cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic
+ cflags-$(CONFIG_MATOM) += -march=bonnell
+ ifeq ($(CONFIG_X86_64_VERSION),1)
+ cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic
+ rustflags-$(CONFIG_GENERIC_CPU) += -Ztune-cpu=generic
@@ -600,8 +596,6 @@ REFERENCES
+ cflags-$(CONFIG_MZEN5) += -march=znver5
+ cflags-$(CONFIG_MNATIVE_INTEL) += -march=native
+ cflags-$(CONFIG_MNATIVE_AMD) += -march=native -mno-tbm
+ cflags-$(CONFIG_MATOM) += -march=bonnell
+ cflags-$(CONFIG_MCORE2) += -march=core2
+ cflags-$(CONFIG_MNEHALEM) += -march=nehalem
+ cflags-$(CONFIG_MWESTMERE) += -march=westmere
+ cflags-$(CONFIG_MSILVERMONT) += -march=silvermont
@@ -647,8 +641,6 @@ REFERENCES
+ rustflags-$(CONFIG_MZEN5) += -Ctarget-cpu=znver5
+ rustflags-$(CONFIG_MNATIVE_INTEL) += -Ctarget-cpu=native
+ rustflags-$(CONFIG_MNATIVE_AMD) += -Ctarget-cpu=native
+ rustflags-$(CONFIG_MATOM) += -Ctarget-cpu=bonnell
+ rustflags-$(CONFIG_MCORE2) += -Ctarget-cpu=core2
+ rustflags-$(CONFIG_MNEHALEM) += -Ctarget-cpu=nehalem
+ rustflags-$(CONFIG_MWESTMERE) += -Ctarget-cpu=westmere
+ rustflags-$(CONFIG_MSILVERMONT) += -Ctarget-cpu=silvermont

View File

@@ -1,60 +0,0 @@
From 44295ad130b8735cecb288dd7463a14892803d9b Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Tue, 1 Oct 2024 02:05:12 +0200
Subject: ZEN: Fixup graysky's more-ISA-levels-and-uarches
See: https://github.com/graysky2/kernel_compiler_patch/issues/105
---
arch/x86/Kconfig.cpu | 4 ----
arch/x86/Makefile | 4 ----
arch/x86/include/asm/vermagic.h | 6 ++++++
3 files changed, 6 insertions(+), 8 deletions(-)
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -603,10 +603,6 @@ config MNATIVE_AMD
endchoice
-config SUPPORT_MARCH_CODEVERS
- bool
- default y if (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
-
config X86_GENERIC
bool "Generic x86 support"
depends on X86_32
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -177,8 +177,6 @@ else
# FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
cflags-$(CONFIG_MK8) += -march=k8
cflags-$(CONFIG_MPSC) += -march=nocona
- cflags-$(CONFIG_MCORE2) += -march=core2
- cflags-$(CONFIG_MATOM) += -march=atom
ifeq ($(CONFIG_X86_64_VERSION),1)
cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic
rustflags-$(CONFIG_GENERIC_CPU) += -Ztune-cpu=generic
@@ -230,8 +228,6 @@ else
rustflags-$(CONFIG_MK8) += -Ctarget-cpu=k8
rustflags-$(CONFIG_MPSC) += -Ctarget-cpu=nocona
- rustflags-$(CONFIG_MCORE2) += -Ctarget-cpu=core2
- rustflags-$(CONFIG_MATOM) += -Ctarget-cpu=atom
rustflags-$(CONFIG_MK8SSE3) += -Ctarget-cpu=k8-sse3
rustflags-$(CONFIG_MK10) += -Ctarget-cpu=amdfam10
rustflags-$(CONFIG_MBARCELONA) += -Ctarget-cpu=barcelona
--- a/arch/x86/include/asm/vermagic.h
+++ b/arch/x86/include/asm/vermagic.h
@@ -105,6 +105,12 @@
#define MODULE_PROC_FAMILY "ZEN "
#elif defined CONFIG_MZEN2
#define MODULE_PROC_FAMILY "ZEN2 "
+#elif defined CONFIG_MZEN3
+#define MODULE_PROC_FAMILY "ZEN3 "
+#elif defined CONFIG_MZEN4
+#define MODULE_PROC_FAMILY "ZEN4 "
+#elif defined CONFIG_MZEN5
+#define MODULE_PROC_FAMILY "ZEN5 "
#elif defined CONFIG_MELAN
#define MODULE_PROC_FAMILY "ELAN "
#elif defined CONFIG_MCRUSOE

View File

@@ -1,4 +1,4 @@
From 8dc948926f5b68b16a6a47a8f6e0a2154ac8ef3e Mon Sep 17 00:00:00 2001
From 1fc1195e784540ad1966b57267fc927a87c5d21d Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Sun, 11 Dec 2022 23:51:16 +0100
Subject: ZEN: Restore CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3
@@ -13,7 +13,7 @@ dependency on CONFIG_ARC and adds RUSTFLAGS.
--- a/Makefile
+++ b/Makefile
@@ -814,6 +814,9 @@ KBUILD_CFLAGS += -fno-delete-null-pointe
@@ -812,6 +812,9 @@ KBUILD_CFLAGS += -fno-delete-null-pointe
ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
KBUILD_CFLAGS += -O2
KBUILD_RUSTFLAGS += -Copt-level=2
@@ -25,7 +25,7 @@ dependency on CONFIG_ARC and adds RUSTFLAGS.
KBUILD_RUSTFLAGS += -Copt-level=s
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1416,6 +1416,12 @@ config CC_OPTIMIZE_FOR_PERFORMANCE
@@ -1451,6 +1451,12 @@ config CC_OPTIMIZE_FOR_PERFORMANCE
with the "-O2" compiler flag for best performance and most
helpful compile-time warnings.

View File

@@ -0,0 +1,13 @@
--- a/Makefile
+++ b/Makefile
@@ -820,6 +820,10 @@ KBUILD_CFLAGS += -Os
KBUILD_RUSTFLAGS += -Copt-level=s
endif
+ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
+KBUILD_CFLAGS += $(call cc-option,-fivopts)
+endif
+
# Always set `debug-assertions` and `overflow-checks` because their default
# depends on `opt-level` and `debug-assertions`, respectively.
KBUILD_RUSTFLAGS += -Cdebug-assertions=$(if $(CONFIG_RUST_DEBUG_ASSERTIONS),y,n)

View File

@@ -11,7 +11,7 @@ Signed-off-by: Alexandre Frade <kernel@xanmod.org>
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -70,9 +70,9 @@ export BITS
@@ -74,9 +74,9 @@ export BITS
#
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
#

View File

@@ -1,11 +0,0 @@
--- a/Makefile
+++ b/Makefile
@@ -815,7 +815,7 @@ ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
KBUILD_CFLAGS += -O2
KBUILD_RUSTFLAGS += -Copt-level=2
else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
-KBUILD_CFLAGS += -O3
+KBUILD_CFLAGS += -O3 $(call cc-option,-fivopts)
KBUILD_RUSTFLAGS += -Copt-level=3
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os

View File

@@ -1,6 +1,6 @@
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -70,7 +70,7 @@ export BITS
@@ -74,7 +74,7 @@ export BITS
#
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
#

View File

@@ -0,0 +1,27 @@
From dccbc0ca6c05ae315967a603870d553c231a68a1 Mon Sep 17 00:00:00 2001
From: Alexandre Frade <kernel@xanmod.org>
Date: Mon, 16 Sep 2024 00:55:35 +0000
Subject: [PATCH 02/18] XANMOD: kbuild: Add GCC SMS-based modulo scheduling
flags
Signed-off-by: Alexandre Frade <kernel@xanmod.org>
---
Makefile | 7 ++++
1 file changed, 7 insertions(+)
--- a/Makefile
+++ b/Makefile
@@ -824,6 +824,13 @@ ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
KBUILD_CFLAGS += $(call cc-option,-fivopts)
endif
+ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
+# Perform swing modulo scheduling immediately before the first scheduling pass.
+# This pass looks at innermost loops and reorders their instructions by
+# overlapping different iterations.
+KBUILD_CFLAGS += $(call cc-option,-fmodulo-sched -fmodulo-sched-allow-regmoves)
+endif
+
# Always set `debug-assertions` and `overflow-checks` because their default
# depends on `opt-level` and `debug-assertions`, respectively.
KBUILD_RUSTFLAGS += -Cdebug-assertions=$(if $(CONFIG_RUST_DEBUG_ASSERTIONS),y,n)