Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755081AbbK0UOJ (ORCPT ); Fri, 27 Nov 2015 15:14:09 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:59695 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754080AbbK0UOH (ORCPT ); Fri, 27 Nov 2015 15:14:07 -0500 X-Originating-IP: 50.39.163.18 Date: Fri, 27 Nov 2015 12:13:55 -0800 From: Josh Triplett To: Borislav Petkov Cc: X86 ML , LKML , Peter Zijlstra , Andy Lutomirski , Herbert Xu , Matt Mackall , Chris Mason , Josef Bacik , David Sterba , kbuild test robot Subject: Re: [RFC PATCH 3/3] x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros Message-ID: <20151127201355.GC17820@x> References: <1447156122-9379-1-git-send-email-bp@alien8.de> <1447156122-9379-4-git-send-email-bp@alien8.de> <20151124130510.GA21613@pd.tnic> <20151124224211.GA23495@x> <20151127135257.GA27739@pd.tnic> <20151127180432.GC27739@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151127180432.GC27739@pd.tnic> 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 Content-Length: 2586 Lines: 67 On Fri, Nov 27, 2015 at 07:04:33PM +0100, Borislav Petkov wrote: > On Fri, Nov 27, 2015 at 02:52:57PM +0100, Borislav Petkov wrote: > > commit .TEXT .DATA .BSS > > rc2+ 650055 127948 1189128 > > 0a53df8a1a3a ("x86/cpufeature: Move some of the...") 649863 127948 1189384 > > ed03a85e6575 ("x86/cpufeature: Cleanup get_cpu_cap()") 649831 127948 1189384 > > acde56aeda14 ("x86/cpufeature: Remove unused and...") 649831 127948 1189384 > > > > I'll look at doing the macro thing now, hopefully it doesn't get too ugly. > > Yeah, we do save us some ~1.6K text (cf numbers above) for the price > of a bit slower feature bit testing. Don't know if it matters at all, > though: > > commit .TEXT .DATA .BSS > CONFIG_X86_FAST_FEATURE_TESTS 648209 127948 1189384 > > and diff looks pretty simple: Given an appropriate long description for that config option, that seems worthwhile. Something like this: 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. > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index 4a9b9a9a1a64..ff64585ea0bf 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -350,6 +350,10 @@ config X86_FEATURE_NAMES > > If in doubt, say Y. > > +config X86_FAST_FEATURE_TESTS > + bool "Fast feature tests" if EMBEDDED > + default y > + > 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 cbe390044a7c..7ad8c9464297 100644 > --- a/arch/x86/include/asm/cpufeature.h > +++ b/arch/x86/include/asm/cpufeature.h > @@ -410,7 +410,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); > > -- > Regards/Gruss, > Boris. > > ECO tip #101: Trim your mails when you reply. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/