Giter Club home page Giter Club logo

kernel_compiler_patch's Introduction

kernel_compiler_patch

This patch adds additional optimization/tuning for kernel builds by adding more micro-architectures options accessible under:

 Processor type and features  --->
 Processor family --->

Why a specific patch?

The kernel uses its own set of CFLAGS, KCFLAGS. For example, see:

Alternative way to define a -march= option without this patch

As pointed out by codemac in this topic, one can simply export the value/values for the KCFLAGS and KCPPFLAGS before calling make to achieve the same result, see here.

export KCFLAGS=' -march=znver3 -mtune=znver3'
export KCPPFLAGS=' -march=znver3 -mtune=znver3'
make all

Expanded CPUs include

CPU Family -march= Min GCC Ver Min Clang Ver
Native optimizations autodetected by GCC native 4.2 3.8
Generic 64-bit level v2 x86-64-v2 11.1 12.0
Generic 64-bit level v3 x86-64-v3 11.1 12.0
Generic 64-bit level v4 x86-64-v4 11.1 12.0
AMD Improved K8-family k8-sse3 9.3 9.0
AMD K10-family amdfam10 9.3 9.0
AMD Family 10h (Barcelona) barcelona 9.3 9.0
AMD Family 14h (Bobcat) btver1 9.3 9.0
AMD Family 16h (Jaguar) btver2 9.3 9.0
AMD Family 15h (Bulldozer) bdver1 9.3 9.0
AMD Family 15h (Piledriver) bdver2 9.3 9.0
AMD Family 15h (Steamroller) bdver3 9.3 9.0
AMD Family 15h (Excavator) bdver4 9.3 9.0
AMD Family 17h (Zen) znver1 9.3 9.0
AMD Family 17h (Zen 2) znver2 9.3 9.0
AMD Family 19h (Zen 3) znver3 10.3 12.0
AMD Family 19h (Zen 4) znver4 13.0 17.0
AMD Family 19h (Zen 5) znver5 14.1 ???
Intel Bonnell family Atom bonnell 9.3 9.0
Intel Silvermont family Atom silvermont 9.3 9.0
Intel Goldmont family Atom (Apollo Lake and Denverton) goldmont 9.3 9.0
Intel Goldmont Plus family Atom (Gemini Lake) goldmont-plus 9.3 9.0
Intel 1st Gen Core i3/i5/i7-family (Nehalem) nehalem 9.3 9.0
Intel 1.5 Gen Core i3/i5/i7-family (Westmere) westmere 9.3 9.0
Intel 2nd Gen Core i3/i5/i7-family (Sandybridge) sandybridge 9.3 9.0
Intel 3rd Gen Core i3/i5/i7-family (Ivybridge) ivybridge 9.3 9.0
Intel 4th Gen Core i3/i5/i7-family (Haswell) haswell 9.3 9.0
Intel 5th Gen Core i3/i5/i7-family (Broadwell) broadwell 9.3 9.0
Intel 6th Gen Core i3/i5/i7-family (Skylake) skylake 9.3 9.0
Intel 6th Gen Core i7/i9-family (Skylake X) skylake-avx512 9.3 9.0
Intel 8th Gen Core i3/i5/i7-family (Cannon Lake) cannonlake 9.3 9.0
Intel 10th Gen Core i7/i9-family (Ice Lake) icelake-client 9.3 9.0
Intel Xeon (Cascade Lake) cascadelake 10.2 10.0
Intel Xeon (Cooper Lake) cooperlake 10.2 10.0
Intel 3rd Gen 10nm++ i3/i5/i7/i9-family (Tiger Lake) cooperlake 10.2 10.0
Intel 4th Gen 10nm++ Xeon (Sapphire Rapids) sapphirerapids 11.1 12.0
Intel 11th Gen i3/i5/i7/i9-family (Rocket Lake) rocketlake 11.1 12.0
Intel 12th Gen i3/i5/i7/i9-family (Alder Lake) alderlake 11.1 12.0
Intel 13th Gen i3/i5/i7/i9-family (Raptor Lake) raptorlake 13.0 15.0.5
Intel 5th Gen 10nm++ Xeon (Emerald Rapids) emeraldrapids 13.0 ???

Benchmarks

Intro

Three different machines running a generic x86-64 kernel and an otherwise identical kernel running with the optimized gcc options were tested using a make based endpoint.

Conclusion

There are small but real speed increases to running with this patch as judged by a make endpoint. The increases are on par with the speed increase that the upstream sanctioned core2 option gives users, so not including additional options seems somewhat arbitrary to me.

Details

  1. Three test machines: Intel Xeon X3360, Intel i7-2620M, Intel Core i7-3660K.
  2. All ran the make benchmark (linked below) 35 times while booted into a 'generic' kernel. Then all ran the same make benchmark 35 times after booting into an optimized kernel. Below are the optimizations chosen for each machine.
    • X3360 = core2
    • i7-2620M = sandybridge
    • i7-3660K = ivybridge
  3. Results were analyzed for statistical significance via ANOVA plots that clearly show statistically significant albeit small differences.

Discussion

  1. All the assumptions for ANOVA are met:
    • Data are normally distributed as show in the normal quantile plots.
    • The population variances are fairly equal (Levene and Barlett tests).
  2. The ANOVA plots clearly show significance.
    • Pair-wise analysis by Tukey-Kramer shows significance at the 0.05 level for all CPUs compared.

