From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9A9211382C5 for ; Mon, 29 Jun 2020 17:32:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C2038E08F0; Mon, 29 Jun 2020 17:32:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 90D60E08F0 for ; Mon, 29 Jun 2020 17:32:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 18D6734ED5E for ; Mon, 29 Jun 2020 17:32:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 96E7221D for ; Mon, 29 Jun 2020 17:32:23 +0000 (UTC) From: "Mike Pagano" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Pagano" Message-ID: <1593451914.d4662d3ac3d6470f051a0923b24deeced928878a.mpagano@gentoo> Subject: [gentoo-commits] proj/linux-patches:5.7 commit in: / X-VCS-Repository: proj/linux-patches X-VCS-Files: 5012_enable-cpu-optimizations-for-gcc91.patch X-VCS-Directories: / X-VCS-Committer: mpagano X-VCS-Committer-Name: Mike Pagano X-VCS-Revision: d4662d3ac3d6470f051a0923b24deeced928878a X-VCS-Branch: 5.7 Date: Mon, 29 Jun 2020 17:32:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: cf674ed0-b983-462d-a584-23017f7a339b X-Archives-Hash: d1900ac580a7ce2cd8e2a4ff594d8a7d commit: d4662d3ac3d6470f051a0923b24deeced928878a Author: Mike Pagano gentoo org> AuthorDate: Mon Jun 29 17:31:54 2020 +0000 Commit: Mike Pagano gentoo org> CommitDate: Mon Jun 29 17:31:54 2020 +0000 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=d4662d3a Update CPU optimization patch for gcc 9.1+ Signed-off-by: Mike Pagano gentoo.org> 5012_enable-cpu-optimizations-for-gcc91.patch | 51 ++++++++++++++++----------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/5012_enable-cpu-optimizations-for-gcc91.patch b/5012_enable-cpu-optimizations-for-gcc91.patch index 049ec12..2f16153 100644 --- a/5012_enable-cpu-optimizations-for-gcc91.patch +++ b/5012_enable-cpu-optimizations-for-gcc91.patch @@ -42,14 +42,18 @@ It also offers to compile passing the 'native' option which, "selects the CPU to generate code for at compilation time by determining the processor type of the compiling machine. Using -march=native enables all instruction subsets supported by the local machine and will produce code optimized for the local -machine under the constraints of the selected instruction set."[3] +machine under the constraints of the selected instruction set."[2] + +Do NOT try using the 'native' option on AMD Piledriver, Steamroller, or +Excavator CPUs (-march=bdver{2,3,4} flag). The build will error out due the +kernel's objtool issue with these.[3a,b] MINOR NOTES This patch also changes 'atom' to 'bonnell' in accordance with the gcc v4.9 changes. Note that upstream is using the deprecated 'match=atom' flags when I -believe it should use the newer 'march=bonnell' flag for atom processors.[2] +believe it should use the newer 'march=bonnell' flag for atom processors.[4] -It is not recommended to compile on Atom-CPUs with the 'native' option.[4] The +It is not recommended to compile on Atom-CPUs with the 'native' option.[5] The recommendation is to use the 'atom' option instead. BENEFITS @@ -61,21 +65,23 @@ https://github.com/graysky2/kernel_gcc_patch REQUIREMENTS linux version >=5.7 -gcc version >=9.1 +gcc version >=9.1 and <10 ACKNOWLEDGMENTS -This patch builds on the seminal work by Jeroen.[5] +This patch builds on the seminal work by Jeroen.[6] REFERENCES -1. https://gcc.gnu.org/gcc-4.9/changes.html -2. https://bugzilla.kernel.org/show_bug.cgi?id=77461 -3. https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html -4. https://github.com/graysky2/kernel_gcc_patch/issues/15 -5. http://www.linuxforge.net/docs/linux/linux-gcc.php +1. https://gcc.gnu.org/gcc-4.9/changes.html +2. https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html +3a. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95671#c11 +3b. https://github.com/graysky2/kernel_gcc_patch/issues/55 +4. https://bugzilla.kernel.org/show_bug.cgi?id=77461 +5. https://github.com/graysky2/kernel_gcc_patch/issues/15 +6. http://www.linuxforge.net/docs/linux/linux-gcc.php ---- a/arch/x86/include/asm/vermagic.h 2019-12-15 18:16:08.000000000 -0500 -+++ b/arch/x86/include/asm/vermagic.h 2019-12-17 14:03:55.968871551 -0500 -@@ -27,6 +27,36 @@ struct mod_arch_specific { +--- a/arch/x86/include/asm/vermagic.h 2020-06-10 14:21:45.000000000 -0400 ++++ b/arch/x86/include/asm/vermagic.h 2020-06-15 10:44:10.437477053 -0400 +@@ -17,6 +17,36 @@ #define MODULE_PROC_FAMILY "586MMX " #elif defined CONFIG_MCORE2 #define MODULE_PROC_FAMILY "CORE2 " @@ -112,7 +118,7 @@ REFERENCES #elif defined CONFIG_MATOM #define MODULE_PROC_FAMILY "ATOM " #elif defined CONFIG_M686 -@@ -45,6 +75,28 @@ struct mod_arch_specific { +@@ -35,6 +65,28 @@ #define MODULE_PROC_FAMILY "K7 " #elif defined CONFIG_MK8 #define MODULE_PROC_FAMILY "K8 " @@ -141,8 +147,8 @@ REFERENCES #elif defined CONFIG_MELAN #define MODULE_PROC_FAMILY "ELAN " #elif defined CONFIG_MCRUSOE ---- a/arch/x86/Kconfig.cpu 2019-12-15 18:16:08.000000000 -0500 -+++ b/arch/x86/Kconfig.cpu 2019-12-17 14:09:03.805642284 -0500 +--- a/arch/x86/Kconfig.cpu 2020-06-10 14:21:45.000000000 -0400 ++++ b/arch/x86/Kconfig.cpu 2020-06-15 10:44:10.437477053 -0400 @@ -123,6 +123,7 @@ config MPENTIUMM config MPENTIUM4 bool "Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon" @@ -524,9 +530,9 @@ REFERENCES config X86_MINIMUM_CPU_FAMILY int ---- a/arch/x86/Makefile 2019-12-15 18:16:08.000000000 -0500 -+++ b/arch/x86/Makefile 2019-12-17 14:03:55.972204960 -0500 -@@ -119,13 +119,53 @@ else +--- a/arch/x86/Makefile 2020-06-10 14:21:45.000000000 -0400 ++++ b/arch/x86/Makefile 2020-06-15 10:44:35.608035680 -0400 +@@ -119,13 +119,56 @@ else KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup) # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu) @@ -539,8 +545,11 @@ REFERENCES + 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) @@ -583,8 +592,8 @@ REFERENCES cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic) KBUILD_CFLAGS += $(cflags-y) ---- a/arch/x86/Makefile_32.cpu 2019-12-15 18:16:08.000000000 -0500 -+++ b/arch/x86/Makefile_32.cpu 2019-12-17 14:03:55.972204960 -0500 +--- a/arch/x86/Makefile_32.cpu 2020-06-10 14:21:45.000000000 -0400 ++++ b/arch/x86/Makefile_32.cpu 2020-06-15 10:44:10.437477053 -0400 @@ -24,7 +24,19 @@ cflags-$(CONFIG_MK6) += -march=k6 # Please note, that patches that add -march=athlon-xp and friends are pointless. # They make zero difference whatsosever to performance at this time.