Skip to content

Commit d026604

Browse files
Peter ZijlstraKAGA-KOKO
authored andcommitted
x86: Remove FAST_FEATURE_TESTS
Since we want to rely on static branches to avoid speculation, remove any possible fallback code for static_cpu_has. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent e501ce9 commit d026604

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

arch/x86/Kconfig

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -393,17 +393,6 @@ config X86_FEATURE_NAMES
393393

394394
If in doubt, say Y.
395395

396-
config X86_FAST_FEATURE_TESTS
397-
bool "Fast CPU feature tests" if EMBEDDED
398-
default y
399-
---help---
400-
Some fast-paths in the kernel depend on the capabilities of the CPU.
401-
Say Y here for the kernel to patch in the appropriate code at runtime
402-
based on the capabilities of the CPU. The infrastructure for patching
403-
code at runtime takes up some additional space; space-constrained
404-
embedded systems may wish to say N here to produce smaller, slightly
405-
slower code.
406-
407396
config X86_X2APIC
408397
bool "Support x2apic"
409398
depends on X86_LOCAL_APIC && X86_64 && (IRQ_REMAP || HYPERVISOR_GUEST)

arch/x86/include/asm/cpufeature.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ extern void clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int bit);
140140

141141
#define setup_force_cpu_bug(bit) setup_force_cpu_cap(bit)
142142

143-
#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_X86_FAST_FEATURE_TESTS)
144143
/*
145144
* Static testing of CPU features. Used the same as boot_cpu_has().
146145
* These will statically patch the target code for additional
@@ -196,13 +195,6 @@ static __always_inline __pure bool _static_cpu_has(u16 bit)
196195
boot_cpu_has(bit) : \
197196
_static_cpu_has(bit) \
198197
)
199-
#else
200-
/*
201-
* Fall back to dynamic for gcc versions which don't support asm goto. Should be
202-
* a minority now anyway.
203-
*/
204-
#define static_cpu_has(bit) boot_cpu_has(bit)
205-
#endif
206198

207199
#define cpu_has_bug(c, bit) cpu_has(c, (bit))
208200
#define set_cpu_bug(c, bit) set_cpu_cap(c, (bit))

0 commit comments

Comments
 (0)