001-enable-uarches-patch.patch 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. From d31d2b0747ab55e65c2366d51149a0ec9896155e Mon Sep 17 00:00:00 2001
  2. From: graysky <graysky@archlinux.us>
  3. Date: Tue, 14 Sep 2021 15:35:34 -0400
  4. Subject: [PATCH] more uarches for kernel 5.15-5.16
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. FEATURES
  9. This patch adds additional CPU options to the Linux kernel accessible under:
  10. Processor type and features --->
  11. Processor family --->
  12. With the release of gcc 11.1 and clang 12.0, several generic 64-bit levels are
  13. offered which are good for supported Intel or AMD CPUs:
  14. • x86-64-v2
  15. • x86-64-v3
  16. • x86-64-v4
  17. Users of glibc 2.33 and above can see which level is supported by current
  18. hardware by running:
  19. /lib/ld-linux-x86-64.so.2 --help | grep supported
  20. Alternatively, compare the flags from /proc/cpuinfo to this list.[1]
  21. CPU-specific microarchitectures include:
  22. • AMD Improved K8-family
  23. • AMD K10-family
  24. • AMD Family 10h (Barcelona)
  25. • AMD Family 14h (Bobcat)
  26. • AMD Family 16h (Jaguar)
  27. • AMD Family 15h (Bulldozer)
  28. • AMD Family 15h (Piledriver)
  29. • AMD Family 15h (Steamroller)
  30. • AMD Family 15h (Excavator)
  31. • AMD Family 17h (Zen)
  32. • AMD Family 17h (Zen 2)
  33. • AMD Family 19h (Zen 3)†
  34. • Intel Silvermont low-power processors
  35. • Intel Goldmont low-power processors (Apollo Lake and Denverton)
  36. • Intel Goldmont Plus low-power processors (Gemini Lake)
  37. • Intel 1st Gen Core i3/i5/i7 (Nehalem)
  38. • Intel 1.5 Gen Core i3/i5/i7 (Westmere)
  39. • Intel 2nd Gen Core i3/i5/i7 (Sandybridge)
  40. • Intel 3rd Gen Core i3/i5/i7 (Ivybridge)
  41. • Intel 4th Gen Core i3/i5/i7 (Haswell)
  42. • Intel 5th Gen Core i3/i5/i7 (Broadwell)
  43. • Intel 6th Gen Core i3/i5/i7 (Skylake)
  44. • Intel 6th Gen Core i7/i9 (Skylake X)
  45. • Intel 8th Gen Core i3/i5/i7 (Cannon Lake)
  46. • Intel 10th Gen Core i7/i9 (Ice Lake)
  47. • Intel Xeon (Cascade Lake)
  48. • Intel Xeon (Cooper Lake)*
  49. • Intel 3rd Gen 10nm++ i3/i5/i7/i9-family (Tiger Lake)*
  50. • Intel 3rd Gen 10nm++ Xeon (Sapphire Rapids)‡
  51. • Intel 11th Gen i3/i5/i7/i9-family (Rocket Lake)‡
  52. • Intel 12th Gen i3/i5/i7/i9-family (Alder Lake)‡
  53. Notes: If not otherwise noted, gcc >=9.1 is required for support.
  54. *Requires gcc >=10.1 or clang >=10.0
  55. †Required gcc >=10.3 or clang >=12.0
  56. ‡Required gcc >=11.1 or clang >=12.0
  57. It also offers to compile passing the 'native' option which, "selects the CPU
  58. to generate code for at compilation time by determining the processor type of
  59. the compiling machine. Using -march=native enables all instruction subsets
  60. supported by the local machine and will produce code optimized for the local
  61. machine under the constraints of the selected instruction set."[2]
  62. Users of Intel CPUs should select the 'Intel-Native' option and users of AMD
  63. CPUs should select the 'AMD-Native' option.
  64. MINOR NOTES RELATING TO INTEL ATOM PROCESSORS
  65. This patch also changes -march=atom to -march=bonnell in accordance with the
  66. gcc v4.9 changes. Upstream is using the deprecated -match=atom flags when I
  67. believe it should use the newer -march=bonnell flag for atom processors.[3]
  68. It is not recommended to compile on Atom-CPUs with the 'native' option.[4] The
  69. recommendation is to use the 'atom' option instead.
  70. BENEFITS
  71. Small but real speed increases are measurable using a make endpoint comparing
  72. a generic kernel to one built with one of the respective microarchs.
  73. See the following experimental evidence supporting this statement:
  74. https://github.com/graysky2/kernel_gcc_patch
  75. REQUIREMENTS
  76. linux version 5.15-5.16
  77. gcc version >=9.0 or clang version >=9.0
  78. ACKNOWLEDGMENTS
  79. This patch builds on the seminal work by Jeroen.[5]
  80. REFERENCES
  81. 1. https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/77566eb03bc6a326811cb7e9
  82. 2. https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html#index-x86-Options
  83. 3. https://bugzilla.kernel.org/show_bug.cgi?id=77461
  84. 4. https://github.com/graysky2/kernel_gcc_patch/issues/15
  85. 5. http://www.linuxforge.net/docs/linux/linux-gcc.php
  86. Signed-off-by: graysky <graysky@archlinux.us>
  87. ---
  88. arch/x86/Kconfig.cpu | 332 ++++++++++++++++++++++++++++++--
  89. arch/x86/Makefile | 40 +++-
  90. arch/x86/include/asm/vermagic.h | 66 +++++++
  91. 3 files changed, 424 insertions(+), 14 deletions(-)
  92. diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
  93. index eefc434351db..331f7631339a 100644
  94. --- a/arch/x86/Kconfig.cpu
  95. +++ b/arch/x86/Kconfig.cpu
  96. @@ -157,7 +157,7 @@ config MPENTIUM4
  97. config MK6
  98. - bool "K6/K6-II/K6-III"
  99. + bool "AMD K6/K6-II/K6-III"
  100. depends on X86_32
  101. help
  102. Select this for an AMD K6-family processor. Enables use of
  103. @@ -165,7 +165,7 @@ config MK6
  104. flags to GCC.
  105. config MK7
  106. - bool "Athlon/Duron/K7"
  107. + bool "AMD Athlon/Duron/K7"
  108. depends on X86_32
  109. help
  110. Select this for an AMD Athlon K7-family processor. Enables use of
  111. @@ -173,12 +173,98 @@ config MK7
  112. flags to GCC.
  113. config MK8
  114. - bool "Opteron/Athlon64/Hammer/K8"
  115. + bool "AMD Opteron/Athlon64/Hammer/K8"
  116. help
  117. Select this for an AMD Opteron or Athlon64 Hammer-family processor.
  118. Enables use of some extended instructions, and passes appropriate
  119. optimization flags to GCC.
  120. +config MK8SSE3
  121. + bool "AMD Opteron/Athlon64/Hammer/K8 with SSE3"
  122. + help
  123. + Select this for improved AMD Opteron or Athlon64 Hammer-family processors.
  124. + Enables use of some extended instructions, and passes appropriate
  125. + optimization flags to GCC.
  126. +
  127. +config MK10
  128. + bool "AMD 61xx/7x50/PhenomX3/X4/II/K10"
  129. + help
  130. + Select this for an AMD 61xx Eight-Core Magny-Cours, Athlon X2 7x50,
  131. + Phenom X3/X4/II, Athlon II X2/X3/X4, or Turion II-family processor.
  132. + Enables use of some extended instructions, and passes appropriate
  133. + optimization flags to GCC.
  134. +
  135. +config MBARCELONA
  136. + bool "AMD Barcelona"
  137. + help
  138. + Select this for AMD Family 10h Barcelona processors.
  139. +
  140. + Enables -march=barcelona
  141. +
  142. +config MBOBCAT
  143. + bool "AMD Bobcat"
  144. + help
  145. + Select this for AMD Family 14h Bobcat processors.
  146. +
  147. + Enables -march=btver1
  148. +
  149. +config MJAGUAR
  150. + bool "AMD Jaguar"
  151. + help
  152. + Select this for AMD Family 16h Jaguar processors.
  153. +
  154. + Enables -march=btver2
  155. +
  156. +config MBULLDOZER
  157. + bool "AMD Bulldozer"
  158. + help
  159. + Select this for AMD Family 15h Bulldozer processors.
  160. +
  161. + Enables -march=bdver1
  162. +
  163. +config MPILEDRIVER
  164. + bool "AMD Piledriver"
  165. + help
  166. + Select this for AMD Family 15h Piledriver processors.
  167. +
  168. + Enables -march=bdver2
  169. +
  170. +config MSTEAMROLLER
  171. + bool "AMD Steamroller"
  172. + help
  173. + Select this for AMD Family 15h Steamroller processors.
  174. +
  175. + Enables -march=bdver3
  176. +
  177. +config MEXCAVATOR
  178. + bool "AMD Excavator"
  179. + help
  180. + Select this for AMD Family 15h Excavator processors.
  181. +
  182. + Enables -march=bdver4
  183. +
  184. +config MZEN
  185. + bool "AMD Zen"
  186. + help
  187. + Select this for AMD Family 17h Zen processors.
  188. +
  189. + Enables -march=znver1
  190. +
  191. +config MZEN2
  192. + bool "AMD Zen 2"
  193. + help
  194. + Select this for AMD Family 17h Zen 2 processors.
  195. +
  196. + Enables -march=znver2
  197. +
  198. +config MZEN3
  199. + bool "AMD Zen 3"
  200. + depends on (CC_IS_GCC && GCC_VERSION >= 100300) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
  201. + help
  202. + Select this for AMD Family 19h Zen 3 processors.
  203. +
  204. + Enables -march=znver3
  205. +
  206. config MCRUSOE
  207. bool "Crusoe"
  208. depends on X86_32
  209. @@ -270,7 +356,7 @@ config MPSC
  210. in /proc/cpuinfo. Family 15 is an older Xeon, Family 6 a newer one.
  211. config MCORE2
  212. - bool "Core 2/newer Xeon"
  213. + bool "Intel Core 2"
  214. help
  215. Select this for Intel Core 2 and newer Core 2 Xeons (Xeon 51xx and
  216. @@ -278,6 +364,8 @@ config MCORE2
  217. family in /proc/cpuinfo. Newer ones have 6 and older ones 15
  218. (not a typo)
  219. + Enables -march=core2
  220. +
  221. config MATOM
  222. bool "Intel Atom"
  223. help
  224. @@ -287,6 +375,182 @@ config MATOM
  225. accordingly optimized code. Use a recent GCC with specific Atom
  226. support in order to fully benefit from selecting this option.
  227. +config MNEHALEM
  228. + bool "Intel Nehalem"
  229. + select X86_P6_NOP
  230. + help
  231. +
  232. + Select this for 1st Gen Core processors in the Nehalem family.
  233. +
  234. + Enables -march=nehalem
  235. +
  236. +config MWESTMERE
  237. + bool "Intel Westmere"
  238. + select X86_P6_NOP
  239. + help
  240. +
  241. + Select this for the Intel Westmere formerly Nehalem-C family.
  242. +
  243. + Enables -march=westmere
  244. +
  245. +config MSILVERMONT
  246. + bool "Intel Silvermont"
  247. + select X86_P6_NOP
  248. + help
  249. +
  250. + Select this for the Intel Silvermont platform.
  251. +
  252. + Enables -march=silvermont
  253. +
  254. +config MGOLDMONT
  255. + bool "Intel Goldmont"
  256. + select X86_P6_NOP
  257. + help
  258. +
  259. + Select this for the Intel Goldmont platform including Apollo Lake and Denverton.
  260. +
  261. + Enables -march=goldmont
  262. +
  263. +config MGOLDMONTPLUS
  264. + bool "Intel Goldmont Plus"
  265. + select X86_P6_NOP
  266. + help
  267. +
  268. + Select this for the Intel Goldmont Plus platform including Gemini Lake.
  269. +
  270. + Enables -march=goldmont-plus
  271. +
  272. +config MSANDYBRIDGE
  273. + bool "Intel Sandy Bridge"
  274. + select X86_P6_NOP
  275. + help
  276. +
  277. + Select this for 2nd Gen Core processors in the Sandy Bridge family.
  278. +
  279. + Enables -march=sandybridge
  280. +
  281. +config MIVYBRIDGE
  282. + bool "Intel Ivy Bridge"
  283. + select X86_P6_NOP
  284. + help
  285. +
  286. + Select this for 3rd Gen Core processors in the Ivy Bridge family.
  287. +
  288. + Enables -march=ivybridge
  289. +
  290. +config MHASWELL
  291. + bool "Intel Haswell"
  292. + select X86_P6_NOP
  293. + help
  294. +
  295. + Select this for 4th Gen Core processors in the Haswell family.
  296. +
  297. + Enables -march=haswell
  298. +
  299. +config MBROADWELL
  300. + bool "Intel Broadwell"
  301. + select X86_P6_NOP
  302. + help
  303. +
  304. + Select this for 5th Gen Core processors in the Broadwell family.
  305. +
  306. + Enables -march=broadwell
  307. +
  308. +config MSKYLAKE
  309. + bool "Intel Skylake"
  310. + select X86_P6_NOP
  311. + help
  312. +
  313. + Select this for 6th Gen Core processors in the Skylake family.
  314. +
  315. + Enables -march=skylake
  316. +
  317. +config MSKYLAKEX
  318. + bool "Intel Skylake X"
  319. + select X86_P6_NOP
  320. + help
  321. +
  322. + Select this for 6th Gen Core processors in the Skylake X family.
  323. +
  324. + Enables -march=skylake-avx512
  325. +
  326. +config MCANNONLAKE
  327. + bool "Intel Cannon Lake"
  328. + select X86_P6_NOP
  329. + help
  330. +
  331. + Select this for 8th Gen Core processors
  332. +
  333. + Enables -march=cannonlake
  334. +
  335. +config MICELAKE
  336. + bool "Intel Ice Lake"
  337. + select X86_P6_NOP
  338. + help
  339. +
  340. + Select this for 10th Gen Core processors in the Ice Lake family.
  341. +
  342. + Enables -march=icelake-client
  343. +
  344. +config MCASCADELAKE
  345. + bool "Intel Cascade Lake"
  346. + select X86_P6_NOP
  347. + help
  348. +
  349. + Select this for Xeon processors in the Cascade Lake family.
  350. +
  351. + Enables -march=cascadelake
  352. +
  353. +config MCOOPERLAKE
  354. + bool "Intel Cooper Lake"
  355. + depends on (CC_IS_GCC && GCC_VERSION > 100100) || (CC_IS_CLANG && CLANG_VERSION >= 100000)
  356. + select X86_P6_NOP
  357. + help
  358. +
  359. + Select this for Xeon processors in the Cooper Lake family.
  360. +
  361. + Enables -march=cooperlake
  362. +
  363. +config MTIGERLAKE
  364. + bool "Intel Tiger Lake"
  365. + depends on (CC_IS_GCC && GCC_VERSION > 100100) || (CC_IS_CLANG && CLANG_VERSION >= 100000)
  366. + select X86_P6_NOP
  367. + help
  368. +
  369. + Select this for third-generation 10 nm process processors in the Tiger Lake family.
  370. +
  371. + Enables -march=tigerlake
  372. +
  373. +config MSAPPHIRERAPIDS
  374. + bool "Intel Sapphire Rapids"
  375. + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
  376. + select X86_P6_NOP
  377. + help
  378. +
  379. + Select this for third-generation 10 nm process processors in the Sapphire Rapids family.
  380. +
  381. + Enables -march=sapphirerapids
  382. +
  383. +config MROCKETLAKE
  384. + bool "Intel Rocket Lake"
  385. + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
  386. + select X86_P6_NOP
  387. + help
  388. +
  389. + Select this for eleventh-generation processors in the Rocket Lake family.
  390. +
  391. + Enables -march=rocketlake
  392. +
  393. +config MALDERLAKE
  394. + bool "Intel Alder Lake"
  395. + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
  396. + select X86_P6_NOP
  397. + help
  398. +
  399. + Select this for twelfth-generation processors in the Alder Lake family.
  400. +
  401. + Enables -march=alderlake
  402. +
  403. config GENERIC_CPU
  404. bool "Generic-x86-64"
  405. depends on X86_64
  406. @@ -294,6 +558,50 @@ config GENERIC_CPU
  407. Generic x86-64 CPU.
  408. Run equally well on all x86-64 CPUs.
  409. +config GENERIC_CPU2
  410. + bool "Generic-x86-64-v2"
  411. + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
  412. + depends on X86_64
  413. + help
  414. + Generic x86-64 CPU.
  415. + Run equally well on all x86-64 CPUs with min support of x86-64-v2.
  416. +
  417. +config GENERIC_CPU3
  418. + bool "Generic-x86-64-v3"
  419. + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
  420. + depends on X86_64
  421. + help
  422. + Generic x86-64-v3 CPU with v3 instructions.
  423. + Run equally well on all x86-64 CPUs with min support of x86-64-v3.
  424. +
  425. +config GENERIC_CPU4
  426. + bool "Generic-x86-64-v4"
  427. + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000)
  428. + depends on X86_64
  429. + help
  430. + Generic x86-64 CPU with v4 instructions.
  431. + Run equally well on all x86-64 CPUs with min support of x86-64-v4.
  432. +
  433. +config MNATIVE_INTEL
  434. + bool "Intel-Native optimizations autodetected by the compiler"
  435. + help
  436. +
  437. + Clang 3.8, GCC 4.2 and above support -march=native, which automatically detects
  438. + the optimum settings to use based on your processor. Do NOT use this
  439. + for AMD CPUs. Intel Only!
  440. +
  441. + Enables -march=native
  442. +
  443. +config MNATIVE_AMD
  444. + bool "AMD-Native optimizations autodetected by the compiler"
  445. + help
  446. +
  447. + Clang 3.8, GCC 4.2 and above support -march=native, which automatically detects
  448. + the optimum settings to use based on your processor. Do NOT use this
  449. + for Intel CPUs. AMD Only!
  450. +
  451. + Enables -march=native
  452. +
  453. endchoice
  454. config X86_GENERIC
  455. @@ -318,7 +626,7 @@ config X86_INTERNODE_CACHE_SHIFT
  456. config X86_L1_CACHE_SHIFT
  457. int
  458. default "7" if MPENTIUM4 || MPSC
  459. - default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MATOM || MVIAC7 || X86_GENERIC || GENERIC_CPU
  460. + 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
  461. default "4" if MELAN || M486SX || M486 || MGEODEGX1
  462. default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
  463. @@ -336,11 +644,11 @@ config X86_ALIGNMENT_16
  464. config X86_INTEL_USERCOPY
  465. def_bool y
  466. - depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2
  467. + 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
  468. config X86_USE_PPRO_CHECKSUM
  469. def_bool y
  470. - depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM
  471. + 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
  472. config X86_USE_3DNOW
  473. def_bool y
  474. @@ -360,26 +668,26 @@ config X86_USE_3DNOW
  475. config X86_P6_NOP
  476. def_bool y
  477. depends on X86_64
  478. - depends on (MCORE2 || MPENTIUM4 || MPSC)
  479. + 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)
  480. config X86_TSC
  481. def_bool y
  482. - 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
  483. + 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
  484. config X86_CMPXCHG64
  485. def_bool y
  486. - depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586TSC || M586MMX || MATOM || MGEODE_LX || MGEODEGX1 || MK6 || MK7 || MK8
  487. + 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
  488. # this should be set for all -march=.. options where the compiler
  489. # generates cmov.
  490. config X86_CMOV
  491. def_bool y
  492. - depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
  493. + 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)
  494. config X86_MINIMUM_CPU_FAMILY
  495. int
  496. default "64" if X86_64
  497. - default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8)
  498. + 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)
  499. default "5" if X86_32 && X86_CMPXCHG64
  500. default "4"
  501. diff --git a/arch/x86/Makefile b/arch/x86/Makefile
  502. index 42243869216d..ab1ad6959b96 100644
  503. --- a/arch/x86/Makefile
  504. +++ b/arch/x86/Makefile
  505. @@ -119,8 +119,44 @@ else
  506. # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
  507. cflags-$(CONFIG_MK8) += -march=k8
  508. cflags-$(CONFIG_MPSC) += -march=nocona
  509. - cflags-$(CONFIG_MCORE2) += -march=core2
  510. - cflags-$(CONFIG_MATOM) += -march=atom
  511. + cflags-$(CONFIG_MK8SSE3) += -march=k8-sse3
  512. + cflags-$(CONFIG_MK10) += -march=amdfam10
  513. + cflags-$(CONFIG_MBARCELONA) += -march=barcelona
  514. + cflags-$(CONFIG_MBOBCAT) += -march=btver1
  515. + cflags-$(CONFIG_MJAGUAR) += -march=btver2
  516. + cflags-$(CONFIG_MBULLDOZER) += -march=bdver1
  517. + cflags-$(CONFIG_MPILEDRIVER) += -march=bdver2 -mno-tbm
  518. + cflags-$(CONFIG_MSTEAMROLLER) += -march=bdver3 -mno-tbm
  519. + cflags-$(CONFIG_MEXCAVATOR) += -march=bdver4 -mno-tbm
  520. + cflags-$(CONFIG_MZEN) += -march=znver1
  521. + cflags-$(CONFIG_MZEN2) += -march=znver2
  522. + cflags-$(CONFIG_MZEN3) += -march=znver3
  523. + cflags-$(CONFIG_MNATIVE_INTEL) += -march=native
  524. + cflags-$(CONFIG_MNATIVE_AMD) += -march=native
  525. + cflags-$(CONFIG_MATOM) += -march=bonnell
  526. + cflags-$(CONFIG_MCORE2) += -march=core2
  527. + cflags-$(CONFIG_MNEHALEM) += -march=nehalem
  528. + cflags-$(CONFIG_MWESTMERE) += -march=westmere
  529. + cflags-$(CONFIG_MSILVERMONT) += -march=silvermont
  530. + cflags-$(CONFIG_MGOLDMONT) += -march=goldmont
  531. + cflags-$(CONFIG_MGOLDMONTPLUS) += -march=goldmont-plus
  532. + cflags-$(CONFIG_MSANDYBRIDGE) += -march=sandybridge
  533. + cflags-$(CONFIG_MIVYBRIDGE) += -march=ivybridge
  534. + cflags-$(CONFIG_MHASWELL) += -march=haswell
  535. + cflags-$(CONFIG_MBROADWELL) += -march=broadwell
  536. + cflags-$(CONFIG_MSKYLAKE) += -march=skylake
  537. + cflags-$(CONFIG_MSKYLAKEX) += -march=skylake-avx512
  538. + cflags-$(CONFIG_MCANNONLAKE) += -march=cannonlake
  539. + cflags-$(CONFIG_MICELAKE) += -march=icelake-client
  540. + cflags-$(CONFIG_MCASCADELAKE) += -march=cascadelake
  541. + cflags-$(CONFIG_MCOOPERLAKE) += -march=cooperlake
  542. + cflags-$(CONFIG_MTIGERLAKE) += -march=tigerlake
  543. + cflags-$(CONFIG_MSAPPHIRERAPIDS) += -march=sapphirerapids
  544. + cflags-$(CONFIG_MROCKETLAKE) += -march=rocketlake
  545. + cflags-$(CONFIG_MALDERLAKE) += -march=alderlake
  546. + cflags-$(CONFIG_GENERIC_CPU2) += -march=x86-64-v2
  547. + cflags-$(CONFIG_GENERIC_CPU3) += -march=x86-64-v3
  548. + cflags-$(CONFIG_GENERIC_CPU4) += -march=x86-64-v4
  549. cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic
  550. KBUILD_CFLAGS += $(cflags-y)
  551. diff --git a/arch/x86/include/asm/vermagic.h b/arch/x86/include/asm/vermagic.h
  552. index 75884d2cdec3..4e6a08d4c7e5 100644
  553. --- a/arch/x86/include/asm/vermagic.h
  554. +++ b/arch/x86/include/asm/vermagic.h
  555. @@ -17,6 +17,48 @@
  556. #define MODULE_PROC_FAMILY "586MMX "
  557. #elif defined CONFIG_MCORE2
  558. #define MODULE_PROC_FAMILY "CORE2 "
  559. +#elif defined CONFIG_MNATIVE_INTEL
  560. +#define MODULE_PROC_FAMILY "NATIVE_INTEL "
  561. +#elif defined CONFIG_MNATIVE_AMD
  562. +#define MODULE_PROC_FAMILY "NATIVE_AMD "
  563. +#elif defined CONFIG_MNEHALEM
  564. +#define MODULE_PROC_FAMILY "NEHALEM "
  565. +#elif defined CONFIG_MWESTMERE
  566. +#define MODULE_PROC_FAMILY "WESTMERE "
  567. +#elif defined CONFIG_MSILVERMONT
  568. +#define MODULE_PROC_FAMILY "SILVERMONT "
  569. +#elif defined CONFIG_MGOLDMONT
  570. +#define MODULE_PROC_FAMILY "GOLDMONT "
  571. +#elif defined CONFIG_MGOLDMONTPLUS
  572. +#define MODULE_PROC_FAMILY "GOLDMONTPLUS "
  573. +#elif defined CONFIG_MSANDYBRIDGE
  574. +#define MODULE_PROC_FAMILY "SANDYBRIDGE "
  575. +#elif defined CONFIG_MIVYBRIDGE
  576. +#define MODULE_PROC_FAMILY "IVYBRIDGE "
  577. +#elif defined CONFIG_MHASWELL
  578. +#define MODULE_PROC_FAMILY "HASWELL "
  579. +#elif defined CONFIG_MBROADWELL
  580. +#define MODULE_PROC_FAMILY "BROADWELL "
  581. +#elif defined CONFIG_MSKYLAKE
  582. +#define MODULE_PROC_FAMILY "SKYLAKE "
  583. +#elif defined CONFIG_MSKYLAKEX
  584. +#define MODULE_PROC_FAMILY "SKYLAKEX "
  585. +#elif defined CONFIG_MCANNONLAKE
  586. +#define MODULE_PROC_FAMILY "CANNONLAKE "
  587. +#elif defined CONFIG_MICELAKE
  588. +#define MODULE_PROC_FAMILY "ICELAKE "
  589. +#elif defined CONFIG_MCASCADELAKE
  590. +#define MODULE_PROC_FAMILY "CASCADELAKE "
  591. +#elif defined CONFIG_MCOOPERLAKE
  592. +#define MODULE_PROC_FAMILY "COOPERLAKE "
  593. +#elif defined CONFIG_MTIGERLAKE
  594. +#define MODULE_PROC_FAMILY "TIGERLAKE "
  595. +#elif defined CONFIG_MSAPPHIRERAPIDS
  596. +#define MODULE_PROC_FAMILY "SAPPHIRERAPIDS "
  597. +#elif defined CONFIG_ROCKETLAKE
  598. +#define MODULE_PROC_FAMILY "ROCKETLAKE "
  599. +#elif defined CONFIG_MALDERLAKE
  600. +#define MODULE_PROC_FAMILY "ALDERLAKE "
  601. #elif defined CONFIG_MATOM
  602. #define MODULE_PROC_FAMILY "ATOM "
  603. #elif defined CONFIG_M686
  604. @@ -35,6 +77,30 @@
  605. #define MODULE_PROC_FAMILY "K7 "
  606. #elif defined CONFIG_MK8
  607. #define MODULE_PROC_FAMILY "K8 "
  608. +#elif defined CONFIG_MK8SSE3
  609. +#define MODULE_PROC_FAMILY "K8SSE3 "
  610. +#elif defined CONFIG_MK10
  611. +#define MODULE_PROC_FAMILY "K10 "
  612. +#elif defined CONFIG_MBARCELONA
  613. +#define MODULE_PROC_FAMILY "BARCELONA "
  614. +#elif defined CONFIG_MBOBCAT
  615. +#define MODULE_PROC_FAMILY "BOBCAT "
  616. +#elif defined CONFIG_MBULLDOZER
  617. +#define MODULE_PROC_FAMILY "BULLDOZER "
  618. +#elif defined CONFIG_MPILEDRIVER
  619. +#define MODULE_PROC_FAMILY "PILEDRIVER "
  620. +#elif defined CONFIG_MSTEAMROLLER
  621. +#define MODULE_PROC_FAMILY "STEAMROLLER "
  622. +#elif defined CONFIG_MJAGUAR
  623. +#define MODULE_PROC_FAMILY "JAGUAR "
  624. +#elif defined CONFIG_MEXCAVATOR
  625. +#define MODULE_PROC_FAMILY "EXCAVATOR "
  626. +#elif defined CONFIG_MZEN
  627. +#define MODULE_PROC_FAMILY "ZEN "
  628. +#elif defined CONFIG_MZEN2
  629. +#define MODULE_PROC_FAMILY "ZEN2 "
  630. +#elif defined CONFIG_MZEN3
  631. +#define MODULE_PROC_FAMILY "ZEN3 "
  632. #elif defined CONFIG_MELAN
  633. #define MODULE_PROC_FAMILY "ELAN "
  634. #elif defined CONFIG_MCRUSOE
  635. --
  636. 2.33.1