Skip to contentSkip to conversation

arch/x86: Makefile: Move CPU-specific tuning for x86_64 to Makefile.cpu

PATCH New [email protected] 1 participant 1 message Aug 17, 2022 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/x86: Makefile: Move CPU-specific tuning for x86_64 to Makefile.cpu

The Makefile has a 'FIXME', according to which the CPU-specific tuning options for 64-bit CPUs should be integrated into a separate file.

Move these cflags to a new file named Makefile.cpu in the same way as for the 32-bit cflags.

There should be no functional change.

---
 arch/x86/Makefile     | 8 ++------
 arch/x86/Makefile.cpu | 8 ++++++++
 2 files changed, 10 insertions(+), 6 deletions(-)
 create mode 100644 arch/x86/Makefile.cpu
arch/x86/Makefile +2 -6
index 7854685c5f25..c0b4db692544 100644
@@ -147,12 +147,8 @@ else
 	# Use -mskip-rax-setup if supported.
 	KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup)
 
-        # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu)
-        cflags-$(CONFIG_MK8)		+= -march=k8
-        cflags-$(CONFIG_MPSC)		+= -march=nocona
-        cflags-$(CONFIG_MCORE2)		+= -march=core2
-        cflags-$(CONFIG_MATOM)		+= -march=atom
-        cflags-$(CONFIG_GENERIC_CPU)	+= -mtune=generic
+        # CPU-specific tuning for x86_64
+        include $(srctree)/arch/x86/Makefile.cpu
         KBUILD_CFLAGS += $(cflags-y)
 
         KBUILD_CFLAGS += -mno-red-zone
arch/x86/Makefile.cpu new file +8 -0
new file mode 100644
index 000000000000..6995353f87e8
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0
+# CPU tuning section for x86_64
+
+cflags-$(CONFIG_MK8)		+= -march=k8
+cflags-$(CONFIG_MPSC)		+= -march=nocona
+cflags-$(CONFIG_MCORE2)		+= -march=core2
+cflags-$(CONFIG_MATOM)		+= -march=atom
+cflags-$(CONFIG_GENERIC_CPU)	+= -mtune=generic
Signature · 1 line
2.37.2