kernel_optimize_test/arch
Kevin Hao 4db7327194 powerpc: Add option to use jump label for cpu_has_feature()
We do binary patching of asm code using CPU features, which is a
one-time operation, done during early boot. However checks of CPU
features in C code are currently done at run time, even though the set
of CPU features can never change after boot.

We can optimise this by using jump labels to implement cpu_has_feature(),
meaning checks in C code are binary patched into a single nop or branch.

For a C sequence along the lines of:

    if (cpu_has_feature(FOO))
         return 2;

The generated code before is roughly:

    ld      r9,-27640(r2)
    ld      r9,0(r9)
    lwz     r9,32(r9)
    cmpwi   cr7,r9,0
    bge     cr7, 1f
    li      r3,2
    blr
1:  ...

After (true):
    nop
    li      r3,2
    blr

After (false):
    b	1f
    li      r3,2
    blr
1:  ...

mpe: Rename MAX_CPU_FEATURES as we already have a #define with that
name, and define it simply as a constant, rather than doing tricks with
sizeof and NULL pointers. Rename the array to cpu_feature_keys. Use the
kconfig we added to guard it. Add BUILD_BUG_ON() if the feature is not a
compile time constant. Rewrite the change log.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2016-08-01 11:15:05 +10:00
..
alpha mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
arc DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
arm DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
arm64 DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
avr32 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32 2016-07-29 13:09:55 -07:00
blackfin Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-29 13:55:30 -07:00
c6x c6x: Remove unnecessary of_platform_populate with default match table 2016-06-23 14:59:39 -05:00
cris DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
frv mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
h8300 locking/atomic: Remove linux/atomic.h:atomic_fetch_or() 2016-06-16 10:48:32 +02:00
hexagon Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
ia64 Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
m32r mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
m68k mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
metag DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
microblaze Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
mips DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
mn10300 mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
nios2 DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
openrisc Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
parisc Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2016-07-29 17:38:46 -07:00
powerpc powerpc: Add option to use jump label for cpu_has_feature() 2016-08-01 11:15:05 +10:00
s390 Merge branch 'stable-4.8' of git://git.infradead.org/users/pcmoore/audit 2016-07-29 17:54:17 -07:00
score mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
sh DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
sparc sparc64: Trim page tables for 8M hugepages 2016-07-29 10:49:16 -07:00
tile Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2016-07-29 17:38:46 -07:00
um Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2016-07-29 17:38:46 -07:00
unicore32 New LED class driver: 2016-07-27 14:03:52 -07:00
x86 Merge branch 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-07-30 13:18:33 -07:00
xtensa DeviceTree update for 4.8: 2016-07-30 11:32:01 -07:00
.gitignore
Kconfig Clarify naming of thread info/stack allocators 2016-06-24 15:09:37 -07:00