[PATCH] x86-64: Add option to compile for Core2

Add an option to compile for Intel's Core 2

The Kconfig help is a mouthful due to the inventiveness of Intel's
product naming department.

Mainly for the 64bit cache line sizes because gcc doesn't support
optimizing for core2 yet. However it will and then the kernel
should be ready by passing the right option

Also fix the old MPSC help text to confirm better to reality.

Signed-off-by: Andi Kleen <ak@suse.de>
This commit is contained in:
Andi Kleen 2006-12-07 02:14:09 +01:00 committed by Andi Kleen
parent 8542b200cb
commit 713819989a
2 changed files with 25 additions and 6 deletions

View File

@ -122,7 +122,7 @@ endchoice
choice choice
prompt "Processor family" prompt "Processor family"
default MK8 default GENERIC_CPU
config MK8 config MK8
bool "AMD-Opteron/Athlon64" bool "AMD-Opteron/Athlon64"
@ -130,16 +130,31 @@ config MK8
Optimize for AMD Opteron/Athlon64/Hammer/K8 CPUs. Optimize for AMD Opteron/Athlon64/Hammer/K8 CPUs.
config MPSC config MPSC
bool "Intel EM64T" bool "Intel P4 / older Netburst based Xeon"
help help
Optimize for Intel Pentium 4 and Xeon CPUs with Intel Optimize for Intel Pentium 4 and older Nocona/Dempsey Xeon CPUs
Extended Memory 64 Technology(EM64T). For details see with Intel Extended Memory 64 Technology(EM64T). For details see
<http://www.intel.com/technology/64bitextensions/>. <http://www.intel.com/technology/64bitextensions/>.
Note the the latest Xeons (Xeon 51xx and 53xx) are not based on the
Netburst core and shouldn't use this option. You can distingush them
using the cpu family field
in /proc/cpuinfo. Family 15 is a older Xeon, Family 6 a newer one
(this rule only applies to system that support EM64T)
config MCORE2
bool "Intel Core2 / newer Xeon"
help
Optimize for Intel Core2 and newer Xeons (51xx)
You can distingush the newer Xeons from the older ones using
the cpu family field in /proc/cpuinfo. 15 is a older Xeon
(use CONFIG_MPSC then), 6 is a newer one. This rule only
applies to CPUs that support EM64T.
config GENERIC_CPU config GENERIC_CPU
bool "Generic-x86-64" bool "Generic-x86-64"
help help
Generic x86-64 CPU. Generic x86-64 CPU.
Run equally well on all x86-64 CPUs.
endchoice endchoice
@ -149,12 +164,12 @@ endchoice
config X86_L1_CACHE_BYTES config X86_L1_CACHE_BYTES
int int
default "128" if GENERIC_CPU || MPSC default "128" if GENERIC_CPU || MPSC
default "64" if MK8 default "64" if MK8 || MCORE2
config X86_L1_CACHE_SHIFT config X86_L1_CACHE_SHIFT
int int
default "7" if GENERIC_CPU || MPSC default "7" if GENERIC_CPU || MPSC
default "6" if MK8 default "6" if MK8 || MCORE2
config X86_INTERNODE_CACHE_BYTES config X86_INTERNODE_CACHE_BYTES
int int

View File

@ -30,6 +30,10 @@ cflags-y :=
cflags-kernel-y := cflags-kernel-y :=
cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8)
cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona) cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona)
# gcc doesn't support -march=core2 yet as of gcc 4.3, but I hope it
# will eventually. Use -mtune=generic as fallback
cflags-$(CONFIG_MCORE2) += \
$(call cc-option,-march=core2,$(call cc-option,-mtune=generic))
cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic) cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic)
cflags-y += -m64 cflags-y += -m64