Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933965AbcLSRJx (ORCPT ); Mon, 19 Dec 2016 12:09:53 -0500 Received: from mail-ua0-f174.google.com ([209.85.217.174]:35570 "EHLO mail-ua0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933265AbcLSRJw (ORCPT ); Mon, 19 Dec 2016 12:09:52 -0500 MIME-Version: 1.0 From: Gustavo da Silva Date: Mon, 19 Dec 2016 15:09:50 -0200 Message-ID: Subject: [RFC] arch/x86/Kconfig.cpu: Update with new gcc disponible 64bits CPU uarchs. To: linux-kernel@vger.kernel.org Cc: x86@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5124 Lines: 166 Good afternon! Are there reasons to 'Kconfig.cpu' and 'Makefile' not contains the 'gcc -mtune=???' recent options? Well, bellow I send some diffs (untested) just for clarifications. Best regards, Gustavo da Silva. ==================== --- old/arch/x86/Kconfig.cpu +++ new/arch/x86/Kconfig.cpu @@ -45,6 +45,14 @@ - "Core 2/newer Xeon" for all core2 and newer Intel CPUs. - "Intel Atom" for the Atom-microarchitecture CPUs. - "Generic-x86-64" for a kernel which runs on any x86-64 CPU. + - "Intel Nehalem" for the Nehalem-microarchitecture CPUs. + - "Intel Westmere" for the Westmere-microarchitecture CPUs. + - "Intel Sandy Bridge" for the Sandy Bridge-microarchitecture CPUs. + - "Intel Ivy Bridge" for the Ivy Bridge-microarchitecture CPUs. + - "Intel Haswell" for the Haswell-microarchitecture CPUs. + - "Intel Broadwell" for the Broadwell-microarchitecture CPUs. + - "Intel Skylake" for the Skylake-microarchitecture CPUs. + - "Intel Knight's Landing" for the Knight's Landing-microarchitecture CPUs. See each option's help text for additional details. If you don't know what to do, choose "486". @@ -279,6 +287,62 @@ accordingly optimized code. Use a recent GCC with specific Atom support in order to fully benefit from selecting this option. +config MNEHALEM + bool "Intel Nehalem" + depends on X86_64 + ---help--- + + Select this for Intel Nehalem-microarchitecture based CPUs. + +config MWESTMERE + bool "Intel Westmere" + depends on X86_64 + ---help--- + + Select this for Intel Westmere-microarchitecture based CPUs. + +config MSANDYBRIDGE + bool "Intel Sandy Bridge" + depends on X86_64 + ---help--- + + Select this for Intel Sandy Bridge-microarchitecture based CPUs. + +config MIVYBRIDGE + bool "Intel Ivy Bridge" + depends on X86_64 + ---help--- + + Select this for Intel Ivy Bridge-microarchitecture based CPUs. + +config MHASWELL + bool "Intel Haswell" + depends on X86_64 + ---help--- + + Select this for Intel Haswell-microarchitecture based CPUs. + +config MBROADWELL + bool "Intel Broadwell" + depends on X86_64 + ---help--- + + Select this for Intel Broadwell-microarchitecture based CPUs. + +config MSKYLAKE + bool "Intel Skylake" + depends on X86_64 + ---help--- + + Select this for Intel Skylake-microarchitecture based CPUs. + +config MKNL + bool "Intel Knight's Landing" + depends on X86_64 + ---help--- + + Select this for Intel Knight's Landing-microarchitecture based CPUs. + config GENERIC_CPU bool "Generic-x86-64" depends on X86_64 ==================== --- old/arch/x86/Makefile +++ new/arch/x86/Makefile @@ -103,15 +103,8 @@ # 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) += $(call cc-option,-march=k8) - cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona) - - cflags-$(CONFIG_MCORE2) += \ - $(call cc-option,-march=core2,$(call cc-option,-mtune=generic)) - cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \ - $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic)) - cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic) + # CPU-specific tuning. Anything which can be shared with UML should go here. + include arch/x86/Makefile_64.cpu KBUILD_CFLAGS += $(cflags-y) KBUILD_CFLAGS += -mno-red-zone ==================== NEW FILE: new/arch/x86/Makefile_64.cpu # CPU tuning section - shared with UML. # Must change only cflags-y (or [yn]), not CFLAGS! That makes a difference for UML. #-mtune exists since gcc 3.4 HAS_MTUNE := $(call cc-option-yn, -mtune=i386) ifeq ($(HAS_MTUNE),y) tune = $(call cc-option,-mtune=$(1),$(2)) else tune = $(call cc-option,-mcpu=$(1),$(2)) endif align := $(cc-option-align) cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona) cflags-$(CONFIG_MCORE2) += $(call cc-option,-march=core2,$(call cc-option,-mtune=generic)) cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \ $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic)) cflags-$(CONFIG_MNEHALEM) += $(call cc-option,-march=nehalem,$(call cc-option,-mtune=nehalem)) cflags-$(CONFIG_MWESTMERE) += $(call cc-option,-march=westmere,$(call cc-option,-mtune=westmere)) cflags-$(CONFIG_MSANDYBRIDGE) += $(call cc-option,-march=sandybridge,$(call cc-option,-mtune=sandybridge)) cflags-$(CONFIG_MIVYBRIDGE) += $(call cc-option,-march=ivybridge,$(call cc-option,-mtune=ivybridge)) cflags-$(CONFIG_MHASWELL) += $(call cc-option,-march=haswell,$(call cc-option,-mtune=haswell)) cflags-$(CONFIG_MBROADWELL) += $(call cc-option,-march=broadwell,$(call cc-option,-mtune=broadwell)) cflags-$(CONFIG_MSKYLAKE) += $(call cc-option,-march=skylake,$(call cc-option,-mtune=skylake)) cflags-$(CONFIG_MKNL) += $(call cc-option,-march=knl,$(call cc-option,-mtune=knl)) cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic) -- Atenciosamente, Gustavo da Silva gustavodasilva@gmail.com