Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755239AbbK0SEk (ORCPT ); Fri, 27 Nov 2015 13:04:40 -0500 Received: from mail.skyhub.de ([78.46.96.112]:37299 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754853AbbK0SEi (ORCPT ); Fri, 27 Nov 2015 13:04:38 -0500 Date: Fri, 27 Nov 2015 19:04:33 +0100 From: Borislav Petkov To: Josh Triplett 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: <20151127180432.GC27739@pd.tnic> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20151127135257.GA27739@pd.tnic> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1958 Lines: 57 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: --- 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/