All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Josh Triplett <josh@joshtriplett.org>
Cc: X86 ML <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Andy Lutomirski <luto@amacapital.net>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Matt Mackall <mpm@selenic.com>, Chris Mason <clm@fb.com>,
	Josef Bacik <jbacik@fb.com>, David Sterba <dsterba@suse.com>,
	kbuild test robot <fengguang.wu@intel.com>
Subject: Re: [RFC PATCH 3/3] x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros
Date: Fri, 27 Nov 2015 19:04:33 +0100	[thread overview]
Message-ID: <20151127180432.GC27739@pd.tnic> (raw)
In-Reply-To: <20151127135257.GA27739@pd.tnic>

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.

  reply	other threads:[~2015-11-27 18:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 11:48 [RFC PATCH 0/3] x86/cpufeature: Cleanup stuff Borislav Petkov
2015-11-10 11:48 ` [RFC PATCH 1/3] x86/cpufeature: Move some of the scattered feature bits to x86_capability Borislav Petkov
2015-11-10 11:48 ` [RFC PATCH 2/3] x86/cpufeature: Cleanup get_cpu_cap() Borislav Petkov
2015-11-10 11:48 ` [RFC PATCH 3/3] x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros Borislav Petkov
2015-11-10 11:57   ` David Sterba
2015-11-10 12:30   ` Ingo Molnar
2015-11-10 12:37     ` Borislav Petkov
2015-11-18 18:23     ` Borislav Petkov
2015-11-24 13:05   ` Borislav Petkov
2015-11-24 22:42     ` Josh Triplett
2015-11-25  0:10       ` Andy Lutomirski
2015-11-25  2:58         ` Josh Triplett
2015-11-27 13:52       ` Borislav Petkov
2015-11-27 18:04         ` Borislav Petkov [this message]
2015-11-27 20:13           ` Josh Triplett
2015-11-27 20:23             ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151127180432.GC27739@pd.tnic \
    --to=bp@alien8.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=fengguang.wu@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jbacik@fb.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mpm@selenic.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.