From ff4899b8eb0ed1db975ad7b11a68b3fd25920937 Mon Sep 17 00:00:00 2001 From: graysky Date: Mon, 26 Feb 2018 16:11:50 -0500 Subject: [PATCH] update for 4.16.x series, fixes #31 --- ...izations_for_gcc_v4.9+_kernel_v4.13+.patch | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v4.13+.patch b/enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v4.13+.patch index dc109c7..1aba143 100644 --- a/enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v4.13+.patch +++ b/enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v4.13+.patch @@ -1,5 +1,5 @@ WARNING -This patch works with gcc versions 4.9+ and with kernel version 4.13+ and should +This patch works with gcc versions 4.9+ and with kernel version 3.15+ and should NOT be applied when compiling on older versions of gcc due to key name changes of the march flags introduced with the version 4.9 release of gcc.[1] @@ -53,7 +53,7 @@ See the following experimental evidence supporting this statement: https://github.com/graysky2/kernel_gcc_patch REQUIREMENTS -linux version >=4.13 +linux version >=3.15 gcc version >=4.9 ACKNOWLEDGMENTS @@ -66,9 +66,9 @@ REFERENCES 4. https://github.com/graysky2/kernel_gcc_patch/issues/15 5. http://www.linuxforge.net/docs/linux/linux-gcc.php ---- a/arch/x86/include/asm/module.h 2017-08-20 17:13:52.000000000 -0400 -+++ b/arch/x86/include/asm/module.h 2017-08-30 15:01:39.323841564 -0400 -@@ -15,6 +15,24 @@ +--- a/arch/x86/include/asm/module.h 2018-02-25 21:50:41.000000000 -0500 ++++ b/arch/x86/include/asm/module.h 2018-02-26 15:37:52.684596240 -0500 +@@ -25,6 +25,24 @@ struct mod_arch_specific { #define MODULE_PROC_FAMILY "586MMX " #elif defined CONFIG_MCORE2 #define MODULE_PROC_FAMILY "CORE2 " @@ -93,7 +93,7 @@ REFERENCES #elif defined CONFIG_MATOM #define MODULE_PROC_FAMILY "ATOM " #elif defined CONFIG_M686 -@@ -33,6 +51,26 @@ +@@ -43,6 +61,26 @@ struct mod_arch_specific { #define MODULE_PROC_FAMILY "K7 " #elif defined CONFIG_MK8 #define MODULE_PROC_FAMILY "K8 " @@ -120,9 +120,9 @@ REFERENCES #elif defined CONFIG_MELAN #define MODULE_PROC_FAMILY "ELAN " #elif defined CONFIG_MCRUSOE ---- a/arch/x86/Kconfig.cpu 2017-08-20 17:13:52.000000000 -0400 -+++ b/arch/x86/Kconfig.cpu 2017-08-30 15:01:39.323841564 -0400 -@@ -115,6 +115,7 @@ config MPENTIUMM +--- a/arch/x86/Kconfig.cpu 2018-02-25 21:50:41.000000000 -0500 ++++ b/arch/x86/Kconfig.cpu 2018-02-26 15:46:09.886742109 -0500 +@@ -116,6 +116,7 @@ config MPENTIUMM config MPENTIUM4 bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon" depends on X86_32 @@ -130,7 +130,7 @@ REFERENCES ---help--- Select this for Intel Pentium 4 chips. This includes the Pentium 4, Pentium D, P4-based Celeron and Xeon, and -@@ -147,9 +148,8 @@ config MPENTIUM4 +@@ -148,9 +149,8 @@ config MPENTIUM4 -Paxville -Dempsey @@ -141,7 +141,7 @@ REFERENCES depends on X86_32 ---help--- Select this for an AMD K6-family processor. Enables use of -@@ -157,7 +157,7 @@ config MK6 +@@ -158,7 +158,7 @@ config MK6 flags to GCC. config MK7 @@ -150,7 +150,7 @@ REFERENCES depends on X86_32 ---help--- Select this for an AMD Athlon K7-family processor. Enables use of -@@ -165,12 +165,83 @@ config MK7 +@@ -166,12 +166,83 @@ config MK7 flags to GCC. config MK8 @@ -235,7 +235,7 @@ REFERENCES config MCRUSOE bool "Crusoe" depends on X86_32 -@@ -252,6 +323,7 @@ config MVIAC7 +@@ -253,6 +324,7 @@ config MVIAC7 config MPSC bool "Intel P4 / older Netburst based Xeon" @@ -243,7 +243,7 @@ REFERENCES depends on X86_64 ---help--- Optimize for Intel Pentium 4, Pentium D and older Nocona/Dempsey -@@ -261,8 +333,19 @@ config MPSC +@@ -262,8 +334,19 @@ config MPSC using the cpu family field in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one. @@ -264,7 +264,7 @@ REFERENCES ---help--- Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and -@@ -270,14 +353,79 @@ config MCORE2 +@@ -271,14 +354,79 @@ config MCORE2 family in /proc/cpuinfo. Newer ones have 6 and older ones 15 (not a typo) @@ -350,7 +350,7 @@ REFERENCES config GENERIC_CPU bool "Generic-x86-64" -@@ -286,6 +434,19 @@ config GENERIC_CPU +@@ -287,6 +435,19 @@ config GENERIC_CPU Generic x86-64 CPU. Run equally well on all x86-64 CPUs. @@ -370,7 +370,7 @@ REFERENCES endchoice config X86_GENERIC -@@ -310,7 +471,7 @@ config X86_INTERNODE_CACHE_SHIFT +@@ -311,7 +472,7 @@ config X86_INTERNODE_CACHE_SHIFT config X86_L1_CACHE_SHIFT int default "7" if MPENTIUM4 || MPSC @@ -379,7 +379,7 @@ REFERENCES default "4" if MELAN || M486 || MGEODEGX1 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX -@@ -341,45 +502,46 @@ config X86_ALIGNMENT_16 +@@ -342,35 +503,36 @@ config X86_ALIGNMENT_16 config X86_INTEL_USERCOPY def_bool y @@ -433,10 +433,7 @@ REFERENCES config X86_CMPXCHG64 def_bool y -- depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM -+ depends on X86_PAE || X86_64 || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM || MNATIVE - - # this should be set for all -march=.. options where the compiler +@@ -380,7 +542,7 @@ config X86_CMPXCHG64 # generates cmov. config X86_CMOV def_bool y @@ -445,9 +442,9 @@ REFERENCES config X86_MINIMUM_CPU_FAMILY int ---- a/arch/x86/Makefile 2017-08-20 17:13:52.000000000 -0400 -+++ b/arch/x86/Makefile 2017-08-30 15:01:39.323841564 -0400 -@@ -121,13 +121,40 @@ else +--- a/arch/x86/Makefile 2018-02-25 21:50:41.000000000 -0500 ++++ b/arch/x86/Makefile 2018-02-26 15:37:52.685596255 -0500 +@@ -124,13 +124,40 @@ else KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup) # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu) @@ -491,9 +488,9 @@ REFERENCES cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic) KBUILD_CFLAGS += $(cflags-y) ---- a/arch/x86/Makefile_32.cpu 2017-08-20 17:13:52.000000000 -0400 -+++ b/arch/x86/Makefile_32.cpu 2017-08-30 15:03:01.408333493 -0400 -@@ -22,7 +22,18 @@ cflags-$(CONFIG_MK6) += -march=k6 +--- a/arch/x86/Makefile_32.cpu 2018-02-25 21:50:41.000000000 -0500 ++++ b/arch/x86/Makefile_32.cpu 2018-02-26 15:37:52.686596269 -0500 +@@ -23,7 +23,18 @@ cflags-$(CONFIG_MK6) += -march=k6 # Please note, that patches that add -march=athlon-xp and friends are pointless. # They make zero difference whatsosever to performance at this time. cflags-$(CONFIG_MK7) += -march=athlon @@ -512,7 +509,7 @@ REFERENCES cflags-$(CONFIG_MCRUSOE) += -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0 cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) -falign-functions=0 -falign-jumps=0 -falign-loops=0 cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) -@@ -31,8 +42,16 @@ cflags-$(CONFIG_MCYRIXIII) += $(call cc- +@@ -32,8 +43,16 @@ cflags-$(CONFIG_MCYRIXIII) += $(call cc- cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686) cflags-$(CONFIG_MVIAC7) += -march=i686 cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2)