From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755947AbbLAQYw (ORCPT ); Tue, 1 Dec 2015 11:24:52 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:33729 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755253AbbLAQYu (ORCPT ); Tue, 1 Dec 2015 11:24:50 -0500 X-Originating-IP: 50.39.163.18 Date: Tue, 1 Dec 2015 08:24:45 -0800 From: Josh Triplett To: Borislav Petkov Cc: X86 ML , LKML Subject: Re: [PATCH 4/4] x86/cpu: Provide a config option to disable static_cpu_has Message-ID: <20151201162444.GC26089@x> References: <1448982023-19187-1-git-send-email-bp@alien8.de> <1448982023-19187-5-git-send-email-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1448982023-19187-5-git-send-email-bp@alien8.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 01, 2015 at 04:00:23PM +0100, Borislav Petkov wrote: > From: Borislav Petkov > > This brings .text savings of about ~1.6K when building a tinyconfig. It > is off by default so nothing changes for the default. > > Kconfig help text from Josh. > > Signed-off-by: Borislav Petkov > Cc: Josh Triplett Assuming this passes the kernel build robot, then: Reviewed-by: Josh Triplett > arch/x86/Kconfig | 11 +++++++++++ > arch/x86/include/asm/cpufeature.h | 2 +- > 2 files changed, 12 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index db3622f22b61..a2abc2fb6970 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -349,6 +349,17 @@ config X86_FEATURE_NAMES > > If in doubt, say Y. > > +config X86_FAST_FEATURE_TESTS > + bool "Fast CPU feature tests" if EMBEDDED > + default y > + ---help--- > + Some fast-paths in the kernel depend on the capabilities of the CPU. > + Say Y here for the kernel to patch in the appropriate code at runtime > + based on the capabilities of the CPU. The infrastructure for patching > + code at runtime takes up some additional space; space-constrained > + embedded systems may wish to say N here to produce smaller, slightly > + slower code. > + > config X86_X2APIC > bool "Support x2apic" > depends on X86_LOCAL_APIC && X86_64 && (IRQ_REMAP || HYPERVISOR_GUEST) > diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h > index 144b042c0872..43e144474043 100644 > --- a/arch/x86/include/asm/cpufeature.h > +++ b/arch/x86/include/asm/cpufeature.h > @@ -409,7 +409,7 @@ extern const char * const x86_bug_flags[NBUGINTS*32]; > * fast paths and boot_cpu_has() otherwise! > */ > > -#if __GNUC__ >= 4 > +#if __GNUC__ >= 4 && defined(CONFIG_X86_FAST_FEATURE_TESTS) > extern void warn_pre_alternatives(void); > extern bool __static_cpu_has_safe(u16 bit); > > -- > 2.3.5 >