Below are the differences in median values:

CPU Difference in median value
core2 +87.5 ms
sandybridge +79.7 ms
ivybridge +257.2 ms

References

Credit

Legacy support

Find support for older version of the linux kernel and of gcc in the outdated_versions directory.

Data

Sandybridge vs. Generic

2620_m

Ivybridge vs. Generic

3770_k

Core2 vs. Generic

x3360

kernel_compiler_patch's People

Contributors

adelks avatar ataraksia avatar bircoph avatar bryant1410 avatar dargor avatar dougvj avatar emcek avatar ferroin avatar graysky2 avatar montjoie avatar omkhar avatar pfactum avatar sirlucjan avatar torvic9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kernel_compiler_patch's Issues

Comparision to Core 2

You show comparisons of each optimized kernel to the generic kernel, but since the core 2 optimizations apply to all the other CPUs, shouldn't you compare them to the core2 optimized kernel instead?

"AMD Zen 3" not available in "Processor family" in kernel config (menuconfig) with gcc-10.3.0

According to https://github.com/graysky2/kernel_compiler_patch/blob/master/more-uarches-for-kernel-5.8%2B.patch#L38 and https://github.com/graysky2/kernel_compiler_patch/blob/master/more-uarches-for-kernel-5.8%2B.patch#L61, the "AMD Zen 3" option (-march=znver3) requires GCC version >=10.3. However, https://github.com/graysky2/kernel_compiler_patch/blob/master/more-uarches-for-kernel-5.8%2B.patch#L222 states "depends on ( CC_IS_GCC && GCC_VERSION > 100300 )", so the kernel cannot be compiled for Zen 3 with GCC 10.3.

Upstream?

Have these been submitted upstream? Were they rejected, if so, why?

glitches in patch process

a/ and b/ need to be removed for this to actually patch the sources.
but otherwise many thanks. linus needs this.

It wonโ€™t boot, perhaps due to an illegal instruction

Sorry for the clickbait title. Actually, it mostly boots and works perfectly fine, but AMD native optimizations (one of the last two options) donโ€™t work for me for some reason. What works perfectly fine:

  • Intel native optimizations (tried on 3 different Intel CPUs)
  • AMD -march=znver2 with Ryzen 3950X (mostly option 12)

What doesnโ€™t work (and hangs during boot without any log messages, soon after the initramdisk is loaded):

  • This CPU
    vendor_id       : AuthenticAMD
    cpu family      : 23
    model           : 113
    model name      : AMD Ryzen 9 3950X 16-Core Processor
    stepping        : 0
    microcode       : 0x8701021
    
  • AMD native / autodetected optimizations (one of the two last options)
  • kernel 5.14.6 (last one I tried, but it hung with 5.14.2 too, so it might be really code-generation-related)
  • GCC 11.1.0
  • ArchLinux with a default kernel config (with kernel_compiler_patch as the only tweak (before building linux with makepkg))
  • Full hardware configuration is listed here (in case itโ€™s relevant); UEFI has been upgraded to 3.5 since that post.

Quite unfortunately I only have that^^^ one AMD machine, i.e. not many testing options. As noted earlier, option 12 (-march=znver2) works perfectly fine; itโ€™s just the autodetection on AMD (not on Intel) that produces a bad kernel.

kernel>=5.7 and above can fail with bdver{2,3,4}, workaround is --mno-tbm

Gentoo issue: https://bugs.gentoo.org/726660

GCC issue: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671
closed as invalid due kernel's objtool issue

I use this as workaround:

--- linux-5.7.1-gentoo/arch/x86/Makefile	2020-06-14 13:35:08.438907762 +0300
+++ linux-5.7.1-gentoo-2/arch/x86/Makefile	2020-06-14 13:35:25.154871267 +0300
@@ -128,8 +128,11 @@
         cflags-$(CONFIG_MJAGUAR) += $(call cc-option,-march=btver2)
         cflags-$(CONFIG_MBULLDOZER) += $(call cc-option,-march=bdver1)
         cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-march=bdver2)
+        cflags-$(CONFIG_MPILEDRIVER) += $(call cc-option,-mno-tbm)
         cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-march=bdver3)
+        cflags-$(CONFIG_MSTEAMROLLER) += $(call cc-option,-mno-tbm)
         cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-march=bdver4)
