From: Borislav Petkov <bp@alien8.de>
To: Ingo Molnar <mingo@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 4/4] x86/cpu: Provide a config option to disable static_cpu_has
Date: Mon, 7 Dec 2015 10:39:42 +0100 [thread overview]
Message-ID: <1449481182-27541-5-git-send-email-bp@alien8.de> (raw)
In-Reply-To: <1449481182-27541-1-git-send-email-bp@alien8.de>
From: Borislav Petkov <bp@suse.de>
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.
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
---
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
next prev parent reply other threads:[~2015-12-07 9:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-07 9:39 [PATCH 0/4] x86/cpufeature: Cleanup, p1 Borislav Petkov
2015-12-07 9:39 ` [PATCH 1/4] x86/cpufeature: Move some of the scattered feature bits to x86_capability Borislav Petkov
2015-12-19 10:18 ` [tip:x86/cpufeature] " tip-bot for Borislav Petkov
2015-12-19 10:54 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
2015-12-07 9:39 ` [PATCH 2/4] x86/cpufeature: Cleanup get_cpu_cap() Borislav Petkov
2015-12-19 10:19 ` [tip:x86/cpufeature] " tip-bot for Borislav Petkov
2015-12-19 10:55 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
2015-12-07 9:39 ` [PATCH 3/4] x86/cpufeature: Remove unused and seldomly used cpu_has_xx macros Borislav Petkov
2015-12-07 9:45 ` Ingo Molnar
2015-12-07 9:54 ` Borislav Petkov
2015-12-07 13:36 ` Ingo Molnar
2015-12-19 10:19 ` [tip:x86/cpufeature] " tip-bot for Borislav Petkov
2015-12-19 10:55 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
2015-12-07 9:39 ` Borislav Petkov [this message]
2015-12-19 10:19 ` [tip:x86/cpufeature] x86/cpu: Provide a config option to disable static_cpu_has tip-bot for Borislav Petkov
2015-12-19 10:55 ` [tip:x86/cleanups] " tip-bot for Borislav Petkov
-- strict thread matches above, loose matches on Subject: below --
2015-12-01 15:00 [PATCH 0/4] x86/cpufeature: Cleanup stuff more Borislav Petkov
2015-12-01 15:00 ` [PATCH 4/4] x86/cpu: Provide a config option to disable static_cpu_has Borislav Petkov
2015-12-01 16:24 ` Josh Triplett
2015-12-01 16:57 ` 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=1449481182-27541-5-git-send-email-bp@alien8.de \
--to=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®