Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Fri, 30 Apr 2021 19:02:58
Message-Id: 1619809359.f313e958177a633561f7f951a063fd5f64e01976.mpagano@gentoo
1 commit: f313e958177a633561f7f951a063fd5f64e01976
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 30 19:02:39 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 30 19:02:39 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=f313e958
7
8 Rename cpu opt patch to standardize on naming format
9
10 Remove redundant patches
11
12 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
13
14 0000_README | 12 +-
15 ...> 5010_enable-cpu-optimizations-universal.patch | 288 +++++++----
16 5011_enable-cpu-optimizations-for-gcc8.patch | 569 ---------------------
17 5012_enable-cpu-optimizations-for-gcc91.patch | 549 --------------------
18 4 files changed, 204 insertions(+), 1214 deletions(-)
19
20 diff --git a/0000_README b/0000_README
21 index 2d7a098..e6e43df 100644
22 --- a/0000_README
23 +++ b/0000_README
24 @@ -819,14 +819,6 @@ Patch: 4567_distro-Gentoo-Kconfig.patch
25 From: Tom Wijsman <TomWij@g.o>
26 Desc: Add Gentoo Linux support config settings and defaults.
27
28 -Patch: 5011_enable-cpu-optimizations-for-gcc8.patch
29 +Patch: 5010_enable-cpu-optimizations-universal.patch
30 From: https://github.com/graysky2/kernel_gcc_patch/
31 -Desc: Kernel patch for >= gccv8 enables kernel >= v4.13 optimizations for additional CPUs.
32 -
33 -Patch: 5012_enable-cpu-optimizations-for-gcc91.patch
34 -From: https://github.com/graysky2/kernel_gcc_patch/
35 -Desc: Kernel patch enables gcc >= v9.1 optimizations for additional CPUs.
36 -
37 -Patch: 5013_enable-cpu-optimizations-for-gcc10.patch
38 -From: https://github.com/graysky2/kernel_gcc_patch/
39 -Desc: Kernel patch enables gcc = v10.1+ optimizations for additional CPUs.
40 +Desc: Kernel 4.19-5.4 patch enables gcc = v9+ optimizations for additional CPUs.
41
42 diff --git a/5013_enable-cpu-optimizations-for-gcc10.patch b/5010_enable-cpu-optimizations-universal.patch
43 similarity index 64%
44 rename from 5013_enable-cpu-optimizations-for-gcc10.patch
45 rename to 5010_enable-cpu-optimizations-universal.patch
46 index 6951f13..2cc90b0 100644
47 --- a/5013_enable-cpu-optimizations-for-gcc10.patch
48 +++ b/5010_enable-cpu-optimizations-universal.patch
49 @@ -1,64 +1,85 @@
50 -From cde505774da8b00eb3a67513488b417fadb8e2c3 Mon Sep 17 00:00:00 2001
51 +From cda27318e4b73d20f0edb497dd86ed4c1d051ad6 Mon Sep 17 00:00:00 2001
52 From: graysky <graysky@×××××××××.us>
53 -Date: Mon, 8 Mar 2021 15:44:59 -0500
54 -Subject: [PATCH] more-uarches-for-gcc-v10-and-kernel-4.19-v5.4
55 +Date: Mon, 12 Apr 2021 07:14:01 -0400
56 +Subject: [PATCH] more uarches for kernel 4.19-5.4
57 +MIME-Version: 1.0
58 +Content-Type: text/plain; charset=UTF-8
59 +Content-Transfer-Encoding: 8bit
60
61 WARNING
62 -This patch works with gcc versions 10.1+ and with kernel versions 4.19-5.4 and
63 -NOT be applied when compiling on older versions of gcc due to key name changes
64 -of the march flags introduced with the version 4.9 release of gcc.[1]
65 -
66 -Use the older version of this patch hosted on the same github for older
67 -versions of gcc.
68 +This patch works with all gcc versions 9.0+ and with kernel version 4.19-5.4
69 +and should NOT be applied when compiling on older versions of gcc due to key
70 +name changes of the march flags introduced with the version 4.9 release of
71 +gcc.[1]
72
73 FEATURES
74 This patch adds additional CPU options to the Linux kernel accessible under:
75 Processor type and features --->
76 Processor family --->
77
78 -The expanded microarchitectures include:
79 -* AMD Improved K8-family
80 -* AMD K10-family
81 -* AMD Family 10h (Barcelona)
82 -* AMD Family 14h (Bobcat)
83 -* AMD Family 16h (Jaguar)
84 -* AMD Family 15h (Bulldozer)
85 -* AMD Family 15h (Piledriver)
86 -* AMD Family 15h (Steamroller)
87 -* AMD Family 15h (Excavator)
88 -* AMD Family 17h (Zen)
89 -* AMD Family 17h (Zen 2)
90 -* Intel Silvermont low-power processors
91 -* Intel Goldmont low-power processors (Apollo Lake and Denverton)
92 -* Intel Goldmont Plus low-power processors (Gemini Lake)
93 -* Intel 1st Gen Core i3/i5/i7 (Nehalem)
94 -* Intel 1.5 Gen Core i3/i5/i7 (Westmere)
95 -* Intel 2nd Gen Core i3/i5/i7 (Sandybridge)
96 -* Intel 3rd Gen Core i3/i5/i7 (Ivybridge)
97 -* Intel 4th Gen Core i3/i5/i7 (Haswell)
98 -* Intel 5th Gen Core i3/i5/i7 (Broadwell)
99 -* Intel 6th Gen Core i3/i5/i7 (Skylake)
100 -* Intel 6th Gen Core i7/i9 (Skylake X)
101 -* Intel 8th Gen Core i3/i5/i7 (Cannon Lake)
102 -* Intel 10th Gen Core i7/i9 (Ice Lake)
103 -* Intel Xeon (Cascade Lake)
104 -* Intel Xeon (Cooper Lake)
105 -* Intel 3rd Gen 10nm++ i3/i5/i7/i9-family (Tiger Lake)
106 +With the release of gcc 11.0, several generic 64-bit levels are offered which
107 +are good for supported Intel or AMD CPUs:
108 +• x86-64-v2
109 +• x86-64-v3
110 +• x86-64-v4
111 +
112 +Users of glibc 2.33 and above can see which level is supported by current
113 +hardware by running:
114 + /lib/ld-linux-x86-64.so.2 --help | grep supported
115 +
116 +Alternatively, compare the flags from /proc/cpuinfo to this list.[2]
117 +
118 +CPU-specific microarchitectures include:
119 +• AMD Improved K8-family
120 +• AMD K10-family
121 +• AMD Family 10h (Barcelona)
122 +• AMD Family 14h (Bobcat)
123 +• AMD Family 16h (Jaguar)
124 +• AMD Family 15h (Bulldozer)
125 +• AMD Family 15h (Piledriver)
126 +• AMD Family 15h (Steamroller)
127 +• AMD Family 15h (Excavator)
128 +• AMD Family 17h (Zen)
129 +• AMD Family 17h (Zen 2)
130 +• AMD Family 19h (Zen 3)†
131 +• Intel Silvermont low-power processors
132 +• Intel Goldmont low-power processors (Apollo Lake and Denverton)
133 +• Intel Goldmont Plus low-power processors (Gemini Lake)
134 +• Intel 1st Gen Core i3/i5/i7 (Nehalem)
135 +• Intel 1.5 Gen Core i3/i5/i7 (Westmere)
136 +• Intel 2nd Gen Core i3/i5/i7 (Sandybridge)
137 +• Intel 3rd Gen Core i3/i5/i7 (Ivybridge)
138 +• Intel 4th Gen Core i3/i5/i7 (Haswell)
139 +• Intel 5th Gen Core i3/i5/i7 (Broadwell)
140 +• Intel 6th Gen Core i3/i5/i7 (Skylake)
141 +• Intel 6th Gen Core i7/i9 (Skylake X)
142 +• Intel 8th Gen Core i3/i5/i7 (Cannon Lake)
143 +• Intel 10th Gen Core i7/i9 (Ice Lake)
144 +• Intel Xeon (Cascade Lake)
145 +• Intel Xeon (Cooper Lake)*
146 +• Intel 3rd Gen 10nm++ i3/i5/i7/i9-family (Tiger Lake)*
147 +• Intel 3rd Gen 10nm++ Xeon (Sapphire Rapids)‡
148 +• Intel 11th Gen i3/i5/i7/i9-family (Rocket Lake)‡
149 +• Intel 12th Gen i3/i5/i7/i9-family (Alder Lake)‡
150 +
151 +Notes: If not otherwise noted, gcc >=9.1 is required for support.
152 + *Requires gcc >=10.1 †Required gcc >=10.3 ‡Required gcc >=11.0
153
154 It also offers to compile passing the 'native' option which, "selects the CPU
155 to generate code for at compilation time by determining the processor type of
156 the compiling machine. Using -march=native enables all instruction subsets
157 supported by the local machine and will produce code optimized for the local
158 -machine under the constraints of the selected instruction set."[2]
159 +machine under the constraints of the selected instruction set."[3]
160
161 -Do NOT use 'native' when building for AMD chips! Intel ONLY!
162 +Users of Intel CPUs should select the 'Intel-Native' option and users of AMD
163 +CPUs should select the 'AMD-Native' option.
164
165 -MINOR NOTES
166 -This patch also changes 'atom' to 'bonnell' in accordance with the gcc v4.9
167 -changes. Note that upstream is using the deprecated 'match=atom' flags when I
168 -believe it should use the newer 'march=bonnell' flag for atom processors.[3]
169 +MINOR NOTES RELATING TO INTEL ATOM PROCESSORS
170 +This patch also changes -march=atom to -march=bonnell in accordance with the
171 +gcc v4.9 changes. Upstream is using the deprecated -match=atom flags when I
172 +believe it should use the newer -march=bonnell flag for atom processors.[4]
173
174 -It is not recommended to compile on Atom-CPUs with the 'native' option.[4] The
175 +It is not recommended to compile on Atom-CPUs with the 'native' option.[5] The
176 recommendation is to use the 'atom' option instead.
177
178 BENEFITS
179 @@ -69,38 +90,41 @@ See the following experimental evidence supporting this statement:
180 https://github.com/graysky2/kernel_gcc_patch
181
182 REQUIREMENTS
183 -linux version 4.19-lts and 5.4-lts
184 -gcc version >=10.1
185 +linux version 4.19-5.4
186 +gcc version >=9.0
187
188 ACKNOWLEDGMENTS
189 -This patch builds on the seminal work by Jeroen.[5]
190 +This patch builds on the seminal work by Jeroen.[6]
191
192 REFERENCES
193 1. https://gcc.gnu.org/gcc-4.9/changes.html
194 -2. https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
195 -3. https://bugzilla.kernel.org/show_bug.cgi?id=77461
196 -4. https://github.com/graysky2/kernel_gcc_patch/issues/15
197 -5. http://www.linuxforge.net/docs/linux/linux-gcc.php
198 +2. https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/77566eb03bc6a326811cb7e9
199 +3. https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html#index-x86-Options
200 +4. https://bugzilla.kernel.org/show_bug.cgi?id=77461
201 +5. https://github.com/graysky2/kernel_gcc_patch/issues/15
202 +6. http://www.linuxforge.net/docs/linux/linux-gcc.php
203 ---
204 - arch/x86/Kconfig.cpu | 258 ++++++++++++++++++++++++++++++++--
205 - arch/x86/Makefile | 39 ++++-
206 - arch/x86/include/asm/module.h | 56 ++++++++
207 - 3 files changed, 336 insertions(+), 17 deletions(-)
208 + arch/x86/Kconfig.cpu | 333 ++++++++++++++++++++++++++++++++--
209 + arch/x86/Makefile | 47 ++++-
210 + arch/x86/include/asm/module.h | 66 +++++++
211 + 3 files changed, 428 insertions(+), 18 deletions(-)
212
213 diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
214 -index 8e29c991ba3e..a1a12d8dfc50 100644
215 +index 8e29c991ba3e..bc76256532bb 100644
216 --- a/arch/x86/Kconfig.cpu
217 +++ b/arch/x86/Kconfig.cpu
218 -@@ -150,7 +150,7 @@ config MPENTIUM4
219 -
220 +@@ -148,9 +148,8 @@ config MPENTIUM4
221 + -Paxville
222 + -Dempsey
223
224 +-
225 config MK6
226 - bool "K6/K6-II/K6-III"
227 + bool "AMD K6/K6-II/K6-III"
228 depends on X86_32
229 ---help---
230 Select this for an AMD K6-family processor. Enables use of
231 -@@ -158,7 +158,7 @@ config MK6
232 +@@ -158,7 +157,7 @@ config MK6
233 flags to GCC.
234
235 config MK7
236 @@ -109,7 +133,7 @@ index 8e29c991ba3e..a1a12d8dfc50 100644
237 depends on X86_32
238 ---help---
239 Select this for an AMD Athlon K7-family processor. Enables use of
240 -@@ -166,12 +166,90 @@ config MK7
241 +@@ -166,12 +165,98 @@ config MK7
242 flags to GCC.
243
244 config MK8
245 @@ -197,11 +221,19 @@ index 8e29c991ba3e..a1a12d8dfc50 100644
246 + Select this for AMD Family 17h Zen 2 processors.
247 +
248 + Enables -march=znver2
249 ++
250 ++config MZEN3
251 ++ bool "AMD Zen 3"
252 ++ depends on GCC_VERSION > 100300
253 ++ ---help---
254 ++ Select this for AMD Family 19h Zen 3 processors.
255 ++
256 ++ Enables -march=znver3
257 +
258 config MCRUSOE
259 bool "Crusoe"
260 depends on X86_32
261 -@@ -263,7 +341,7 @@ config MPSC
262 +@@ -263,7 +348,7 @@ config MPSC
263 in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one.
264
265 config MCORE2
266 @@ -210,7 +242,7 @@ index 8e29c991ba3e..a1a12d8dfc50 100644
267 ---help---
268
269 Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and
270 -@@ -271,6 +349,8 @@ config MCORE2
271 +@@ -271,6 +356,8 @@ config MCORE2
272 family in /proc/cpuinfo. Newer ones have 6 and older ones 15
273 (not a typo)
274
275 @@ -219,7 +251,7 @@ index 8e29c991ba3e..a1a12d8dfc50 100644
276 config MATOM
277 bool "Intel Atom"
278 ---help---
279 -@@ -280,6 +360,150 @@ config MATOM
280 +@@ -280,6 +367,182 @@ config MATOM
281 accordingly optimized code. Use a recent GCC with specific Atom
282 support in order to fully benefit from selecting this option.
283
284 @@ -351,6 +383,7 @@ index 8e29c991ba3e..a1a12d8dfc50 100644
285 +
286 +config MCOOPERLAKE
287 + bool "Intel Cooper Lake"
288 ++ depends on GCC_VERSION > 100100
289 + select X86_P6_NOP
290 + ---help---
291 +
292 @@ -360,22 +393,77 @@ index 8e29c991ba3e..a1a12d8dfc50 100644
293 +
294 +config MTIGERLAKE
295 + bool "Intel Tiger Lake"
296 ++ depends on GCC_VERSION > 100100
297 + select X86_P6_NOP
298 + ---help---
299 +
300 + Select this for third-generation 10 nm process processors in the Tiger Lake family.
301 +
302 + Enables -march=tigerlake
303 ++
304 ++config MSAPPHIRERAPIDS
305 ++ bool "Intel Sapphire Rapids"
306 ++ depends on GCC_VERSION > 110000
307 ++ select X86_P6_NOP
308 ++ ---help---
309 ++
310 ++ Select this for third-generation 10 nm process processors in the Sapphire Rapids family.
311 ++
312 ++ Enables -march=sapphirerapids
313 ++
314 ++config MROCKETLAKE
315 ++ bool "Intel Rocket Lake"
316 ++ depends on GCC_VERSION > 110000
317 ++ select X86_P6_NOP
318 ++ ---help---
319 ++
320 ++ Select this for eleventh-generation processors in the Rocket Lake family.
321 ++
322 ++ Enables -march=rocketlake
323 ++
324 ++config MALDERLAKE
325 ++ bool "Intel Alder Lake"
326 ++ depends on GCC_VERSION > 110000
327 ++ select X86_P6_NOP
328 ++ ---help---
329 ++
330 ++ Select this for twelfth-generation processors in the Alder Lake family.
331 ++
332 ++ Enables -march=alderlake
333 +
334 config GENERIC_CPU
335 bool "Generic-x86-64"
336 depends on X86_64
337 -@@ -287,6 +511,16 @@ config GENERIC_CPU
338 +@@ -287,6 +550,50 @@ config GENERIC_CPU
339 Generic x86-64 CPU.
340 Run equally well on all x86-64 CPUs.
341
342 -+config MNATIVE
343 -+ bool "Native optimizations autodetected by GCC"
344 ++config GENERIC_CPU2
345 ++ bool "Generic-x86-64-v2"
346 ++ depends on GCC_VERSION > 110000
347 ++ depends on X86_64
348 ++ ---help---
349 ++ Generic x86-64 CPU.
350 ++ Run equally well on all x86-64 CPUs with min support of x86-64-v2.
351 ++
352 ++config GENERIC_CPU3
353 ++ bool "Generic-x86-64-v3"
354 ++ depends on GCC_VERSION > 110000
355 ++ depends on X86_64
356 ++ ---help---
357 ++ Generic x86-64-v3 CPU with v3 instructions.
358 ++ Run equally well on all x86-64 CPUs with min support of x86-64-v3.
359 ++
360 ++config GENERIC_CPU4
361 ++ bool "Generic-x86-64-v4"
362 ++ depends on GCC_VERSION > 110000
363 ++ depends on X86_64
364 ++ ---help---
365 ++ Generic x86-64 CPU with v4 instructions.
366 ++ Run equally well on all x86-64 CPUs with min support of x86-64-v4.
367 ++
368 ++config MNATIVE_INTEL
369 ++ bool "Intel-Native optimizations autodetected by GCC"
370 + ---help---
371 +
372 + GCC 4.2 and above support -march=native, which automatically detects
373 @@ -383,70 +471,80 @@ index 8e29c991ba3e..a1a12d8dfc50 100644
374 + for AMD CPUs. Intel Only!
375 +
376 + Enables -march=native
377 ++
378 ++config MNATIVE_AMD
379 ++ bool "AMD-Native optimizations autodetected by GCC"
380 ++ ---help---
381 ++
382 ++ GCC 4.2 and above support -march=native, which automatically detects
383 ++ the optimum settings to use based on your processor. Do NOT use this
384 ++ for AMD CPUs. AMD Only!
385 ++
386 ++ Enables -march=native
387 +
388 endchoice
389
390 config X86_GENERIC
391 -@@ -311,7 +545,7 @@ config X86_INTERNODE_CACHE_SHIFT
392 +@@ -311,7 +618,7 @@ config X86_INTERNODE_CACHE_SHIFT
393 config X86_L1_CACHE_SHIFT
394 int
395 default "7" if MPENTIUM4 || MPSC
396 - default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU
397 -+ default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MNATIVE || X86_GENERIC || GENERIC_CPU
398 ++ default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MNATIVE_INTEL || MNATIVE_AMD || X86_GENERIC || GENERIC_CPU || GENERIC_CPU2 || GENERIC_CPU3 || GENERIC_CPU4
399 default "4" if MELAN || M486 || MGEODEGX1
400 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
401
402 -@@ -329,11 +563,11 @@ config X86_ALIGNMENT_16
403 +@@ -329,11 +636,11 @@ config X86_ALIGNMENT_16
404
405 config X86_INTEL_USERCOPY
406 def_bool y
407 - depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2
408 -+ depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MNATIVE
409 ++ depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MNATIVE_INTEL
410
411 config X86_USE_PPRO_CHECKSUM
412 def_bool y
413 - depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM
414 -+ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MNATIVE
415 ++ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MNATIVE_INTEL || MNATIVE_AMD
416
417 config X86_USE_3DNOW
418 def_bool y
419 -@@ -353,26 +587,26 @@ config X86_USE_3DNOW
420 +@@ -353,26 +660,26 @@ config X86_USE_3DNOW
421 config X86_P6_NOP
422 def_bool y
423 depends on X86_64
424 - depends on (MCORE2 || MPENTIUM4 || MPSC)
425 -+ depends on (MCORE2 || MPENTIUM4 || MPSC || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MNATIVE)
426 ++ depends on (MCORE2 || MPENTIUM4 || MPSC || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MNATIVE_INTEL)
427
428 config X86_TSC
429 def_bool y
430 - depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM) || X86_64
431 -+ depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MNATIVE) || X86_64
432 ++ depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MNATIVE_INTEL || MNATIVE_AMD) || X86_64
433
434 config X86_CMPXCHG64
435 def_bool y
436 - depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586TSC || M586MMX || MATOM || MGEODE_LX || MGEODEGX1 || MK6 || MK7 || MK8
437 -+ depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586TSC || M586MMX || MATOM || MGEODE_LX || MGEODEGX1 || MK6 || MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MNATIVE
438 ++ depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586TSC || M586MMX || MATOM || MGEODE_LX || MGEODEGX1 || MK6 || MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MNATIVE_INTEL || MNATIVE_AMD
439
440 # this should be set for all -march=.. options where the compiler
441 # generates cmov.
442 config X86_CMOV
443 def_bool y
444 - depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
445 -+ depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MNATIVE)
446 ++ depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MNATIVE_INTEL || MNATIVE_AMD)
447
448 config X86_MINIMUM_CPU_FAMILY
449 int
450 default "64" if X86_64
451 - default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8)
452 -+ default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MNATIVE)
453 ++ default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MZEN3 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MNATIVE_INTEL || MNATIVE_AMD)
454 default "5" if X86_32 && X86_CMPXCHG64
455 default "4"
456
457 diff --git a/arch/x86/Makefile b/arch/x86/Makefile
458 -index 8ca3cf7c5ec9..d954e5be917e 100644
459 +index 94df0868804b..09b1905de4cb 100644
460 --- a/arch/x86/Makefile
461 +++ b/arch/x86/Makefile
462 -@@ -124,11 +124,40 @@ else
463 +@@ -121,11 +121,48 @@ else
464 # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
465 cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
466 cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
467 @@ -469,8 +567,10 @@ index 8ca3cf7c5ec9..d954e5be917e 100644
468 + cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-mno-tbm)
469 + cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1)
470 + cflags-$(CONFIG_MZEN2) += $(call cc-option,-march=znver2)
471 ++ cflags-$(CONFIG_MZEN3) += $(call cc-option,-march=znver3)
472 +
473 -+ cflags-$(CONFIG_MNATIVE) += $(call cc-option,-march=native)
474 ++ cflags-$(CONFIG_MNATIVE_INTEL) += $(call cc-option,-march=native)
475 ++ cflags-$(CONFIG_MNATIVE_AMD) += $(call cc-option,-march=native)
476 + cflags-$(CONFIG_MATOM) += $(call cc-option,-march=bonnell)
477 + cflags-$(CONFIG_MCORE2) += $(call cc-option,-march=core2)
478 + cflags-$(CONFIG_MNEHALEM) += $(call cc-option,-march=nehalem)
479 @@ -489,19 +589,27 @@ index 8ca3cf7c5ec9..d954e5be917e 100644
480 + cflags-$(CONFIG_MCASCADELAKE) += $(call cc-option,-march=cascadelake)
481 + cflags-$(CONFIG_MCOOPERLAKE) += $(call cc-option,-march=cooperlake)
482 + cflags-$(CONFIG_MTIGERLAKE) += $(call cc-option,-march=tigerlake)
483 ++ cflags-$(CONFIG_MSAPPHIRERAPIDS) += $(call cc-option,-march=sapphirerapids)
484 ++ cflags-$(CONFIG_MROCKETLAKE) += $(call cc-option,-march=rocketlake)
485 ++ cflags-$(CONFIG_MALDERLAKE) += $(call cc-option,-march=alderlake)
486 ++ cflags-$(CONFIG_GENERIC_CPU2) += $(call cc-option,-march=x86-64-v2)
487 ++ cflags-$(CONFIG_GENERIC_CPU3) += $(call cc-option,-march=x86-64-v3)
488 ++ cflags-$(CONFIG_GENERIC_CPU4) += $(call cc-option,-march=x86-64-v4)
489 cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
490 KBUILD_CFLAGS += $(cflags-y)
491
492 diff --git a/arch/x86/include/asm/module.h b/arch/x86/include/asm/module.h
493 -index 7948a17febb4..eaf4ff82561f 100644
494 +index 7948a17febb4..6651f4d8dc51 100644
495 --- a/arch/x86/include/asm/module.h
496 +++ b/arch/x86/include/asm/module.h
497 -@@ -25,6 +25,40 @@ struct mod_arch_specific {
498 +@@ -25,6 +25,48 @@ struct mod_arch_specific {
499 #define MODULE_PROC_FAMILY "586MMX "
500 #elif defined CONFIG_MCORE2
501 #define MODULE_PROC_FAMILY "CORE2 "
502 -+#elif defined CONFIG_MNATIVE
503 -+#define MODULE_PROC_FAMILY "NATIVE "
504 ++#elif defined CONFIG_MNATIVE_INTEL
505 ++#define MODULE_PROC_FAMILY "NATIVE_INTEL "
506 ++#elif defined CONFIG_MNATIVE_AMD
507 ++#define MODULE_PROC_FAMILY "NATIVE_AMD "
508 +#elif defined CONFIG_MNEHALEM
509 +#define MODULE_PROC_FAMILY "NEHALEM "
510 +#elif defined CONFIG_MWESTMERE
511 @@ -534,10 +642,16 @@ index 7948a17febb4..eaf4ff82561f 100644
512 +#define MODULE_PROC_FAMILY "COOPERLAKE "
513 +#elif defined CONFIG_MTIGERLAKE
514 +#define MODULE_PROC_FAMILY "TIGERLAKE "
515 ++#elif defined CONFIG_MSAPPHIRERAPIDS
516 ++#define MODULE_PROC_FAMILY "SAPPHIRERAPIDS "
517 ++#elif defined CONFIG_MROCKETLAKE
518 ++#define MODULE_PROC_FAMILY "ROCKETLAKE "
519 ++#elif defined CONFIG_MALDERLAKE
520 ++#define MODULE_PROC_FAMILY "ALDERLAKE "
521 #elif defined CONFIG_MATOM
522 #define MODULE_PROC_FAMILY "ATOM "
523 #elif defined CONFIG_M686
524 -@@ -43,6 +77,28 @@ struct mod_arch_specific {
525 +@@ -43,6 +85,30 @@ struct mod_arch_specific {
526 #define MODULE_PROC_FAMILY "K7 "
527 #elif defined CONFIG_MK8
528 #define MODULE_PROC_FAMILY "K8 "
529 @@ -563,9 +677,11 @@ index 7948a17febb4..eaf4ff82561f 100644
530 +#define MODULE_PROC_FAMILY "ZEN "
531 +#elif defined CONFIG_MZEN2
532 +#define MODULE_PROC_FAMILY "ZEN2 "
533 ++#elif defined CONFIG_MZEN3
534 ++#define MODULE_PROC_FAMILY "ZEN3 "
535 #elif defined CONFIG_MELAN
536 #define MODULE_PROC_FAMILY "ELAN "
537 #elif defined CONFIG_MCRUSOE
538 --
539 -2.30.1
540 +2.31.1
541
542
543 diff --git a/5011_enable-cpu-optimizations-for-gcc8.patch b/5011_enable-cpu-optimizations-for-gcc8.patch
544 deleted file mode 100644
545 index bfd2065..0000000
546 --- a/5011_enable-cpu-optimizations-for-gcc8.patch
547 +++ /dev/null
548 @@ -1,569 +0,0 @@
549 -WARNING
550 -This patch works with gcc versions 8.1+ and with kernel version 4.13+ and should
551 -NOT be applied when compiling on older versions of gcc due to key name changes
552 -of the march flags introduced with the version 4.9 release of gcc.[1]
553 -
554 -Use the older version of this patch hosted on the same github for older
555 -versions of gcc.
556 -
557 -FEATURES
558 -This patch adds additional CPU options to the Linux kernel accessible under:
559 - Processor type and features --->
560 - Processor family --->
561 -
562 -The expanded microarchitectures include:
563 -* AMD Improved K8-family
564 -* AMD K10-family
565 -* AMD Family 10h (Barcelona)
566 -* AMD Family 14h (Bobcat)
567 -* AMD Family 16h (Jaguar)
568 -* AMD Family 15h (Bulldozer)
569 -* AMD Family 15h (Piledriver)
570 -* AMD Family 15h (Steamroller)
571 -* AMD Family 15h (Excavator)
572 -* AMD Family 17h (Zen)
573 -* Intel Silvermont low-power processors
574 -* Intel 1st Gen Core i3/i5/i7 (Nehalem)
575 -* Intel 1.5 Gen Core i3/i5/i7 (Westmere)
576 -* Intel 2nd Gen Core i3/i5/i7 (Sandybridge)
577 -* Intel 3rd Gen Core i3/i5/i7 (Ivybridge)
578 -* Intel 4th Gen Core i3/i5/i7 (Haswell)
579 -* Intel 5th Gen Core i3/i5/i7 (Broadwell)
580 -* Intel 6th Gen Core i3/i5/i7 (Skylake)
581 -* Intel 6th Gen Core i7/i9 (Skylake X)
582 -* Intel 8th Gen Core i3/i5/i7 (Cannon Lake)
583 -* Intel 8th Gen Core i7/i9 (Ice Lake)
584 -
585 -It also offers to compile passing the 'native' option which, "selects the CPU
586 -to generate code for at compilation time by determining the processor type of
587 -the compiling machine. Using -march=native enables all instruction subsets
588 -supported by the local machine and will produce code optimized for the local
589 -machine under the constraints of the selected instruction set."[3]
590 -
591 -MINOR NOTES
592 -This patch also changes 'atom' to 'bonnell' in accordance with the gcc v4.9
593 -changes. Note that upstream is using the deprecated 'match=atom' flags when I
594 -believe it should use the newer 'march=bonnell' flag for atom processors.[2]
595 -
596 -It is not recommended to compile on Atom-CPUs with the 'native' option.[4] The
597 -recommendation is to use the 'atom' option instead.
598 -
599 -BENEFITS
600 -Small but real speed increases are measurable using a make endpoint comparing
601 -a generic kernel to one built with one of the respective microarchs.
602 -
603 -See the following experimental evidence supporting this statement:
604 -https://github.com/graysky2/kernel_gcc_patch
605 -
606 -REQUIREMENTS
607 -linux version >=4.20
608 -gcc version >=8.1
609 -
610 -ACKNOWLEDGMENTS
611 -This patch builds on the seminal work by Jeroen.[5]
612 -
613 -REFERENCES
614 -1. https://gcc.gnu.org/gcc-4.9/changes.html
615 -2. https://bugzilla.kernel.org/show_bug.cgi?id=77461
616 -3. https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
617 -4. https://github.com/graysky2/kernel_gcc_patch/issues/15
618 -5. http://www.linuxforge.net/docs/linux/linux-gcc.php
619 -
620 ---- a/arch/x86/Makefile_32.cpu 2019-02-22 09:22:03.426937735 -0500
621 -+++ b/arch/x86/Makefile_32.cpu 2019-02-22 09:37:58.680968580 -0500
622 -@@ -23,7 +23,18 @@ cflags-$(CONFIG_MK6) += -march=k6
623 - # Please note, that patches that add -march=athlon-xp and friends are pointless.
624 - # They make zero difference whatsosever to performance at this time.
625 - cflags-$(CONFIG_MK7) += -march=athlon
626 -+cflags-$(CONFIG_MNATIVE) += $(call cc-option,-march=native)
627 - cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon)
628 -+cflags-$(CONFIG_MK8SSE3) += $(call cc-option,-march=k8-sse3,-march=athlon)
629 -+cflags-$(CONFIG_MK10) += $(call cc-option,-march=amdfam10,-march=athlon)
630 -+cflags-$(CONFIG_MBARCELONA) += $(call cc-option,-march=barcelona,-march=athlon)
631 -+cflags-$(CONFIG_MBOBCAT) += $(call cc-option,-march=btver1,-march=athlon)
632 -+cflags-$(CONFIG_MJAGUAR) += $(call cc-option,-march=btver2,-march=athlon)
633 -+cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1,-march=athlon)
634 -+cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2,-march=athlon)
635 -+cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-march=bdver3,-march=athlon)
636 -+cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-march=bdver4,-march=athlon)
637 -+cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1,-march=athlon)
638 - cflags-$(CONFIG_MCRUSOE) += -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
639 - cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) -falign-functions=0 -falign-jumps=0 -falign-loops=0
640 - cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
641 -@@ -32,9 +43,20 @@ cflags-$(CONFIG_MCYRIXIII) += $(call cc-
642 - cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
643 - cflags-$(CONFIG_MVIAC7) += -march=i686
644 - cflags-$(CONFIG_MCORE2) += -march=i686 $(call tune,core2)
645 --cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom,$(call cc-option,-march=core2,-march=i686)) \
646 -- $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
647 --
648 -+cflags-$(CONFIG_MNEHALEM) += -march=i686 $(call tune,nehalem)
649 -+cflags-$(CONFIG_MWESTMERE) += -march=i686 $(call tune,westmere)
650 -+cflags-$(CONFIG_MSILVERMONT) += -march=i686 $(call tune,silvermont)
651 -+cflags-$(CONFIG_MSANDYBRIDGE) += -march=i686 $(call tune,sandybridge)
652 -+cflags-$(CONFIG_MIVYBRIDGE) += -march=i686 $(call tune,ivybridge)
653 -+cflags-$(CONFIG_MHASWELL) += -march=i686 $(call tune,haswell)
654 -+cflags-$(CONFIG_MBROADWELL) += -march=i686 $(call tune,broadwell)
655 -+cflags-$(CONFIG_MSKYLAKE) += -march=i686 $(call tune,skylake)
656 -+cflags-$(CONFIG_MSKYLAKEX) += -march=i686 $(call tune,skylake-avx512)
657 -+cflags-$(CONFIG_MCANNONLAKE) += -march=i686 $(call tune,cannonlake)
658 -+cflags-$(CONFIG_MICELAKE) += -march=i686 $(call tune,icelake)
659 -+cflags-$(CONFIG_MATOM) += $(call cc-option,-march=bonnell,$(call cc-option,-march=core2,-march=i686)) \
660 -+ $(call cc-option,-mtune=bonnell,$(call cc-option,-mtune=generic))
661 -+
662 - # AMD Elan support
663 - cflags-$(CONFIG_MELAN) += -march=i486
664 -
665 ---- a/arch/x86/Kconfig.cpu 2019-02-22 09:22:11.576958595 -0500
666 -+++ b/arch/x86/Kconfig.cpu 2019-02-22 09:34:16.490003911 -0500
667 -@@ -116,6 +116,7 @@ config MPENTIUMM
668 - config MPENTIUM4
669 - bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon"
670 - depends on X86_32
671 -+ select X86_P6_NOP
672 - ---help---
673 - Select this for Intel Pentium 4 chips. This includes the
674 - Pentium 4, Pentium D, P4-based Celeron and Xeon, and
675 -@@ -150,7 +151,7 @@ config MPENTIUM4
676 -
677 -
678 - config MK6
679 -- bool "K6/K6-II/K6-III"
680 -+ bool "AMD K6/K6-II/K6-III"
681 - depends on X86_32
682 - ---help---
683 - Select this for an AMD K6-family processor. Enables use of
684 -@@ -158,7 +159,7 @@ config MK6
685 - flags to GCC.
686 -
687 - config MK7
688 -- bool "Athlon/Duron/K7"
689 -+ bool "AMD Athlon/Duron/K7"
690 - depends on X86_32
691 - ---help---
692 - Select this for an AMD Athlon K7-family processor. Enables use of
693 -@@ -166,11 +167,81 @@ config MK7
694 - flags to GCC.
695 -
696 - config MK8
697 -- bool "Opteron/Athlon64/Hammer/K8"
698 -+ bool "AMD Opteron/Athlon64/Hammer/K8"
699 - ---help---
700 - Select this for an AMD Opteron or Athlon64 Hammer-family processor.
701 - Enables use of some extended instructions, and passes appropriate
702 - optimization flags to GCC.
703 -+config MK8SSE3
704 -+ bool "AMD Opteron/Athlon64/Hammer/K8 with SSE3"
705 -+ ---help---
706 -+ Select this for improved AMD Opteron or Athlon64 Hammer-family processors.
707 -+ Enables use of some extended instructions, and passes appropriate
708 -+ optimization flags to GCC.
709 -+
710 -+config MK10
711 -+ bool "AMD 61xx/7x50/PhenomX3/X4/II/K10"
712 -+ ---help---
713 -+ Select this for an AMD 61xx Eight-Core Magny-Cours, Athlon X2 7x50,
714 -+ Phenom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor.
715 -+ Enables use of some extended instructions, and passes appropriate
716 -+ optimization flags to GCC.
717 -+
718 -+config MBARCELONA
719 -+ bool "AMD Barcelona"
720 -+ ---help---
721 -+ Select this for AMD Family 10h Barcelona processors.
722 -+
723 -+ Enables -march=barcelona
724 -+
725 -+config MBOBCAT
726 -+ bool "AMD Bobcat"
727 -+ ---help---
728 -+ Select this for AMD Family 14h Bobcat processors.
729 -+
730 -+ Enables -march=btver1
731 -+
732 -+config MJAGUAR
733 -+ bool "AMD Jaguar"
734 -+ ---help---
735 -+ Select this for AMD Family 16h Jaguar processors.
736 -+
737 -+ Enables -march=btver2
738 -+
739 -+config MBULLDOZER
740 -+ bool "AMD Bulldozer"
741 -+ ---help---
742 -+ Select this for AMD Family 15h Bulldozer processors.
743 -+
744 -+ Enables -march=bdver1
745 -+
746 -+config MPILEDRIVER
747 -+ bool "AMD Piledriver"
748 -+ ---help---
749 -+ Select this for AMD Family 15h Piledriver processors.
750 -+
751 -+ Enables -march=bdver2
752 -+
753 -+config MSTEAMROLLER
754 -+ bool "AMD Steamroller"
755 -+ ---help---
756 -+ Select this for AMD Family 15h Steamroller processors.
757 -+
758 -+ Enables -march=bdver3
759 -+
760 -+config MEXCAVATOR
761 -+ bool "AMD Excavator"
762 -+ ---help---
763 -+ Select this for AMD Family 15h Excavator processors.
764 -+
765 -+ Enables -march=bdver4
766 -+
767 -+config MZEN
768 -+ bool "AMD Zen"
769 -+ ---help---
770 -+ Select this for AMD Family 17h Zen processors.
771 -+
772 -+ Enables -march=znver1
773 -
774 - config MCRUSOE
775 - bool "Crusoe"
776 -@@ -253,6 +324,7 @@ config MVIAC7
777 -
778 - config MPSC
779 - bool "Intel P4 / older Netburst based Xeon"
780 -+ select X86_P6_NOP
781 - depends on X86_64
782 - ---help---
783 - Optimize for Intel Pentium 4, Pentium D and older Nocona/Dempsey
784 -@@ -262,23 +334,126 @@ config MPSC
785 - using the cpu family field
786 - in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one.
787 -
788 -+config MATOM
789 -+ bool "Intel Atom"
790 -+ select X86_P6_NOP
791 -+ ---help---
792 -+
793 -+ Select this for the Intel Atom platform. Intel Atom CPUs have an
794 -+ in-order pipelining architecture and thus can benefit from
795 -+ accordingly optimized code. Use a recent GCC with specific Atom
796 -+ support in order to fully benefit from selecting this option.
797 -+
798 - config MCORE2
799 -- bool "Core 2/newer Xeon"
800 -+ bool "Intel Core 2"
801 -+ select X86_P6_NOP
802 -+
803 - ---help---
804 -
805 - Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and
806 - 53xx) CPUs. You can distinguish newer from older Xeons by the CPU
807 - family in /proc/cpuinfo. Newer ones have 6 and older ones 15
808 - (not a typo)
809 -+ Enables -march=core2
810 -
811 --config MATOM
812 -- bool "Intel Atom"
813 -+config MNEHALEM
814 -+ bool "Intel Nehalem"
815 -+ select X86_P6_NOP
816 - ---help---
817 -
818 -- Select this for the Intel Atom platform. Intel Atom CPUs have an
819 -- in-order pipelining architecture and thus can benefit from
820 -- accordingly optimized code. Use a recent GCC with specific Atom
821 -- support in order to fully benefit from selecting this option.
822 -+ Select this for 1st Gen Core processors in the Nehalem family.
823 -+
824 -+ Enables -march=nehalem
825 -+
826 -+config MWESTMERE
827 -+ bool "Intel Westmere"
828 -+ select X86_P6_NOP
829 -+ ---help---
830 -+
831 -+ Select this for the Intel Westmere formerly Nehalem-C family.
832 -+
833 -+ Enables -march=westmere
834 -+
835 -+config MSILVERMONT
836 -+ bool "Intel Silvermont"
837 -+ select X86_P6_NOP
838 -+ ---help---
839 -+
840 -+ Select this for the Intel Silvermont platform.
841 -+
842 -+ Enables -march=silvermont
843 -+
844 -+config MSANDYBRIDGE
845 -+ bool "Intel Sandy Bridge"
846 -+ select X86_P6_NOP
847 -+ ---help---
848 -+
849 -+ Select this for 2nd Gen Core processors in the Sandy Bridge family.
850 -+
851 -+ Enables -march=sandybridge
852 -+
853 -+config MIVYBRIDGE
854 -+ bool "Intel Ivy Bridge"
855 -+ select X86_P6_NOP
856 -+ ---help---
857 -+
858 -+ Select this for 3rd Gen Core processors in the Ivy Bridge family.
859 -+
860 -+ Enables -march=ivybridge
861 -+
862 -+config MHASWELL
863 -+ bool "Intel Haswell"
864 -+ select X86_P6_NOP
865 -+ ---help---
866 -+
867 -+ Select this for 4th Gen Core processors in the Haswell family.
868 -+
869 -+ Enables -march=haswell
870 -+
871 -+config MBROADWELL
872 -+ bool "Intel Broadwell"
873 -+ select X86_P6_NOP
874 -+ ---help---
875 -+
876 -+ Select this for 5th Gen Core processors in the Broadwell family.
877 -+
878 -+ Enables -march=broadwell
879 -+
880 -+config MSKYLAKE
881 -+ bool "Intel Skylake"
882 -+ select X86_P6_NOP
883 -+ ---help---
884 -+
885 -+ Select this for 6th Gen Core processors in the Skylake family.
886 -+
887 -+ Enables -march=skylake
888 -+
889 -+config MSKYLAKEX
890 -+ bool "Intel Skylake X"
891 -+ select X86_P6_NOP
892 -+ ---help---
893 -+
894 -+ Select this for 6th Gen Core processors in the Skylake X family.
895 -+
896 -+ Enables -march=skylake-avx512
897 -+
898 -+config MCANNONLAKE
899 -+ bool "Intel Cannon Lake"
900 -+ select X86_P6_NOP
901 -+ ---help---
902 -+
903 -+ Select this for 8th Gen Core processors
904 -+
905 -+ Enables -march=cannonlake
906 -+
907 -+config MICELAKE
908 -+ bool "Intel Ice Lake"
909 -+ select X86_P6_NOP
910 -+ ---help---
911 -+
912 -+ Select this for 8th Gen Core processors in the Ice Lake family.
913 -+
914 -+ Enables -march=icelake
915 -
916 - config GENERIC_CPU
917 - bool "Generic-x86-64"
918 -@@ -287,6 +462,19 @@ config GENERIC_CPU
919 - Generic x86-64 CPU.
920 - Run equally well on all x86-64 CPUs.
921 -
922 -+config MNATIVE
923 -+ bool "Native optimizations autodetected by GCC"
924 -+ ---help---
925 -+
926 -+ GCC 4.2 and above support -march=native, which automatically detects
927 -+ the optimum settings to use based on your processor. -march=native
928 -+ also detects and applies additional settings beyond -march specific
929 -+ to your CPU, (eg. -msse4). Unless you have a specific reason not to
930 -+ (e.g. distcc cross-compiling), you should probably be using
931 -+ -march=native rather than anything listed below.
932 -+
933 -+ Enables -march=native
934 -+
935 - endchoice
936 -
937 - config X86_GENERIC
938 -@@ -311,7 +499,7 @@ config X86_INTERNODE_CACHE_SHIFT
939 - config X86_L1_CACHE_SHIFT
940 - int
941 - default "7" if MPENTIUM4 || MPSC
942 -- default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU
943 -+ default "6" if MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MJAGUAR || MPENTIUMM || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MNATIVE || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU
944 - default "4" if MELAN || M486 || MGEODEGX1
945 - default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
946 -
947 -@@ -329,39 +517,40 @@ config X86_ALIGNMENT_16
948 -
949 - config X86_INTEL_USERCOPY
950 - def_bool y
951 -- depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2
952 -+ depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK8SSE3 || MK7 || MEFFICEON || MCORE2 || MK10 || MBARCELONA || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MNATIVE
953 -
954 - config X86_USE_PPRO_CHECKSUM
955 - def_bool y
956 -- depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM
957 -+ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MK10 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MK8SSE3 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MATOM || MNATIVE
958 -
959 - config X86_USE_3DNOW
960 - def_bool y
961 - depends on (MCYRIXIII || MK7 || MGEODE_LX) && !UML
962 -
963 --#
964 --# P6_NOPs are a relatively minor optimization that require a family >=
965 --# 6 processor, except that it is broken on certain VIA chips.
966 --# Furthermore, AMD chips prefer a totally different sequence of NOPs
967 --# (which work on all CPUs). In addition, it looks like Virtual PC
968 --# does not understand them.
969 --#
970 --# As a result, disallow these if we're not compiling for X86_64 (these
971 --# NOPs do work on all x86-64 capable chips); the list of processors in
972 --# the right-hand clause are the cores that benefit from this optimization.
973 --#
974 - config X86_P6_NOP
975 -- def_bool y
976 -- depends on X86_64
977 -- depends on (MCORE2 || MPENTIUM4 || MPSC)
978 -+ default n
979 -+ bool "Support for P6_NOPs on Intel chips"
980 -+ depends on (MCORE2 || MPENTIUM4 || MPSC || MATOM || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MNATIVE)
981 -+ ---help---
982 -+ P6_NOPs are a relatively minor optimization that require a family >=
983 -+ 6 processor, except that it is broken on certain VIA chips.
984 -+ Furthermore, AMD chips prefer a totally different sequence of NOPs
985 -+ (which work on all CPUs). In addition, it looks like Virtual PC
986 -+ does not understand them.
987 -+
988 -+ As a result, disallow these if we're not compiling for X86_64 (these
989 -+ NOPs do work on all x86-64 capable chips); the list of processors in
990 -+ the right-hand clause are the cores that benefit from this optimization.
991 -
992 -+ Say Y if you have Intel CPU newer than Pentium Pro, N otherwise.
993 -+
994 - config X86_TSC
995 - def_bool y
996 -- depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM) || X86_64
997 -+ depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MK8SSE3 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MNATIVE || MATOM) || X86_64
998 -
999 - config X86_CMPXCHG64
1000 - def_bool y
1001 -- depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586TSC || M586MMX || MATOM || MGEODE_LX || MGEODEGX1 || MK6 || MK7 || MK8
1002 -+ depends on (MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MJAGUAR || MK7 || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MNATIVE || MATOM || MGEODE_LX)
1003 -
1004 - # this should be set for all -march=.. options where the compiler
1005 - # generates cmov.
1006 ---- a/arch/x86/Makefile 2019-02-22 09:21:58.196924367 -0500
1007 -+++ b/arch/x86/Makefile 2019-02-22 09:36:27.310577832 -0500
1008 -@@ -118,13 +118,46 @@ else
1009 - KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
1010 -
1011 - # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
1012 -+ cflags-$(CONFIG_MNATIVE) += $(call cc-option,-march=native)
1013 - cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
1014 -+ cflags-$(CONFIG_MK8SSE3) += $(call cc-option,-march=k8-sse3,-mtune=k8)
1015 -+ cflags-$(CONFIG_MK10) += $(call cc-option,-march=amdfam10)
1016 -+ cflags-$(CONFIG_MBARCELONA) += $(call cc-option,-march=barcelona)
1017 -+ cflags-$(CONFIG_MBOBCAT) += $(call cc-option,-march=btver1)
1018 -+ cflags-$(CONFIG_MJAGUAR) += $(call cc-option,-march=btver2)
1019 -+ cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1)
1020 -+ cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2)
1021 -+ cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-march=bdver3)
1022 -+ cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-march=bdver4)
1023 -+ cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1)
1024 - cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
1025 -
1026 - cflags-$(CONFIG_MCORE2) += \
1027 -- $(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
1028 -- cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \
1029 -- $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
1030 -+ $(call cc-option,-march=core2,$(call cc-option,-mtune=core2))
1031 -+ cflags-$(CONFIG_MNEHALEM) += \
1032 -+ $(call cc-option,-march=nehalem,$(call cc-option,-mtune=nehalem))
1033 -+ cflags-$(CONFIG_MWESTMERE) += \
1034 -+ $(call cc-option,-march=westmere,$(call cc-option,-mtune=westmere))
1035 -+ cflags-$(CONFIG_MSILVERMONT) += \
1036 -+ $(call cc-option,-march=silvermont,$(call cc-option,-mtune=silvermont))
1037 -+ cflags-$(CONFIG_MSANDYBRIDGE) += \
1038 -+ $(call cc-option,-march=sandybridge,$(call cc-option,-mtune=sandybridge))
1039 -+ cflags-$(CONFIG_MIVYBRIDGE) += \
1040 -+ $(call cc-option,-march=ivybridge,$(call cc-option,-mtune=ivybridge))
1041 -+ cflags-$(CONFIG_MHASWELL) += \
1042 -+ $(call cc-option,-march=haswell,$(call cc-option,-mtune=haswell))
1043 -+ cflags-$(CONFIG_MBROADWELL) += \
1044 -+ $(call cc-option,-march=broadwell,$(call cc-option,-mtune=broadwell))
1045 -+ cflags-$(CONFIG_MSKYLAKE) += \
1046 -+ $(call cc-option,-march=skylake,$(call cc-option,-mtune=skylake))
1047 -+ cflags-$(CONFIG_MSKYLAKEX) += \
1048 -+ $(call cc-option,-march=skylake-avx512,$(call cc-option,-mtune=skylake-avx512))
1049 -+ cflags-$(CONFIG_MCANNONLAKE) += \
1050 -+ $(call cc-option,-march=cannonlake,$(call cc-option,-mtune=cannonlake))
1051 -+ cflags-$(CONFIG_MICELAKE) += \
1052 -+ $(call cc-option,-march=icelake,$(call cc-option,-mtune=icelake))
1053 -+ cflags-$(CONFIG_MATOM) += $(call cc-option,-march=bonnell) \
1054 -+ $(call cc-option,-mtune=bonnell,$(call cc-option,-mtune=generic))
1055 - cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
1056 - KBUILD_CFLAGS += $(cflags-y)
1057 -
1058 ---- a/arch/x86/include/asm/module.h 2019-02-22 09:22:26.726997480 -0500
1059 -+++ b/arch/x86/include/asm/module.h 2019-02-22 09:40:04.231493392 -0500
1060 -@@ -25,6 +25,30 @@ struct mod_arch_specific {
1061 - #define MODULE_PROC_FAMILY "586MMX "
1062 - #elif defined CONFIG_MCORE2
1063 - #define MODULE_PROC_FAMILY "CORE2 "
1064 -+#elif defined CONFIG_MNATIVE
1065 -+#define MODULE_PROC_FAMILY "NATIVE "
1066 -+#elif defined CONFIG_MNEHALEM
1067 -+#define MODULE_PROC_FAMILY "NEHALEM "
1068 -+#elif defined CONFIG_MWESTMERE
1069 -+#define MODULE_PROC_FAMILY "WESTMERE "
1070 -+#elif defined CONFIG_MSILVERMONT
1071 -+#define MODULE_PROC_FAMILY "SILVERMONT "
1072 -+#elif defined CONFIG_MSANDYBRIDGE
1073 -+#define MODULE_PROC_FAMILY "SANDYBRIDGE "
1074 -+#elif defined CONFIG_MIVYBRIDGE
1075 -+#define MODULE_PROC_FAMILY "IVYBRIDGE "
1076 -+#elif defined CONFIG_MHASWELL
1077 -+#define MODULE_PROC_FAMILY "HASWELL "
1078 -+#elif defined CONFIG_MBROADWELL
1079 -+#define MODULE_PROC_FAMILY "BROADWELL "
1080 -+#elif defined CONFIG_MSKYLAKE
1081 -+#define MODULE_PROC_FAMILY "SKYLAKE "
1082 -+#elif defined CONFIG_MSKYLAKEX
1083 -+#define MODULE_PROC_FAMILY "SKYLAKEX "
1084 -+#elif defined CONFIG_MCANNONLAKE
1085 -+#define MODULE_PROC_FAMILY "CANNONLAKE "
1086 -+#elif defined CONFIG_MICELAKE
1087 -+#define MODULE_PROC_FAMILY "ICELAKE "
1088 - #elif defined CONFIG_MATOM
1089 - #define MODULE_PROC_FAMILY "ATOM "
1090 - #elif defined CONFIG_M686
1091 -@@ -43,6 +67,26 @@ struct mod_arch_specific {
1092 - #define MODULE_PROC_FAMILY "K7 "
1093 - #elif defined CONFIG_MK8
1094 - #define MODULE_PROC_FAMILY "K8 "
1095 -+#elif defined CONFIG_MK8SSE3
1096 -+#define MODULE_PROC_FAMILY "K8SSE3 "
1097 -+#elif defined CONFIG_MK10
1098 -+#define MODULE_PROC_FAMILY "K10 "
1099 -+#elif defined CONFIG_MBARCELONA
1100 -+#define MODULE_PROC_FAMILY "BARCELONA "
1101 -+#elif defined CONFIG_MBOBCAT
1102 -+#define MODULE_PROC_FAMILY "BOBCAT "
1103 -+#elif defined CONFIG_MBULLDOZER
1104 -+#define MODULE_PROC_FAMILY "BULLDOZER "
1105 -+#elif defined CONFIG_MPILEDRIVER
1106 -+#define MODULE_PROC_FAMILY "PILEDRIVER "
1107 -+#elif defined CONFIG_MSTEAMROLLER
1108 -+#define MODULE_PROC_FAMILY "STEAMROLLER "
1109 -+#elif defined CONFIG_MJAGUAR
1110 -+#define MODULE_PROC_FAMILY "JAGUAR "
1111 -+#elif defined CONFIG_MEXCAVATOR
1112 -+#define MODULE_PROC_FAMILY "EXCAVATOR "
1113 -+#elif defined CONFIG_MZEN
1114 -+#define MODULE_PROC_FAMILY "ZEN "
1115 - #elif defined CONFIG_MELAN
1116 - #define MODULE_PROC_FAMILY "ELAN "
1117 - #elif defined CONFIG_MCRUSOE
1118
1119 diff --git a/5012_enable-cpu-optimizations-for-gcc91.patch b/5012_enable-cpu-optimizations-for-gcc91.patch
1120 deleted file mode 100644
1121 index 8662cb5..0000000
1122 --- a/5012_enable-cpu-optimizations-for-gcc91.patch
1123 +++ /dev/null
1124 @@ -1,549 +0,0 @@
1125 -From 7dc4b32d619ba7c8e1558d37a74183b6d86bf7d2 Mon Sep 17 00:00:00 2001
1126 -From: graysky <graysky@×××××××××.us>
1127 -Date: Tue, 9 Mar 2021 02:14:13 -0500
1128 -Subject: [PATCH] more-uarches-for-gcc-v9-and-kernel-4.19-5.4
1129 -
1130 -WARNING
1131 -This patch works with gcc versions 9.1+ and with kernel version 4.19-5.4 and
1132 -NOT be applied when compiling on older versions of gcc due to key name changes
1133 -of the march flags introduced with the version 4.9 release of gcc.[1]
1134 -
1135 -Use the older version of this patch hosted on the same github for older
1136 -versions of gcc.
1137 -
1138 -FEATURES
1139 -This patch adds additional CPU options to the Linux kernel accessible under:
1140 - Processor type and features --->
1141 - Processor family --->
1142 -
1143 -The expanded microarchitectures include:
1144 -* AMD Improved K8-family
1145 -* AMD K10-family
1146 -* AMD Family 10h (Barcelona)
1147 -* AMD Family 14h (Bobcat)
1148 -* AMD Family 16h (Jaguar)
1149 -* AMD Family 15h (Bulldozer)
1150 -* AMD Family 15h (Piledriver)
1151 -* AMD Family 15h (Steamroller)
1152 -* AMD Family 15h (Excavator)
1153 -* AMD Family 17h (Zen)
1154 -* AMD Family 17h (Zen 2)
1155 -* Intel Silvermont low-power processors
1156 -* Intel Goldmont low-power processors (Apollo Lake and Denverton)
1157 -* Intel Goldmont Plus low-power processors (Gemini Lake)
1158 -* Intel 1st Gen Core i3/i5/i7 (Nehalem)
1159 -* Intel 1.5 Gen Core i3/i5/i7 (Westmere)
1160 -* Intel 2nd Gen Core i3/i5/i7 (Sandybridge)
1161 -* Intel 3rd Gen Core i3/i5/i7 (Ivybridge)
1162 -* Intel 4th Gen Core i3/i5/i7 (Haswell)
1163 -* Intel 5th Gen Core i3/i5/i7 (Broadwell)
1164 -* Intel 6th Gen Core i3/i5/i7 (Skylake)
1165 -* Intel 6th Gen Core i7/i9 (Skylake X)
1166 -* Intel 8th Gen Core i3/i5/i7 (Cannon Lake)
1167 -* Intel 10th Gen Core i7/i9 (Ice Lake)
1168 -* Intel Xeon (Cascade Lake)
1169 -
1170 -It also offers to compile passing the 'native' option which, "selects the CPU
1171 -to generate code for at compilation time by determining the processor type of
1172 -the compiling machine. Using -march=native enables all instruction subsets
1173 -supported by the local machine and will produce code optimized for the local
1174 -machine under the constraints of the selected instruction set."[2]
1175 -
1176 -Do NOT try using the 'native' option on AMD Piledriver, Steamroller, or
1177 -Excavator CPUs (-march=bdver{2,3,4} flag). The build will error out due the
1178 -kernel's objtool issue with these.[3a,b]
1179 -
1180 -MINOR NOTES
1181 -This patch also changes 'atom' to 'bonnell' in accordance with the gcc v4.9
1182 -changes. Note that upstream is using the deprecated 'match=atom' flags when I
1183 -believe it should use the newer 'march=bonnell' flag for atom processors.[4]
1184 -
1185 -It is not recommended to compile on Atom-CPUs with the 'native' option.[5] The
1186 -recommendation is to use the 'atom' option instead.
1187 -
1188 -BENEFITS
1189 -Small but real speed increases are measurable using a make endpoint comparing
1190 -a generic kernel to one built with one of the respective microarchs.
1191 -
1192 -See the following experimental evidence supporting this statement:
1193 -https://github.com/graysky2/kernel_gcc_patch
1194 -
1195 -REQUIREMENTS
1196 -linux version >=4.19 and <5.5
1197 -gcc version >=9.1 and <10
1198 -
1199 -ACKNOWLEDGMENTS
1200 -This patch builds on the seminal work by Jeroen.[6]
1201 -
1202 -REFERENCES
1203 -1. https://gcc.gnu.org/gcc-4.9/changes.html
1204 -2. https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
1205 -3a. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671#c11
1206 -3b. https://github.com/graysky2/kernel_gcc_patch/issues/55
1207 -4. https://bugzilla.kernel.org/show_bug.cgi?id=77461
1208 -5. https://github.com/graysky2/kernel_gcc_patch/issues/15
1209 -6. http://www.linuxforge.net/docs/linux/linux-gcc.php
1210 ----
1211 - arch/x86/Kconfig.cpu | 240 ++++++++++++++++++++++++++++++++--
1212 - arch/x86/Makefile | 37 +++++-
1213 - arch/x86/include/asm/module.h | 52 ++++++++
1214 - 3 files changed, 312 insertions(+), 17 deletions(-)
1215 -
1216 -diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
1217 -index 638411f22267..18f0f04b9cb7 100644
1218 ---- a/arch/x86/Kconfig.cpu
1219 -+++ b/arch/x86/Kconfig.cpu
1220 -@@ -150,7 +150,7 @@ config MPENTIUM4
1221 -
1222 -
1223 - config MK6
1224 -- bool "K6/K6-II/K6-III"
1225 -+ bool "AMD K6/K6-II/K6-III"
1226 - depends on X86_32
1227 - ---help---
1228 - Select this for an AMD K6-family processor. Enables use of
1229 -@@ -158,7 +158,7 @@ config MK6
1230 - flags to GCC.
1231 -
1232 - config MK7
1233 -- bool "Athlon/Duron/K7"
1234 -+ bool "AMD Athlon/Duron/K7"
1235 - depends on X86_32
1236 - ---help---
1237 - Select this for an AMD Athlon K7-family processor. Enables use of
1238 -@@ -166,12 +166,90 @@ config MK7
1239 - flags to GCC.
1240 -
1241 - config MK8
1242 -- bool "Opteron/Athlon64/Hammer/K8"
1243 -+ bool "AMD Opteron/Athlon64/Hammer/K8"
1244 - ---help---
1245 - Select this for an AMD Opteron or Athlon64 Hammer-family processor.
1246 - Enables use of some extended instructions, and passes appropriate
1247 - optimization flags to GCC.
1248 -
1249 -+config MK8SSE3
1250 -+ bool "AMD Opteron/Athlon64/Hammer/K8 with SSE3"
1251 -+ ---help---
1252 -+ Select this for improved AMD Opteron or Athlon64 Hammer-family processors.
1253 -+ Enables use of some extended instructions, and passes appropriate
1254 -+ optimization flags to GCC.
1255 -+
1256 -+config MK10
1257 -+ bool "AMD 61xx/7x50/PhenomX3/X4/II/K10"
1258 -+ ---help---
1259 -+ Select this for an AMD 61xx Eight-Core Magny-Cours, Athlon X2 7x50,
1260 -+ Phenom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor.
1261 -+ Enables use of some extended instructions, and passes appropriate
1262 -+ optimization flags to GCC.
1263 -+
1264 -+config MBARCELONA
1265 -+ bool "AMD Barcelona"
1266 -+ ---help---
1267 -+ Select this for AMD Family 10h Barcelona processors.
1268 -+
1269 -+ Enables -march=barcelona
1270 -+
1271 -+config MBOBCAT
1272 -+ bool "AMD Bobcat"
1273 -+ ---help---
1274 -+ Select this for AMD Family 14h Bobcat processors.
1275 -+
1276 -+ Enables -march=btver1
1277 -+
1278 -+config MJAGUAR
1279 -+ bool "AMD Jaguar"
1280 -+ ---help---
1281 -+ Select this for AMD Family 16h Jaguar processors.
1282 -+
1283 -+ Enables -march=btver2
1284 -+
1285 -+config MBULLDOZER
1286 -+ bool "AMD Bulldozer"
1287 -+ ---help---
1288 -+ Select this for AMD Family 15h Bulldozer processors.
1289 -+
1290 -+ Enables -march=bdver1
1291 -+
1292 -+config MPILEDRIVER
1293 -+ bool "AMD Piledriver"
1294 -+ ---help---
1295 -+ Select this for AMD Family 15h Piledriver processors.
1296 -+
1297 -+ Enables -march=bdver2
1298 -+
1299 -+config MSTEAMROLLER
1300 -+ bool "AMD Steamroller"
1301 -+ ---help---
1302 -+ Select this for AMD Family 15h Steamroller processors.
1303 -+
1304 -+ Enables -march=bdver3
1305 -+
1306 -+config MEXCAVATOR
1307 -+ bool "AMD Excavator"
1308 -+ ---help---
1309 -+ Select this for AMD Family 15h Excavator processors.
1310 -+
1311 -+ Enables -march=bdver4
1312 -+
1313 -+config MZEN
1314 -+ bool "AMD Zen"
1315 -+ ---help---
1316 -+ Select this for AMD Family 17h Zen processors.
1317 -+
1318 -+ Enables -march=znver1
1319 -+
1320 -+config MZEN2
1321 -+ bool "AMD Zen 2"
1322 -+ ---help---
1323 -+ Select this for AMD Family 17h Zen 2 processors.
1324 -+
1325 -+ Enables -march=znver2
1326 -+
1327 - config MCRUSOE
1328 - bool "Crusoe"
1329 - depends on X86_32
1330 -@@ -263,7 +341,7 @@ config MPSC
1331 - in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one.
1332 -
1333 - config MCORE2
1334 -- bool "Core 2/newer Xeon"
1335 -+ bool "Intel Core 2"
1336 - ---help---
1337 -
1338 - Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and
1339 -@@ -271,6 +349,8 @@ config MCORE2
1340 - family in /proc/cpuinfo. Newer ones have 6 and older ones 15
1341 - (not a typo)
1342 -
1343 -+ Enables -march=core2
1344 -+
1345 - config MATOM
1346 - bool "Intel Atom"
1347 - ---help---
1348 -@@ -280,6 +360,132 @@ config MATOM
1349 - accordingly optimized code. Use a recent GCC with specific Atom
1350 - support in order to fully benefit from selecting this option.
1351 -
1352 -+config MNEHALEM
1353 -+ bool "Intel Nehalem"
1354 -+ select X86_P6_NOP
1355 -+ ---help---
1356 -+
1357 -+ Select this for 1st Gen Core processors in the Nehalem family.
1358 -+
1359 -+ Enables -march=nehalem
1360 -+
1361 -+config MWESTMERE
1362 -+ bool "Intel Westmere"
1363 -+ select X86_P6_NOP
1364 -+ ---help---
1365 -+
1366 -+ Select this for the Intel Westmere formerly Nehalem-C family.
1367 -+
1368 -+ Enables -march=westmere
1369 -+
1370 -+config MSILVERMONT
1371 -+ bool "Intel Silvermont"
1372 -+ select X86_P6_NOP
1373 -+ ---help---
1374 -+
1375 -+ Select this for the Intel Silvermont platform.
1376 -+
1377 -+ Enables -march=silvermont
1378 -+
1379 -+config MGOLDMONT
1380 -+ bool "Intel Goldmont"
1381 -+ select X86_P6_NOP
1382 -+ ---help---
1383 -+
1384 -+ Select this for the Intel Goldmont platform including Apollo Lake and Denverton.
1385 -+
1386 -+ Enables -march=goldmont
1387 -+
1388 -+config MGOLDMONTPLUS
1389 -+ bool "Intel Goldmont Plus"
1390 -+ select X86_P6_NOP
1391 -+ ---help---
1392 -+
1393 -+ Select this for the Intel Goldmont Plus platform including Gemini Lake.
1394 -+
1395 -+ Enables -march=goldmont-plus
1396 -+
1397 -+config MSANDYBRIDGE
1398 -+ bool "Intel Sandy Bridge"
1399 -+ select X86_P6_NOP
1400 -+ ---help---
1401 -+
1402 -+ Select this for 2nd Gen Core processors in the Sandy Bridge family.
1403 -+
1404 -+ Enables -march=sandybridge
1405 -+
1406 -+config MIVYBRIDGE
1407 -+ bool "Intel Ivy Bridge"
1408 -+ select X86_P6_NOP
1409 -+ ---help---
1410 -+
1411 -+ Select this for 3rd Gen Core processors in the Ivy Bridge family.
1412 -+
1413 -+ Enables -march=ivybridge
1414 -+
1415 -+config MHASWELL
1416 -+ bool "Intel Haswell"
1417 -+ select X86_P6_NOP
1418 -+ ---help---
1419 -+
1420 -+ Select this for 4th Gen Core processors in the Haswell family.
1421 -+
1422 -+ Enables -march=haswell
1423 -+
1424 -+config MBROADWELL
1425 -+ bool "Intel Broadwell"
1426 -+ select X86_P6_NOP
1427 -+ ---help---
1428 -+
1429 -+ Select this for 5th Gen Core processors in the Broadwell family.
1430 -+
1431 -+ Enables -march=broadwell
1432 -+
1433 -+config MSKYLAKE
1434 -+ bool "Intel Skylake"
1435 -+ select X86_P6_NOP
1436 -+ ---help---
1437 -+
1438 -+ Select this for 6th Gen Core processors in the Skylake family.
1439 -+
1440 -+ Enables -march=skylake
1441 -+
1442 -+config MSKYLAKEX
1443 -+ bool "Intel Skylake X"
1444 -+ select X86_P6_NOP
1445 -+ ---help---
1446 -+
1447 -+ Select this for 6th Gen Core processors in the Skylake X family.
1448 -+
1449 -+ Enables -march=skylake-avx512
1450 -+
1451 -+config MCANNONLAKE
1452 -+ bool "Intel Cannon Lake"
1453 -+ select X86_P6_NOP
1454 -+ ---help---
1455 -+
1456 -+ Select this for 8th Gen Core processors
1457 -+
1458 -+ Enables -march=cannonlake
1459 -+
1460 -+config MICELAKE
1461 -+ bool "Intel Ice Lake"
1462 -+ select X86_P6_NOP
1463 -+ ---help---
1464 -+
1465 -+ Select this for 10th Gen Core processors in the Ice Lake family.
1466 -+
1467 -+ Enables -march=icelake-client
1468 -+
1469 -+config MCASCADELAKE
1470 -+ bool "Intel Cascade Lake"
1471 -+ select X86_P6_NOP
1472 -+ ---help---
1473 -+
1474 -+ Select this for Xeon processors in the Cascade Lake family.
1475 -+
1476 -+ Enables -march=cascadelake
1477 -+
1478 - config GENERIC_CPU
1479 - bool "Generic-x86-64"
1480 - depends on X86_64
1481 -@@ -287,6 +493,16 @@ config GENERIC_CPU
1482 - Generic x86-64 CPU.
1483 - Run equally well on all x86-64 CPUs.
1484 -
1485 -+config MNATIVE
1486 -+ bool "Native optimizations autodetected by GCC"
1487 -+ ---help---
1488 -+
1489 -+ GCC 4.2 and above support -march=native, which automatically detects
1490 -+ the optimum settings to use based on your processor. Do NOT use this
1491 -+ for AMD CPUs. Intel Only!
1492 -+
1493 -+ Enables -march=native
1494 -+
1495 - endchoice
1496 -
1497 - config X86_GENERIC
1498 -@@ -311,7 +527,7 @@ config X86_INTERNODE_CACHE_SHIFT
1499 - config X86_L1_CACHE_SHIFT
1500 - int
1501 - default "7" if MPENTIUM4 || MPSC
1502 -- default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU
1503 -+ default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MNATIVE || X86_GENERIC || GENERIC_CPU
1504 - default "4" if MELAN || M486 || MGEODEGX1
1505 - default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
1506 -
1507 -@@ -329,11 +545,11 @@ config X86_ALIGNMENT_16
1508 -
1509 - config X86_INTEL_USERCOPY
1510 - def_bool y
1511 -- depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2
1512 -+ depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MNATIVE
1513 -
1514 - config X86_USE_PPRO_CHECKSUM
1515 - def_bool y
1516 -- depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM
1517 -+ depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MNATIVE
1518 -
1519 - config X86_USE_3DNOW
1520 - def_bool y
1521 -@@ -353,26 +569,26 @@ config X86_USE_3DNOW
1522 - config X86_P6_NOP
1523 - def_bool y
1524 - depends on X86_64
1525 -- depends on (MCORE2 || MPENTIUM4 || MPSC)
1526 -+ depends on (MCORE2 || MPENTIUM4 || MPSC || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MNATIVE)
1527 -
1528 - config X86_TSC
1529 - def_bool y
1530 -- depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM) || X86_64
1531 -+ depends on (MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2 || MATOM || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MNATIVE) || X86_64
1532 -
1533 - config X86_CMPXCHG64
1534 - def_bool y
1535 -- depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586TSC || M586MMX || MATOM || MGEODE_LX || MGEODEGX1 || MK6 || MK7 || MK8
1536 -+ depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586TSC || M586MMX || MATOM || MGEODE_LX || MGEODEGX1 || MK6 || MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MNATIVE
1537 -
1538 - # this should be set for all -march=.. options where the compiler
1539 - # generates cmov.
1540 - config X86_CMOV
1541 - def_bool y
1542 -- depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
1543 -+ depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MNATIVE)
1544 -
1545 - config X86_MINIMUM_CPU_FAMILY
1546 - int
1547 - default "64" if X86_64
1548 -- default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8)
1549 -+ default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MJAGUAR || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MZEN2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MNATIVE)
1550 - default "5" if X86_32 && X86_CMPXCHG64
1551 - default "4"
1552 -
1553 -diff --git a/arch/x86/Makefile b/arch/x86/Makefile
1554 -index 4833dd7e2cc0..a0289273da72 100644
1555 ---- a/arch/x86/Makefile
1556 -+++ b/arch/x86/Makefile
1557 -@@ -121,11 +121,38 @@ else
1558 - # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
1559 - cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
1560 - cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
1561 --
1562 -- cflags-$(CONFIG_MCORE2) += \
1563 -- $(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
1564 -- cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \
1565 -- $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic))
1566 -+ cflags-$(CONFIG_MK8SSE3) += $(call cc-option,-march=k8-sse3)
1567 -+ cflags-$(CONFIG_MK10) += $(call cc-option,-march=amdfam10)
1568 -+ cflags-$(CONFIG_MBARCELONA) += $(call cc-option,-march=barcelona)
1569 -+ cflags-$(CONFIG_MBOBCAT) += $(call cc-option,-march=btver1)
1570 -+ cflags-$(CONFIG_MJAGUAR) += $(call cc-option,-march=btver2)
1571 -+ cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1)
1572 -+ cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2)
1573 -+ cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-mno-tbm)
1574 -+ cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-march=bdver3)
1575 -+ cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-mno-tbm)
1576 -+ cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-march=bdver4)
1577 -+ cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-mno-tbm)
1578 -+ cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1)
1579 -+ cflags-$(CONFIG_MZEN2) += $(call cc-option,-march=znver2)
1580 -+
1581 -+ cflags-$(CONFIG_MNATIVE) += $(call cc-option,-march=native)
1582 -+ cflags-$(CONFIG_MATOM) += $(call cc-option,-march=bonnell)
1583 -+ cflags-$(CONFIG_MCORE2) += $(call cc-option,-march=core2)
1584 -+ cflags-$(CONFIG_MNEHALEM) += $(call cc-option,-march=nehalem)
1585 -+ cflags-$(CONFIG_MWESTMERE) += $(call cc-option,-march=westmere)
1586 -+ cflags-$(CONFIG_MSILVERMONT) += $(call cc-option,-march=silvermont)
1587 -+ cflags-$(CONFIG_MGOLDMONT) += $(call cc-option,-march=goldmont)
1588 -+ cflags-$(CONFIG_MGOLDMONTPLUS) += $(call cc-option,-march=goldmont-plus)
1589 -+ cflags-$(CONFIG_MSANDYBRIDGE) += $(call cc-option,-march=sandybridge)
1590 -+ cflags-$(CONFIG_MIVYBRIDGE) += $(call cc-option,-march=ivybridge)
1591 -+ cflags-$(CONFIG_MHASWELL) += $(call cc-option,-march=haswell)
1592 -+ cflags-$(CONFIG_MBROADWELL) += $(call cc-option,-march=broadwell)
1593 -+ cflags-$(CONFIG_MSKYLAKE) += $(call cc-option,-march=skylake)
1594 -+ cflags-$(CONFIG_MSKYLAKEX) += $(call cc-option,-march=skylake-avx512)
1595 -+ cflags-$(CONFIG_MCANNONLAKE) += $(call cc-option,-march=cannonlake)
1596 -+ cflags-$(CONFIG_MICELAKE) += $(call cc-option,-march=icelake-client)
1597 -+ cflags-$(CONFIG_MCASCADELAKE) += $(call cc-option,-march=cascadelake)
1598 - cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
1599 - KBUILD_CFLAGS += $(cflags-y)
1600 -
1601 -diff --git a/arch/x86/include/asm/module.h b/arch/x86/include/asm/module.h
1602 -index 7948a17febb4..50b5e6ee4934 100644
1603 ---- a/arch/x86/include/asm/module.h
1604 -+++ b/arch/x86/include/asm/module.h
1605 -@@ -25,6 +25,36 @@ struct mod_arch_specific {
1606 - #define MODULE_PROC_FAMILY "586MMX "
1607 - #elif defined CONFIG_MCORE2
1608 - #define MODULE_PROC_FAMILY "CORE2 "
1609 -+#elif defined CONFIG_MNATIVE
1610 -+#define MODULE_PROC_FAMILY "NATIVE "
1611 -+#elif defined CONFIG_MNEHALEM
1612 -+#define MODULE_PROC_FAMILY "NEHALEM "
1613 -+#elif defined CONFIG_MWESTMERE
1614 -+#define MODULE_PROC_FAMILY "WESTMERE "
1615 -+#elif defined CONFIG_MSILVERMONT
1616 -+#define MODULE_PROC_FAMILY "SILVERMONT "
1617 -+#elif defined CONFIG_MGOLDMONT
1618 -+#define MODULE_PROC_FAMILY "GOLDMONT "
1619 -+#elif defined CONFIG_MGOLDMONTPLUS
1620 -+#define MODULE_PROC_FAMILY "GOLDMONTPLUS "
1621 -+#elif defined CONFIG_MSANDYBRIDGE
1622 -+#define MODULE_PROC_FAMILY "SANDYBRIDGE "
1623 -+#elif defined CONFIG_MIVYBRIDGE
1624 -+#define MODULE_PROC_FAMILY "IVYBRIDGE "
1625 -+#elif defined CONFIG_MHASWELL
1626 -+#define MODULE_PROC_FAMILY "HASWELL "
1627 -+#elif defined CONFIG_MBROADWELL
1628 -+#define MODULE_PROC_FAMILY "BROADWELL "
1629 -+#elif defined CONFIG_MSKYLAKE
1630 -+#define MODULE_PROC_FAMILY "SKYLAKE "
1631 -+#elif defined CONFIG_MSKYLAKEX
1632 -+#define MODULE_PROC_FAMILY "SKYLAKEX "
1633 -+#elif defined CONFIG_MCANNONLAKE
1634 -+#define MODULE_PROC_FAMILY "CANNONLAKE "
1635 -+#elif defined CONFIG_MICELAKE
1636 -+#define MODULE_PROC_FAMILY "ICELAKE "
1637 -+#elif defined CONFIG_MCASCADELAKE
1638 -+#define MODULE_PROC_FAMILY "CASCADELAKE "
1639 - #elif defined CONFIG_MATOM
1640 - #define MODULE_PROC_FAMILY "ATOM "
1641 - #elif defined CONFIG_M686
1642 -@@ -43,6 +73,28 @@ struct mod_arch_specific {
1643 - #define MODULE_PROC_FAMILY "K7 "
1644 - #elif defined CONFIG_MK8
1645 - #define MODULE_PROC_FAMILY "K8 "
1646 -+#elif defined CONFIG_MK8SSE3
1647 -+#define MODULE_PROC_FAMILY "K8SSE3 "
1648 -+#elif defined CONFIG_MK10
1649 -+#define MODULE_PROC_FAMILY "K10 "
1650 -+#elif defined CONFIG_MBARCELONA
1651 -+#define MODULE_PROC_FAMILY "BARCELONA "
1652 -+#elif defined CONFIG_MBOBCAT
1653 -+#define MODULE_PROC_FAMILY "BOBCAT "
1654 -+#elif defined CONFIG_MBULLDOZER
1655 -+#define MODULE_PROC_FAMILY "BULLDOZER "
1656 -+#elif defined CONFIG_MPILEDRIVER
1657 -+#define MODULE_PROC_FAMILY "PILEDRIVER "
1658 -+#elif defined CONFIG_MSTEAMROLLER
1659 -+#define MODULE_PROC_FAMILY "STEAMROLLER "
1660 -+#elif defined CONFIG_MJAGUAR
1661 -+#define MODULE_PROC_FAMILY "JAGUAR "
1662 -+#elif defined CONFIG_MEXCAVATOR
1663 -+#define MODULE_PROC_FAMILY "EXCAVATOR "
1664 -+#elif defined CONFIG_MZEN
1665 -+#define MODULE_PROC_FAMILY "ZEN "
1666 -+#elif defined CONFIG_MZEN2
1667 -+#define MODULE_PROC_FAMILY "ZEN2 "
1668 - #elif defined CONFIG_MELAN
1669 - #define MODULE_PROC_FAMILY "ELAN "
1670 - #elif defined CONFIG_MCRUSOE
1671 ---
1672 -2.30.1
1673 -