+        cflags-$(CONFIG_MEXCAVATOR) += $(call cc-option,-mno-tbm)
         cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1)
         cflags-$(CONFIG_MZEN2) += $(call cc-option,-march=znver2)
         cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)```

error on 5.17

$ git apply --verbose --check ../kernel_compiler_patch/more-uarches-for-kernel-5.15+.patch
Checking patch arch/x86/Kconfig.cpu...
error: while searching for:

config X86_INTEL_USERCOPY
	def_bool y
	depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2

config X86_USE_PPRO_CHECKSUM
	def_bool y
	depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM

config X86_USE_3DNOW
	def_bool y

error: patch failed: arch/x86/Kconfig.cpu:336
error: arch/x86/Kconfig.cpu: patch does not apply
Checking patch arch/x86/Makefile...
Hunk #1 succeeded at 131 (offset 12 lines).
Checking patch arch/x86/include/asm/vermagic.h...

when trying to use the more-uarches-for-kernel-5.15+.patch on 5.17 it errors out because it can't find config X86_USE_3DNOW since it was removed from arch/x86/Kconfig.cpu in the following commit

CONFIG_MK8

Opteron 1-s gen. have -march=opteron option

The patch fails against Linux 4.16rc3

What the title says:

patching file arch/x86/include/asm/module.h
Hunk #1 succeeded at 25 (offset 10 lines).
Hunk #2 succeeded at 61 (offset 10 lines).
patching file arch/x86/Kconfig.cpu
Hunk #1 succeeded at 116 (offset 1 line).
Hunk #2 succeeded at 149 (offset 1 line).
Hunk #3 succeeded at 158 (offset 1 line).
Hunk #4 succeeded at 166 (offset 1 line).
Hunk #5 succeeded at 324 (offset 1 line).
Hunk #6 succeeded at 334 (offset 1 line).
Hunk #7 succeeded at 354 (offset 1 line).
Hunk #8 succeeded at 435 (offset 1 line).
Hunk #9 succeeded at 472 (offset 1 line).
Hunk #10 FAILED at 502.
1 out of 10 hunks FAILED -- saving rejects to file arch/x86/Kconfig.cpu.rej
patching file arch/x86/Makefile
Hunk #1 succeeded at 124 (offset 3 lines).
patching file arch/x86/Makefile_32.cpu
Hunk #1 succeeded at 23 (offset 1 line).
Hunk #2 succeeded at 43 (offset 1 line).

The rejected part:

--- arch/x86/Kconfig.cpu        2017-08-20 17:13:52.000000000 -0400
+++ arch/x86/Kconfig.cpu        2017-08-30 15:01:39.323841564 -0400
@@ -502,45 +663,46 @@ config X86_ALIGNMENT_16
 
 config X86_INTEL_USERCOPY
        def_bool y
-       depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2
+       depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK8SSE3 || MK7 || MEFFICEON || MCORE2 || MK10 || MBARCELONA || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MNATIVE
 
 config X86_USE_PPRO_CHECKSUM
        def_bool y
-       depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MVIAC7 || MEFFICEON || MGEODE_LX || MCORE2 || MATOM
+       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 || MATOM || MNATIVE
 
 config X86_USE_3DNOW
        def_bool y
        depends on (MCYRIXIII || MK7 || MGEODE_LX) && !UML
 
-#
-# P6_NOPs are a relatively minor optimization that require a family >=
-# 6 processor, except that it is broken on certain VIA chips.
-# Furthermore, AMD chips prefer a totally different sequence of NOPs
-# (which work on all CPUs).  In addition, it looks like Virtual PC
-# does not understand them.
-#
-# As a result, disallow these if we're not compiling for X86_64 (these
-# NOPs do work on all x86-64 capable chips); the list of processors in
-# the right-hand clause are the cores that benefit from this optimization.
-#
 config X86_P6_NOP
-       def_bool y
-       depends on X86_64
-       depends on (MCORE2 || MPENTIUM4 || MPSC)
+       default n
+       bool "Support for P6_NOPs on Intel chips"
+       depends on (MCORE2 || MPENTIUM4 || MPSC || MATOM || MNEHALEM || MWESTMERE || MSILVERMONT  || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MNATIVE)
+       ---help---
+       P6_NOPs are a relatively minor optimization that require a family >=
+       6 processor, except that it is broken on certain VIA chips.
+       Furthermore, AMD chips prefer a totally different sequence of NOPs
+       (which work on all CPUs).  In addition, it looks like Virtual PC
+       does not understand them.
+
+       As a result, disallow these if we're not compiling for X86_64 (these
+       NOPs do work on all x86-64 capable chips); the list of processors in
+       the right-hand clause are the cores that benefit from this optimization.
+
+       Say Y if you have Intel CPU newer than Pentium Pro, N otherwise.
 
 config X86_TSC
        def_bool y
-       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
+       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 || MNATIVE || MATOM) || X86_64
 
 config X86_CMPXCHG64
        def_bool y
-       depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM
+       depends on X86_PAE || X86_64 || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM || MNATIVE
 
 # this should be set for all -march=.. options where the compiler
 # generates cmov.
 config X86_CMOV
        def_bool y
-       depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MATOM || MGEODE_LX)
+       depends on (MK8 || MK8SSE3 || MK10 || MBARCELONA || MBOBCAT || MBULLDOZER || MPILEDRIVER || MSTEAMROLLER || MEXCAVATOR || MZEN || MJAGUAR || MK7 || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64 || MNATIVE || MATOM || MGEODE_LX)
 
 config X86_MINIMUM_CPU_FAMILY
        int

Various objtool warnings, then segfault (-march=piledriver)

These started with 4.14.9, but kernel have successfully built. Here are the first ones:

arch/x86/events/amd/uncore.o: warning: objtool: amd_uncore_cpu_starting()+0x9b: can't find jump dest instruction at .text+0x125
arch/x86/events/core.o: warning: objtool: x86_pmu_hw_config()+0x13: can't find jump dest instruction at .text+0x1495
kernel/fork.o: warning: objtool: account_kernel_stack()+0xd4: sibling call from callable instruction with modified stack frame
kernel/fork.o: warning: objtool: sysctl_max_threads()+0xee: stack state mismatch: cfa1=7+104 cfa2=7+96
arch/x86/entry/vdso/vma.o: warning: objtool: vgetcpu_cpu_init()+0x9e: return with modified stack frame
arch/x86/events/amd/ibs.o: warning: objtool: perf_ibs_init()+0x6a: stack state mismatch: cfa1=7+8 cfa2=7+0
...

While building kernel 4.14.14 and 4.14.15 I got with segfault (CONFIG_MPILEDRIVER=y, AMD FX-8320E):
...
mm/.tmp_memory.o: warning: objtool: print_bad_pte()+0x9c: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: wp_page_copy()+0x3a6: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: __follow_pte_pmd.isra.10()+0x296: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: _vm_normal_page()+0x2a: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: unmap_page_range()+0xf8: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: finish_mkwrite_fault()+0xc7: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: do_wp_page()+0xd2: return with modified stack frame
mm/.tmp_memory.o: warning: objtool: alloc_set_pte()+0x38e: return with modified stack frame
/bin/sh: line 1: 23359 Segfault ./tools/objtool/objtool check "mm/.tmp_memory.o"
make[1]: *** [scripts/Makefile.build:321: mm/memory.o] Error 139
make: *** [Makefile:1028: mm] Error 2

But with "Generic-x86-64" I have successfully built kernel 4.14.15.

Patch for arm and aarch64?

Looking at the patch it seems like these patches are for x86 architecture only. Any way I can use these patches for arm and aarch64 architectures for raspberry pi and android?

Piledriver and Steamroller #ELIF/#DEFINE out-of-order

The Piledriver and Steamroller #ELIF/#DEFINE statements are out of order.

If CONFIG_MPILEDRIVER is true, the patch sets up STEAMROLLER,
and visa-versa for CONFIG_MSTEAMROLLER.

+#elif defined CONFIG_MPILEDRIVER
+#define MODULE_PROC_FAMILY "STEAMROLLER "
+#elif defined CONFIG_MSTEAMROLLER
+#define MODULE_PROC_FAMILY "PILEDRIVER "

How to use

Wondering how to apply this patch.
I'm assuming you use the GNU patch program but on what file?

Feature Request - GCC v10.1 for 5.4LTS

Thank you very much for creating and maintaining these patches, they're both very useful and educational.
With the release of GCC 10.1, and its adoption by Arch Linux as the stable compiler toolchain, i'm running into a bit of a problem compiling kernels off of the 5.4 LTS branch using this patch - ld complains about multiple definitions of args -

linux-hardened-sv-1:5.4.41-1-x86_64-build.log-/bin/ld: /tmp/ccNSPeBP.o:(.bss+0x0): multiple definition of `args'; /tmp/ccSh8hwQ.o:(.bss+0x0): first defined here
linux-hardened-sv-1:5.4.41-1-x86_64-build.log-/bin/ld: /tmp/ccFBFzMS.o  CC [M]  drivers/media/rc/ir-rc6-decoder.o
linux-hardened-sv-1:5.4.41-1-x86_64-build.log-:(.bss+0x0): multiple definition of `args'; /tmp/ccSh8hwQ.o:(.bss+0x0): first defined here
linux-hardened-sv-1:5.4.41-1-x86_64-build.log-/bin/ld: /tmp/cc3OJT8O.o:(.bss+0x0): multiple definition of `args'; /tmp/ccSh8hwQ.o:(.bss+0x0): first defined here
linux-hardened-sv-1:5.4.41-1-x86_64-build.log-/bin/ld: /tmp/cc30USKT.o:(.data+0x0): multiple definition of `yylineno'; /tmp/ccFBFzMS.o:(.bss+0x10): first defined here
linux-hardened-sv-1:5.4.41-1-x86_64-build.log-/bin/ld: /tmp/cc30USKT.o:(.bss+0x30): multiple definition of `args'; /tmp/ccSh8hwQ.o:(.bss+0x0): first defined here
linux-hardened-sv-1:5.4.41-1-x86_64-build.log-/bin/ld: /tmp/ccPpyqVS.o:(.bss+0x30): multiple definition of `args'; /tmp/ccSh8hwQ.o:(.bss+0x0): first defined here
linux-hardened-sv-1:5.4.41-1-x86_64-build.log:collect2: error: ld returned 1 exit status

in both kernel flavors including the patch:

linux-grsec-sv-1:5.4.41.sv-2-x86_64-build.log-  CC [M]  drivers/net/wireless/mediatek/mt76/mt76x2/usb_mac.o
linux-grsec-sv-1:5.4.41.sv-2-x86_64-build.log-/bin/ld: /tmp/ccwZRZ6D.o:(.bss+0x0): multiple definition of `args'; /tmp/cc667b0D.o:(.bss+0x0): first defined here
linux-grsec-sv-1:5.4.41.sv-2-x86_64-build.log-/bin/ld: /tmp/cc6HslAA.o:(.bss+0x0): multiple definition of `args'; /tmp/cc667b0D.o:(.bss+0x0): first defined here
linux-grsec-sv-1:5.4.41.sv-2-x86_64-build.log-/bin/ld: /tmp/ccnSkyfB.o:(.bss+0x0): multiple definition of `args'; /tmp/cc667b0D.o:(.bss+0x0): first defined here
linux-grsec-sv-1:5.4.41.sv-2-x86_64-build.log-/bin/ld: /tmp/cc1FNXBC.o:(.data+0x0): multiple definition of `yylineno'; /tmp/cc6HslAA.o:(.bss+0x10): first defined here
linux-grsec-sv-1:5.4.41.sv-2-x86_64-build.log-/bin/ld: /tmp/cc1FNXBC.o:(.bss+0x30): multiple definition of `args'; /tmp/cc667b0D.o:(.bss+0x0): first defined here
linux-grsec-sv-1:5.4.41.sv-2-x86_64-build.log-/bin/ld: /tmp/cc4GRrHD.o:(.bss+0x30): multiple definition of `args'; /tmp/cc667b0D.o:(.bss+0x0): first defined here
<... grsec verbose logs ...>
linux-grsec-sv-1:5.4.41.sv-2-x86_64-build.log:collect2: error: ld returned 1 exit status

Is there any chance you would be able to backport the GCC10.1 patch to Linux 5.4?

Not working with Kernel 4.19

root@localhost:~/linux-4.19# patch -p1 < enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v3.15+.patch 
patching file arch/x86/include/asm/module.h
Hunk #1 succeeded at 25 (offset 10 lines).
Hunk #2 succeeded at 61 (offset 10 lines).
patching file arch/x86/Kconfig.cpu
Hunk #1 succeeded at 116 (offset 1 line).
Hunk #2 succeeded at 149 (offset 1 line).
Hunk #3 succeeded at 158 (offset 1 line).
Hunk #4 succeeded at 166 (offset 1 line).
Hunk #5 succeeded at 324 (offset 1 line).
Hunk #6 succeeded at 334 (offset 1 line).
Hunk #7 succeeded at 354 (offset 1 line).
Hunk #8 succeeded at 435 (offset 1 line).
Hunk #9 succeeded at 472 (offset 1 line).
Hunk #10 FAILED at 502.
1 out of 10 hunks FAILED -- saving rejects to file arch/x86/Kconfig.cpu.rej
patching file arch/x86/Makefile
Hunk #1 succeeded at 118 (offset 14 lines).
patching file arch/x86/Makefile_32.cpu
Hunk #1 FAILED at 23.
1 out of 2 hunks FAILED -- saving rejects to file arch/x86/Makefile_32.cpu.rej

Keep up the good work. ๐Ÿ‘

Rebase against 5.15

Testing the new 5.15 rc1 kernel... the current patch cannot apply correctly.

patching file arch/x86/Kconfig.cpu
patching file arch/x86/Makefile
Hunk #1 FAILED at 114.

Thanks in advance!

External modules fail to load when CONFIG_DEBUG_INFO_BTF and CPU optimisation is used

If noticed when using CONFIG_DEBUG_INFO_BTF and CONIG_M$CPU is used because external modules are broken because they fail to load:

[  +0,003082] BPF:[94156] TYPEDEF  
[  +0,001717] BPF:type_id=94174
[  +0,001684] BPF: 
[  +0,001662] BPF:Invalid name
[  +0,001579] BPF:
[  +0,003050] failed to validate module [vboxdrv] BTF: -22

full log:

dmesg.log

Kernel version used: 5.11.11-pf6-1
CPU optimization: Zen2

There is no difference between modules build with dkms (e.g. the one mentioned above) or modules like the nvidia driver.

Looking into DKMS they use -mtune=generic while building, I don't know if that is the issue since before using CONFIG_DEBUG_INFO_BTF that was just fine.

Kernel > 5.8

New kernels will be supported? 5.9/10/11 ?
Thanks!

Misc: tag mistake

You probably wanted to tag as 20220315 instead of 20200315 ๐Ÿ˜Ž. It affects the sorting order.

Feel free to close if insignificant.

gcc 11 and subarch selection

Building linux-ck with gcc 11 (currently in official Arch testing repo).

I have set _subarch=33 (for Intel) in PKGBUILD, however with gcc 11 we introduced more subarchs so the manual selection in PKGBUILD ends up being wrong (MSAPPHIRERAPIDS in my case).

License is missing

Not clear if it's possible to redistribute binaries based on this patchset.

CONFIG_X86_P6_NOP is unset outside MPENTIUM4 || MCORE2 || MPSC

On core2+ choices CONFIG_X86_P6_NOP= is set to N as it depends on X86_64 [=y] && (MCORE2 [=n] || MPENTIUM4 [=n] || MPSC [=n]).

Fix seems fairly straightforward unless user sets march=native option, perhaps it would be worth to modify patch and make this option user specifiable if march native is set (assuming non intel hardware or < P6).

arch/x86/Kconfig.cpu

# P6_NOPs are a relatively minor optimization that require a family >=
# 6 processor, except that it is broken on certain VIA chips.
# Furthermore, AMD chips prefer a totally different sequence of NOPs
# (which work on all CPUs).  In addition, it looks like Virtual PC
# does not understand them.
#
# As a result, disallow these if we're not compiling for X86_64 (these
# NOPs do work on all x86-64 capable chips); the list of processors in
# the right-hand clause are the cores that benefit from this optimization.
#
config X86_P6_NOP
        def_bool y
        depends on X86_64
        depends on (MCORE2 || MPENTIUM4 || MPSC)

4.13+ patch does not apply to 4.16

applying enable_additional_cpu_optimizations_for_gcc_v4.9+_kernel_v4.13+.patch to 4.16:

PATCH COMMAND:  patch -p1 -g0 -E --no-backup-if-mismatch  --dry-run -f < '/local/portage/patches/sys-kernel/gentoo-sources/gentoo-sources.patch'

================================
checking file arch/x86/include/asm/module.h
Hunk #1 succeeded at 25 (offset 10 lines).
Hunk #2 succeeded at 61 (offset 10 lines).
checking file arch/x86/Kconfig.cpu
Hunk #1 succeeded at 116 (offset 1 line).
Hunk #2 succeeded at 149 (offset 1 line).
Hunk #3 succeeded at 158 (offset 1 line).
Hunk #4 succeeded at 166 (offset 1 line).
Hunk #5 succeeded at 324 (offset 1 line).
Hunk #6 succeeded at 334 (offset 1 line).
Hunk #7 succeeded at 354 (offset 1 line).
Hunk #8 succeeded at 435 (offset 1 line).
Hunk #9 succeeded at 472 (offset 1 line).
Hunk #10 FAILED at 502.
1 out of 10 hunks FAILED
checking file arch/x86/Makefile
Hunk #1 succeeded at 124 (offset 3 lines).
checking file arch/x86/Makefile_32.cpu
Hunk #1 succeeded at 23 (offset 1 line).
Hunk #2 succeeded at 43 (offset 1 line).

patch program exited with status 1
================================

Use of GCC_VERSION in Kconfig

Instead of having different patchset depending on gcc, you could use GCC_VERSION in Kconfig.
Like depends on CC_IS_GCC && GCC_VERSION >= xxxx

patch for gcc 9.1+/linux 4.13+ fails to be applied on 5.5-rcX.

 $ [table]: tar xf ../sauces/linux-5.5-rc2.tar.gz
 $ [table]: cd linux-5.5-rc2/
 $ [linux-5.5-rc2]: patch -Np1 < ../enable_additional_cpu_optimizations_for_gccv9.1+_kernel_v4.13+.patch
patching file arch/x86/include/asm/module.h
Hunk #1 succeeded at 27 (offset 2 lines).
Hunk #2 succeeded at 75 (offset 2 lines).
patching file arch/x86/Kconfig.cpu
Hunk #1 succeeded at 123 (offset 7 lines).
Hunk #2 succeeded at 156 (offset 7 lines).
Hunk #3 succeeded at 165 (offset 7 lines).
Hunk #4 succeeded at 173 (offset 7 lines).
Hunk #5 succeeded at 338 (offset 7 lines).
Hunk #6 succeeded at 348 (offset 7 lines).
Hunk #7 succeeded at 368 (offset 7 lines).
Hunk #8 succeeded at 503 (offset 7 lines).
Hunk #9 FAILED at 533.
Hunk #10 succeeded at 558 (offset 7 lines).
Hunk #11 succeeded at 597 (offset 7 lines).
1 out of 11 hunks FAILED -- saving rejects to file arch/x86/Kconfig.cpu.rej
patching file arch/x86/Makefile
Hunk #1 succeeded at 119 (offset 1 line).
patching file arch/x86/Makefile_32.cpu
Hunk #1 succeeded at 24 (offset 1 line).
Hunk #2 succeeded at 45 (offset 1 line).

Kernel 5.15 does not boot when built with CONFIG_MPILEDRIVER=y

Kernel 5.15 (gentoo-sources) builds fine with CONFIG_MPILEDRIVER=y on my AMD FX-8370 but it won't boot. I don't even get netconsole output... Does not matter whether I build the kernel with gcc (11.2.0) or clang (12.0.1).

But I found out when I build the kernel with CONFIG_GENERIC_CPU=y or CONFIG_MBULLDOZER=y it just runs fine. Kernel 5.14.x runs ok with CONFIG_MPILEDRIVER=y.

Some data about the cpu and the system in general:

 # lscpu 
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         48 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  8
  On-line CPU(s) list:   0-7
Vendor ID:               AuthenticAMD
  Model name:            AMD FX-8370 Eight-Core Processor
    CPU family:          21
    Model:               2
    Thread(s) per core:  2
    Core(s) per socket:  4
    Socket(s):           1
    Stepping:            0
    Frequency boost:     enabled
    CPU max MHz:         4000.0000
    CPU min MHz:         1400.0000
    BogoMIPS:            8040.42
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush
                          mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc
                          rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor s
                         sse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c lahf_lm cmp_legacy svm ex
                         tapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs xop skinit wdt lw
                         p fma4 tce nodeid_msr tbm topoext perfctr_core perfctr_nb cpb hw_pstate ssbd ib
                         pb vmmcall bmi1 arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyas
                         id decodeassists pausefilter pfthreshold
Virtualization features: 
  Virtualization:        AMD-V
Caches (sum of all):     
  L1d:                   128 KiB (8 instances)
  L1i:                   256 KiB (4 instances)
  L2:                    8 MiB (4 instances)
  L3:                    8 MiB (1 instance)
Vulnerabilities:         
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl and seccomp
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; Full AMD retpoline, IBPB conditional, STIBP disabled, RSB filling
  Srbds:                 Not affected

 # lspci 
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD9x0/RX980 Host Bridge (rev 02)
00:00.2 IOMMU: Advanced Micro Devices, Inc. [AMD/ATI] RD890S/RD990 I/O Memory Management Unit (IOMMU)
00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890/RD9x0/RX980 PCI to PCI bridge (PCI Express GFX port 0)
00:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890/RD9x0/RX980 PCI to PCI bridge (PCI Express GPP Port 0)
00:06.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890/RD9x0/RX980 PCI to PCI bridge (PCI Express GPP Port 2)
00:09.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] RD890/RD9x0/RX980 PCI to PCI bridge (PCI Express GPP Port 4)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 42)
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA) (rev 40)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller (rev 40)
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge (rev 40)
00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
00:15.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0)
00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h Processor Function 5
01:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Upstream Port of PCI Express Switch (rev c5)
02:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Downstream Port of PCI Express Switch
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 14 [Radeon RX 5500/5500M / Pro 5500M] (rev c5)
03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio
04:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)
05:00.0 Non-Volatile memory controller: Shenzhen Longsys Electronics Co., Ltd. SM2263EN/SM2263XT-based OEM SSD (rev 03)
06:00.0 USB controller: ASMedia Technology Inc. ASM1143 USB 3.1 Host Controller
08:00.0 Ethernet controller: Qualcomm Atheros Killer E2400 Gigabit Ethernet Controller (rev 10)

This is Genoo downstream bugreport: https://bugs.gentoo.org/821406
Please find kernel .config and dmesg (with CONFIG_MBULLDOZER=y) in the downstream bugreport.

Rebase against 5.8

Due to minor changes [1] introduced in 5.8-rc1 the current patch cannot apply correctly.

[1] torvalds/linux@a7f7f62

Applying patch 0001-cpu-5.8-merge-graysky-s-patchset.patch...
patching file arch/x86/Kconfig.cpu
Hunk #1 FAILED at 123.
Hunk #2 succeeded at 155 with fuzz 2.
Hunk #3 succeeded at 164 with fuzz 2.
Hunk #4 FAILED at 172.
Hunk #5 succeeded at 259 with fuzz 2.
Hunk #6 FAILED at 269.
Hunk #7 FAILED at 278.
4 out of 11 hunks FAILED -- saving rejects to file arch/x86/Kconfig.cpu.rej
patching file arch/x86/Makefile
patching file arch/x86/Makefile_32.cpu
patching file arch/x86/include/asm/vermagic.h

My proposal for a solution:

https://github.com/graysky2/kernel_gcc_patch/pull/53

Atom mtune flags

Hello, just wondering why -march for atom defines -mtune for both bonnell and generic? Which is actually used?

LLVM/Clang patches ?

Hello!

First of all, thank you for these patches! I started experimenting lately with building the kernel with llvm, using linux-tkg building script. Enabling your patches don't seem to make the building fail, but would LLVM use the -march=native flag too ?

Thanks.

Adel

PinePhone CPU Allwinner A64 profile

The PinePhone is open source Linux phone with weak CPU, but i think compilation flags and profiles can push him to a little bit and make phone more usable.
I saw there are some patches for RPi4 and ARM Cortex-A72, so i wish there is a something for ARM Allwinner A64.

PinePhone
https://www.pine64.org/pinephone/

PinePhone SoC Wiki + some documentation
https://linux-sunxi.org/A64

My first thought: Allwinner A64 have very small cache memory 512KiB L2-Cache 32KiB (Instruction) / 32KiB (Data) L1-Cache per core.
Compilation with -Os (lower memory usage) can be better choice and bring a little bit more performance than -O3, because cache memory is very small. I believe you know best what is the best choice for this weak CPU.

Thank you!

Cannot apply patch to kernel 5.6.x

I have Linux 5.6.14 and GCC 10.1.0, and I'm not sure which patch I should apply.
I tried with the following ones, but they both fail (for different reasons):

  • enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v4.19-v5.4.patch
  • enable_additional_cpu_optimizations_for_gcc_v10.1+_kernel_v5.7+.patch

patch fails partially on kernel Debian 5.5.17-1kali

last kernel I've build with 5.4 worked well. This one seems to have some problems...


cat /proc/verison
Linux version 5.5.0-kali2-amd64 ([email protected]) (gcc version 9.3.0 (Debian 9.3.0-10)) #1 SMP Debian 5.5.17-1kali1 (2020-04-21)


# patch < enable_additional_cpu_optimizations_for_gcc_v9.1+_kernel_v5.5+.patch -p1
or_gcc_v9.1+_kernel_v5.5+.patch -p1
patching file arch/x86/include/asm/module.h
patching file arch/x86/Kconfig.cpu
Hunk #10 FAILED at 558.
1 out of 11 hunks FAILED -- saving rejects to file arch/x86/Kconfig.cpu.rej
patching file arch/x86/Makefile
patching file arch/x86/Makefile_32.cpu

After exiting menuconfig:

scripts/kconfig/mconf  Kconfig

WARNING: unmet direct dependencies detected for X86_P6_NOP
  Depends on [n]: X86_64 [=y] && (MCORE2 [=n] || MPENTIUM4 [=n] || MPSC [=n])
  Selected by [y]:
  - MBROADWELL [=y] && <choice>


*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

Error applying to Kernel 4.13+

Tried to patch on Kernel 4.13.2 (Arch Linux) and using the the 4.13+ gcc patch and I'm getting this error:

patch: **** Only garbage was found in the patch input.
==> ERROR: A failure occurred in prepare().

EDIT: Ops, my mistake: the .patch file was downloaded not right resulting in bad contents.

What the proper way of getting the patch (source in PKGBUILD)?

Dead images in readme

It seems the images embedded in the readme under the "Data" section are no longer valid.

does not apply to kernel 4.4?

Looks like this suddenly does not apply to kernel 4.4 (worked fine up to 4.3):

checking file arch/x86/include/asm/module.h
Hunk %1 FAILED at 15.
Hunk %2 FAILED at 33.
2 out of 2 hunks FAILED
checking file arch/x86/Kconfig.cpu
Hunk %1 succeeded at 147 (offset 10 lines).
Hunk %2 succeeded at 156 (offset 10 lines).
Hunk %3 FAILED at 154.
Hunk %4 succeeded at 310 (offset 60 lines).
Hunk %5 FAILED at 268.
Hunk %6 succeeded at 393 (offset 109 lines).
Hunk %7 FAILED at 321.
Hunk %8 FAILED at 352.
Hunk %9 FAILED at 380.
5 out of 9 hunks FAILED
checking file arch/x86/Makefile
Hunk %1 FAILED at 94.
1 out of 1 hunk FAILED
checking file arch/x86/Makefile_32.cpu
Hunk %1 FAILED at 23.
Hunk %2 FAILED at 32.
2 out of 2 hunks FAILED

after patch and use cannonlake i got error

0 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2
cc1: error: bad value (โ€˜cannonlakeโ€™) for โ€˜-march=โ€™ switch
cc1: note: valid arguments to โ€˜-march=โ€™ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2
mv: cannot stat '/home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/.builtin-check.o.tmp': No such file or directory
make[4]: *** [/home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/build/Makefile.build:97: /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/builtin-check.o] Error 1
make[4]: *** Waiting for unfinished jobs....
mv: cannot stat '/home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/.builtin-orc.o.tmp': No such file or directory
make[4]: *** [/home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/build/Makefile.build:97: /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/builtin-orc.o] Error 1
CC /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/exec-cmd.o
CC /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/arch/x86/decode.o
CC /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/help.o
CC /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/pager.o
cc1: error: bad value (โ€˜cannonlakeโ€™) for โ€˜-march=โ€™ switch
cc1: note: valid arguments to โ€˜-march=โ€™ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 bonnell atom silvermont slm knl x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2
mv: cannot stat '/home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/arch/x86/.decode.o.tmp': No such file or directory
make[5]: *** [/home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/build/Makefile.build:97: /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/arch/x86/decode.o] Error 1
make[4]: *** [/home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/build/Makefile.build:139: arch/x86] Error 2
make[3]: *** [Makefile:46: /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/objtool-in.o] Error 2
make[3]: *** Waiting for unfinished jobs....
CC /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/parse-options.o
CC /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/run-command.o
CC /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/sigchain.o
CC /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/subcmd-config.o
LD /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/libsubcmd-in.o
AR /home/piotr/LibreELEC.tv_Coffe/build.LibreELEC-Generic.x86_64-9.0-devel/linux-c0a490c/tools/objtool/libsubcmd.a
make[2]: *** [Makefile:63: objtool] Error 2
make[1]: *** [Makefile:1696: tools/objtool] Error 2
make[1]: *** Waiting for unfinished jobs....

kernel 4.17rc6

format of git patch

Hi,

Did you ever consider providing patches available in this repository as patches one could git am rather than git apply ? Relying on git am would allow to inject the patch more easily as part of a git patch management such as the one used by greg and other stable kernel patch queues, but also to keep git author and commit date.

This would imply on your end to create a proper git commit and create the patch using git format-patch which should not be too far from your current process.

Thanks,

Corrupted vanilla 4.6.0 kernel with CONFIG_MNATIVE and gcc-5.3.0

Hello,

I stumbled upon serious issue with vanilla 4.6.0 kernel and CONFIG_MNATIVE: I got random userspace application segfaults: under high CPU/memory pressure any app may segfault at seemingly random stack point (firefox, screen, emerge, gcc, whatever). Gcc version is 5.3.0, hardware is x86 Atom N270 (eeepc 1000H). Vanilla kernel on the same setup (hardware, compiler, kernel config all the same, but CPU optimization set to CONFIG_MATOM) works perfectly fine, physical memory is fine too (multiple rounds of memtest86+ are OK).

I have some plans to test this issue further (try different compiler, e.g. 4.9.3) and try CONFIG_MATOM using your patch. For now I don't know where the problem comes from: this can be gcc bug, kernel bug or patch bug. But problem is very serious โ€“ compiled kernel is (almost) unusable and bug is hard to trace (I spent several days for testing, because I suspected other kernel or system changes responsible for this issue). Kernel config is here: https://bpaste.net/show/4d35b6b07786

P.S. I use CONFIG_MNATIVE widely on another systems, but all of them have older kernels, built with older compilers.

Fail seeing level your hardware supports

The patch said:
To see which level your hardware supports run:
/lib/ld-linux-x86-64.so.2 --help | grep supported

but if I run this I got:
/lib64/ld-linux-x86-64.so.2 --help
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
[...more help...]

Tested this on a gentoo, ubuntu and a debian

Intel Kaby Lake (7th Gen)?

Which march param should I use?

My CPU:

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  2
Core(s) per socket:  2
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               142
Model name:          Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Stepping:            9
CPU MHz:             800.011
CPU max MHz:         3500.0000
CPU min MHz:         400.0000
BogoMIPS:            5810.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            4096K
NUMA node0 CPU(s):   0-3
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp

mcpu-for-cortex

Hi,

do you think it is possible to patch rpi3 as well?

using:

-mcpu=cortex-a52

?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.