Gentoo Archives: gentoo-commits

From: Alice Ferrazzi <alicef@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.4 commit in: /
Date: Fri, 03 Sep 2021 09:39:13
Message-Id: 1630661929.48a4a18ffa00979c7e9b60c218de7ca7b1445497.alicef@gentoo
1 commit: 48a4a18ffa00979c7e9b60c218de7ca7b1445497
2 Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 3 09:23:47 2021 +0000
4 Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 3 09:38:49 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=48a4a18f
7
8 Bump 20210818 from commit f1d0af2c9d807b137909e98c11caf7504f4e2066
9
10 Signed-off-by: Alice Ferrazzi <alicef <AT> gentoo.org>
11
12 5010_enable-cpu-optimizations-universal.patch | 79 +++++++++++++--------------
13 1 file changed, 38 insertions(+), 41 deletions(-)
14
15 diff --git a/5010_enable-cpu-optimizations-universal.patch b/5010_enable-cpu-optimizations-universal.patch
16 index 2cc90b0..5b7cb95 100644
17 --- a/5010_enable-cpu-optimizations-universal.patch
18 +++ b/5010_enable-cpu-optimizations-universal.patch
19 @@ -1,24 +1,18 @@
20 -From cda27318e4b73d20f0edb497dd86ed4c1d051ad6 Mon Sep 17 00:00:00 2001
21 +From 9abcc823066eabbe75ef07c9ce977757b538bf4f Mon Sep 17 00:00:00 2001
22 From: graysky <graysky@×××××××××.us>
23 -Date: Mon, 12 Apr 2021 07:14:01 -0400
24 +Date: Sun, 6 Jun 2021 09:28:29 -0400
25 Subject: [PATCH] more uarches for kernel 4.19-5.4
26 MIME-Version: 1.0
27 Content-Type: text/plain; charset=UTF-8
28 Content-Transfer-Encoding: 8bit
29
30 -WARNING
31 -This patch works with all gcc versions 9.0+ and with kernel version 4.19-5.4
32 -and should NOT be applied when compiling on older versions of gcc due to key
33 -name changes of the march flags introduced with the version 4.9 release of
34 -gcc.[1]
35 -
36 FEATURES
37 This patch adds additional CPU options to the Linux kernel accessible under:
38 Processor type and features --->
39 Processor family --->
40
41 -With the release of gcc 11.0, several generic 64-bit levels are offered which
42 -are good for supported Intel or AMD CPUs:
43 +With the release of gcc 11.1 and clang 12.0, several generic 64-bit levels are
44 +offered which are good for supported Intel or AMD CPUs:
45 • x86-64-v2
46 • x86-64-v3
47 • x86-64-v4
48 @@ -27,7 +21,7 @@ Users of glibc 2.33 and above can see which level is supported by current
49 hardware by running:
50 /lib/ld-linux-x86-64.so.2 --help | grep supported
51
52 -Alternatively, compare the flags from /proc/cpuinfo to this list.[2]
53 +Alternatively, compare the flags from /proc/cpuinfo to this list.[1]
54
55 CPU-specific microarchitectures include:
56 • AMD Improved K8-family
57 @@ -63,13 +57,15 @@ CPU-specific microarchitectures include:
58 • Intel 12th Gen i3/i5/i7/i9-family (Alder Lake)‡
59
60 Notes: If not otherwise noted, gcc >=9.1 is required for support.
61 - *Requires gcc >=10.1 †Required gcc >=10.3 ‡Required gcc >=11.0
62 + *Requires gcc >=10.1 or clang >=10.0
63 + †Required gcc >=10.3 or clang >=12.0
64 + ‡Required gcc >=11.1 or clang >=12.0
65
66 It also offers to compile passing the 'native' option which, "selects the CPU
67 to generate code for at compilation time by determining the processor type of
68 the compiling machine. Using -march=native enables all instruction subsets
69 supported by the local machine and will produce code optimized for the local
70 -machine under the constraints of the selected instruction set."[3]
71 +machine under the constraints of the selected instruction set."[2]
72
73 Users of Intel CPUs should select the 'Intel-Native' option and users of AMD
74 CPUs should select the 'AMD-Native' option.
75 @@ -77,9 +73,9 @@ CPUs should select the 'AMD-Native' option.
76 MINOR NOTES RELATING TO INTEL ATOM PROCESSORS
77 This patch also changes -march=atom to -march=bonnell in accordance with the
78 gcc v4.9 changes. Upstream is using the deprecated -match=atom flags when I
79 -believe it should use the newer -march=bonnell flag for atom processors.[4]
80 +believe it should use the newer -march=bonnell flag for atom processors.[3]
81
82 -It is not recommended to compile on Atom-CPUs with the 'native' option.[5] The
83 +It is not recommended to compile on Atom-CPUs with the 'native' option.[4] The
84 recommendation is to use the 'atom' option instead.
85
86 BENEFITS
87 @@ -91,18 +87,19 @@ https://github.com/graysky2/kernel_gcc_patch
88
89 REQUIREMENTS
90 linux version 4.19-5.4
91 -gcc version >=9.0
92 +gcc version >=9.0 or clang version >=9.0
93
94 ACKNOWLEDGMENTS
95 -This patch builds on the seminal work by Jeroen.[6]
96 +This patch builds on the seminal work by Jeroen.[5]
97
98 REFERENCES
99 -1. https://gcc.gnu.org/gcc-4.9/changes.html
100 -2. https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/77566eb03bc6a326811cb7e9
101 -3. https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html#index-x86-Options
102 -4. https://bugzilla.kernel.org/show_bug.cgi?id=77461
103 -5. https://github.com/graysky2/kernel_gcc_patch/issues/15
104 -6. http://www.linuxforge.net/docs/linux/linux-gcc.php
105 +1. https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/77566eb03bc6a326811cb7e9
106 +2. https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html#index-x86-Options
107 +3. https://bugzilla.kernel.org/show_bug.cgi?id=77461
108 +4. https://github.com/graysky2/kernel_gcc_patch/issues/15
109 +5. http://www.linuxforge.net/docs/linux/linux-gcc.php
110 +
111 +Signed-off-by: graysky <graysky@×××××××××.us>
112 ---
113 arch/x86/Kconfig.cpu | 333 ++++++++++++++++++++++++++++++++--
114 arch/x86/Makefile | 47 ++++-
115 @@ -110,7 +107,7 @@ REFERENCES
116 3 files changed, 428 insertions(+), 18 deletions(-)
117
118 diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
119 -index 8e29c991ba3e..bc76256532bb 100644
120 +index 8e29c991ba3e..c74f92492a2e 100644
121 --- a/arch/x86/Kconfig.cpu
122 +++ b/arch/x86/Kconfig.cpu
123 @@ -148,9 +148,8 @@ config MPENTIUM4
124 @@ -224,7 +221,7 @@ index 8e29c991ba3e..bc76256532bb 100644
125 +
126 +config MZEN3
127 + bool "AMD Zen 3"
128 -+ depends on GCC_VERSION > 100300
129 ++ depends on (CC_IS_GCC && GCC_VERSION >= 100300) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
130 + ---help---
131 + Select this for AMD Family 19h Zen 3 processors.
132 +
133 @@ -383,7 +380,7 @@ index 8e29c991ba3e..bc76256532bb 100644
134 +
135 +config MCOOPERLAKE
136 + bool "Intel Cooper Lake"
137 -+ depends on GCC_VERSION > 100100
138 ++ depends on (CC_IS_GCC && GCC_VERSION > 100100) || (CC_IS_CLANG && CLANG_VERSION >= 100000)
139 + select X86_P6_NOP
140 + ---help---
141 +
142 @@ -393,7 +390,7 @@ index 8e29c991ba3e..bc76256532bb 100644
143 +
144 +config MTIGERLAKE
145 + bool "Intel Tiger Lake"
146 -+ depends on GCC_VERSION > 100100
147 ++ depends on (CC_IS_GCC && GCC_VERSION > 100100) || (CC_IS_CLANG && CLANG_VERSION >= 100000)
148 + select X86_P6_NOP
149 + ---help---
150 +
151 @@ -403,7 +400,7 @@ index 8e29c991ba3e..bc76256532bb 100644
152 +
153 +config MSAPPHIRERAPIDS
154 + bool "Intel Sapphire Rapids"
155 -+ depends on GCC_VERSION > 110000
156 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
157 + select X86_P6_NOP
158 + ---help---
159 +
160 @@ -413,7 +410,7 @@ index 8e29c991ba3e..bc76256532bb 100644
161 +
162 +config MROCKETLAKE
163 + bool "Intel Rocket Lake"
164 -+ depends on GCC_VERSION > 110000
165 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
166 + select X86_P6_NOP
167 + ---help---
168 +
169 @@ -423,7 +420,7 @@ index 8e29c991ba3e..bc76256532bb 100644
170 +
171 +config MALDERLAKE
172 + bool "Intel Alder Lake"
173 -+ depends on GCC_VERSION > 110000
174 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
175 + select X86_P6_NOP
176 + ---help---
177 +
178 @@ -440,7 +437,7 @@ index 8e29c991ba3e..bc76256532bb 100644
179
180 +config GENERIC_CPU2
181 + bool "Generic-x86-64-v2"
182 -+ depends on GCC_VERSION > 110000
183 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
184 + depends on X86_64
185 + ---help---
186 + Generic x86-64 CPU.
187 @@ -448,7 +445,7 @@ index 8e29c991ba3e..bc76256532bb 100644
188 +
189 +config GENERIC_CPU3
190 + bool "Generic-x86-64-v3"
191 -+ depends on GCC_VERSION > 110000
192 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
193 + depends on X86_64
194 + ---help---
195 + Generic x86-64-v3 CPU with v3 instructions.
196 @@ -456,18 +453,18 @@ index 8e29c991ba3e..bc76256532bb 100644
197 +
198 +config GENERIC_CPU4
199 + bool "Generic-x86-64-v4"
200 -+ depends on GCC_VERSION > 110000
201 ++ depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
202 + depends on X86_64
203 + ---help---
204 + Generic x86-64 CPU with v4 instructions.
205 + Run equally well on all x86-64 CPUs with min support of x86-64-v4.
206 +
207 +config MNATIVE_INTEL
208 -+ bool "Intel-Native optimizations autodetected by GCC"
209 ++ bool "Intel-Native optimizations autodetected by the compiler"
210 + ---help---
211 +
212 -+ GCC 4.2 and above support -march=native, which automatically detects
213 -+ the optimum settings to use based on your processor. Do NOT use this
214 ++ Clang 3.8 and GCC 4.2 and above support -march=native, which automatically
215 ++ detects the optimum settings to use based on your processor. Do NOT use this
216 + for AMD CPUs. Intel Only!
217 +
218 + Enables -march=native
219 @@ -476,9 +473,9 @@ index 8e29c991ba3e..bc76256532bb 100644
220 + bool "AMD-Native optimizations autodetected by GCC"
221 + ---help---
222 +
223 -+ GCC 4.2 and above support -march=native, which automatically detects
224 -+ the optimum settings to use based on your processor. Do NOT use this
225 -+ for AMD CPUs. AMD Only!
226 ++ Clang 3.8 and GCC 4.2 and above support -march=native, which automatically
227 ++ detects the optimum settings to use based on your processor. Do NOT use this
228 ++ for Intel CPUs. AMD Only!
229 +
230 + Enables -march=native
231 +
232 @@ -541,10 +538,10 @@ index 8e29c991ba3e..bc76256532bb 100644
233 default "4"
234
235 diff --git a/arch/x86/Makefile b/arch/x86/Makefile
236 -index 94df0868804b..09b1905de4cb 100644
237 +index 69f0cb01c666..3d9e20a11f1b 100644
238 --- a/arch/x86/Makefile
239 +++ b/arch/x86/Makefile
240 -@@ -121,11 +121,48 @@ else
241 +@@ -125,11 +125,48 @@ else
242 # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
243 cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
244 cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)