]> git.baikalelectronics.ru Git - kernel.git/commit
x86/cpufeature: Replace the old static_cpu_has() with safe variant
authorBorislav Petkov <bp@suse.de>
Tue, 26 Jan 2016 21:12:05 +0000 (22:12 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 30 Jan 2016 10:22:18 +0000 (11:22 +0100)
commit139fea1ee44491310466f2865b8c7191b78b38e2
treea8200bfe9677aa30a11b53e8fd6215aaeb3a4a96
parent3f5b5ea38e9dd6fec6f1fb2b3546992ac34cc5e6
x86/cpufeature: Replace the old static_cpu_has() with safe variant

So the old one didn't work properly before alternatives had run.
And it was supposed to provide an optimized JMP because the
assumption was that the offset it is jumping to is within a
signed byte and thus a two-byte JMP.

So I did an x86_64 allyesconfig build and dumped all possible
sites where static_cpu_has() was used. The optimization amounted
to all in all 12(!) places where static_cpu_has() had generated
a 2-byte JMP. Which has saved us a whopping 36 bytes!

This clearly is not worth the trouble so we can remove it. The
only place where the optimization might count - in __switch_to()
- we will handle differently. But that's not subject of this
patch.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1453842730-28463-6-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/Kconfig.debug
arch/x86/include/asm/cpufeature.h
arch/x86/include/asm/fpu/internal.h
arch/x86/kernel/apic/apic_numachip.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/vm86_32.c
drivers/cpufreq/intel_pstate.c
fs/btrfs/disk-io.c