From 55596689ba34594e066798c3c69620ba07998bad Mon Sep 17 00:00:00 2001 From: WangYuli Date: Mon, 16 Sep 2024 17:48:31 +0800 Subject: [PATCH] deepin: x86: kernel_compiler_patch: Update graysky2/kernel_compiler_patch to tag20240915 Changelog: *rebase lite patch into existing patches obfuscate email Link: https://github.com/graysky2/kernel_compiler_patch/blob/master/more-uarches-for-kernel-6.8-rc4%2B.patch Signed-off-by: graysky Signed-off-by: WangYuli --- arch/x86/Kconfig.cpu | 67 +++++++++++++++++++++++++++++++------------- arch/x86/Makefile | 9 ++++-- 2 files changed, 53 insertions(+), 23 deletions(-) diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu index 59d007c3560e5..1340bc4d577ba 100644 --- a/arch/x86/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu @@ -155,7 +155,6 @@ config MPENTIUM4 -Paxville -Dempsey - config MK6 bool "AMD K6/K6-II/K6-III" depends on X86_32 @@ -604,29 +603,53 @@ config GENERIC_CPU Generic x86-64 CPU. Run equally well on all x86-64 CPUs. -config GENERIC_CPU2 - bool "Generic-x86-64-v2" +config MAMD_CPU_V2 + bool "AMD x86-64-v2" depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) depends on X86_64 help - Generic x86-64 CPU. - Run equally well on all x86-64 CPUs with min support of x86-64-v2. + AMD x86-64 CPU with v2 instructions. + Run equally well on all AMD x86-64 CPUs with min support of -march=x86-64-v2. + +config MAMD_CPU_V3 + bool "AMD x86-64-v3" + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) + depends on X86_64 + help + AMD x86-64-v3 CPU with v3 instructions. + Run equally well on all AMD x86-64 CPUs with min support of -march=x86-64-v3. + +config MAMD_CPU_V4 + bool "AMD x86-64-v4" + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) + depends on X86_64 + help + AMD x86-64 CPU with v4 instructions. + Run equally well on all AMD x86-64 CPUs with min support of -march=x86-64-v4. + +config MINTEL_CPU_V2 + bool "Intel x86-64-v2" + depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) + depends on X86_64 + help + Intel x86-64 CPU with v2 instructions. + Run equally well on all Intel x86-64 CPUs with min support of -march=x86-64-v2. -config GENERIC_CPU3 - bool "Generic-x86-64-v3" +config MINTEL_CPU_V3 + bool "Intel x86-64-v3" depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) depends on X86_64 help - Generic x86-64-v3 CPU with v3 instructions. - Run equally well on all x86-64 CPUs with min support of x86-64-v3. + Intel x86-64 CPU with v3 instructions. + Run equally well on all Intel x86-64 CPUs with min support of -march=x86-64-v3. -config GENERIC_CPU4 - bool "Generic-x86-64-v4" +config MINTEL_CPU_V4 + bool "Intel x86-64-v4" depends on (CC_IS_GCC && GCC_VERSION > 110000) || (CC_IS_CLANG && CLANG_VERSION >= 120000) depends on X86_64 help - Generic x86-64 CPU with v4 instructions. - Run equally well on all x86-64 CPUs with min support of x86-64-v4. + Intel x86-64 CPU with v4 instructions. + Run equally well on all Intel x86-64 CPUs with min support of -march=x86-64-v4. config MNATIVE_INTEL bool "Intel-Native optimizations autodetected by the compiler" @@ -678,8 +701,8 @@ config X86_L1_CACHE_SHIFT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL \ || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE \ || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE \ - || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD || X86_GENERIC || GENERIC_CPU || GENERIC_CPU2 \ - || GENERIC_CPU3 || GENERIC_CPU4 + || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD || X86_GENERIC || GENERIC_CPU || MAMD_CPU_V2 || MAMD_CPU_V3 \ + || MAMD_CPU_V4 || MINTEL_CPU_V2 || MINTEL_CPU_V3 || MINTEL_CPU_V4 default "4" if MELAN || M486SX || M486 || MGEODEGX1 default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII \ || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX @@ -703,7 +726,8 @@ config X86_INTEL_USERCOPY || MK8 || MK7 || MEFFICEON || MCORE2 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT \ || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX \ || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS \ - || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL + || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL \ + || MINTEL_CPU_V2 || MINTEL_CPU_V3 || MINTEL_CPU_V4 config X86_USE_PPRO_CHECKSUM def_bool y @@ -714,7 +738,8 @@ config X86_USE_PPRO_CHECKSUM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE \ || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE \ || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE \ - || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD + || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD \ + || MAMD_CPU_V2 || MAMD_CPU_V3 || MAMD_CPU_V4 || MINTEL_CPU_V2 || MINTEL_CPU_V3 || MINTEL_CPU_V4 # # P6_NOPs are a relatively minor optimization that require a family >= @@ -734,7 +759,7 @@ config X86_P6_NOP || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE \ || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE \ || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS \ - || MNATIVE_INTEL) + || MNATIVE_INTEL || MINTEL_CPU_V2 || MINTEL_CPU_V3 || MINTEL_CPU_V4) config X86_TSC def_bool y @@ -755,7 +780,8 @@ config X86_CMPXCHG64 || MZEN2 || MZEN3 || MZEN4 || MZEN5 || MNEHALEM || MWESTMERE || MSILVERMONT || MGOLDMONT || MGOLDMONTPLUS \ || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL || MSKYLAKE || MSKYLAKEX || MCANNONLAKE \ || MICELAKE || MCASCADELAKE || MCOOPERLAKE || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE \ - || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD + || MALDERLAKE || MRAPTORLAKE || MMETEORLAKE || MEMERALDRAPIDS || MNATIVE_INTEL || MNATIVE_AMD \ + || MAMD_CPU_V2 || MAMD_CPU_V3 || MAMD_CPU_V4 || MINTEL_CPU_V2 || MINTEL_CPU_V3 || MINTEL_CPU_V4 # this should be set for all -march=.. options where the compiler # generates cmov. @@ -779,7 +805,8 @@ config X86_MINIMUM_CPU_FAMILY || MGOLDMONT || MGOLDMONTPLUS || MSANDYBRIDGE || MIVYBRIDGE || MHASWELL || MBROADWELL \ || MSKYLAKE || MSKYLAKEX || MCANNONLAKE || MICELAKE || MCASCADELAKE || MCOOPERLAKE \ || MTIGERLAKE || MSAPPHIRERAPIDS || MROCKETLAKE || MALDERLAKE || MRAPTORLAKE || MRAPTORLAKE \ - || MNATIVE_INTEL || MNATIVE_AMD) + || MNATIVE_INTEL || MNATIVE_AMD || MAMD_CPU_V2 || MAMD_CPU_V3 || MAMD_CPU_V4 || MINTEL_CPU_V2 \ + || MINTEL_CPU_V3 || MINTEL_CPU_V4) default "5" if X86_32 && X86_CMPXCHG64 default "4" diff --git a/arch/x86/Makefile b/arch/x86/Makefile index eeb46ba2a1c67..d7b3b698eccc8 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -191,10 +191,13 @@ else cflags-$(CONFIG_MRAPTORLAKE) += -march=raptorlake cflags-$(CONFIG_MMETEORLAKE) += -march=meteorlake cflags-$(CONFIG_MEMERALDRAPIDS) += -march=emeraldrapids - cflags-$(CONFIG_GENERIC_CPU2) += -march=x86-64-v2 - cflags-$(CONFIG_GENERIC_CPU3) += -march=x86-64-v3 - cflags-$(CONFIG_GENERIC_CPU4) += -march=x86-64-v4 cflags-$(CONFIG_GENERIC_CPU) += -mtune=generic + cflags-$(CONFIG_MAMD_CPU_V2) += -march=x86-64-v2 + cflags-$(CONFIG_MAMD_CPU_V3) += -march=x86-64-v3 + cflags-$(CONFIG_MAMD_CPU_V4) += -march=x86-64-v4 + cflags-$(CONFIG_MINTEL_CPU_V2) += -march=x86-64-v2 + cflags-$(CONFIG_MINTEL_CPU_V3) += -march=x86-64-v3 + cflags-$(CONFIG_MINTEL_CPU_V4) += -march=x86-64-v4 KBUILD_CFLAGS += $(cflags-y) rustflags-$(CONFIG_MK8) += -Ctarget-cpu=k8