Call jump_label_init early so that can use static keys for cpu and
mmu feature check. We should have finalzed all the cpu/mmu features when
we call setup_system and we also did feature fixup for ASM based code.

Signed-off-by: Aneesh Kumar K.V <aneesh.ku...@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/setup_32.c | 6 ++++++
 arch/powerpc/kernel/setup_64.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index ecdc42d44951..8831738c3dcb 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -99,6 +99,12 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
                         PTRRELOC(&__stop___lwsync_fixup));
 
        do_final_fixups();
+       /*
+        * init jump label so that cpu and mmu feature check can be optimized
+        * using jump label. We should have all the cpu/mmu features finalized
+        * by now.
+        */
+       jump_label_init();
 
        return KERNELBASE + offset;
 }
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 05dde6318b79..c6f6cbcbee91 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -480,6 +480,12 @@ void __init setup_system(void)
        do_lwsync_fixups(cur_cpu_spec->cpu_features,
                         &__start___lwsync_fixup, &__stop___lwsync_fixup);
        do_final_fixups();
+       /*
+        * init jump label so that cpu and mmu feature check can be optimized
+        * using jump label. We should have all the cpu/mmu features finalized
+        * by now.
+        */
+       jump_label_init();
 
        /*
         * Unflatten the device-tree passed by prom_init or kexec
-- 
2.7.4

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to