2022-08-17 09:25:01

by Tor Vic

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Tor Vic <[email protected]>
---
arch/x86/Makefile | 8 ++------
arch/x86/Makefile.cpu | 8 ++++++++
2 files changed, 10 insertions(+), 6 deletions(-)
create mode 100644 arch/x86/Makefile.cpu

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 7854685c5f25..c0b4db692544 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -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
diff --git a/arch/x86/Makefile.cpu b/arch/x86/Makefile.cpu
new file mode 100644
index 000000000000..6995353f87e8
--- /dev/null
+++ b/arch/x86/Makefile.cpu
@@ -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
--
2.37.2