• Pavel Tatashin's avatar
    x86/jump_label: Initialize static branching early · 8990cac6
    Pavel Tatashin authored
    Static branching is useful to runtime patch branches that are used in hot
    path, but are infrequently changed.
    
    The x86 clock framework is one example that uses static branches to setup
    the best clock during boot and never changes it again.
    
    It is desired to enable the TSC based sched clock early to allow fine
    grained boot time analysis early on. That requires the static branching
    functionality to be functional early as well.
    
    Static branching requires patching nop instructions, thus,
    arch_init_ideal_nops() must be called prior to jump_label_init().
    
    Do all the necessary steps to call arch_init_ideal_nops() right after
    early_cpu_init(), which also allows to insert a call to jump_label_init()
    right after that. jump_label_init() will be called again from the generic
    init code, but the code is protected against reinitialization already.
    
    [ tglx: Massaged changelog ]
    Suggested-by: default avatarPeter Zijlstra <peterz@infradead.org>
    Signed-off-by: default avatarPavel Tatashin <pasha.tatashin@oracle.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
    Cc: steven.sistare@oracle.com
    Cc: daniel.m.jordan@oracle.com
    Cc: linux@armlinux.org.uk
    Cc: schwidefsky@de.ibm.com
    Cc: heiko.carstens@de.ibm.com
    Cc: john.stultz@linaro.org
    Cc: sboyd@codeaurora.org
    Cc: hpa@zytor.com
    Cc: douly.fnst@cn.fujitsu.com
    Cc: prarit@redhat.com
    Cc: feng.tang@intel.com
    Cc: pmladek@suse.com
    Cc: gnomes@lxorguk.ukuu.org.uk
    Cc: linux-s390@vger.kernel.org
    Cc: boris.ostrovsky@oracle.com
    Cc: jgross@suse.com
    Cc: pbonzini@redhat.com
    Link: https://lkml.kernel.org/r/20180719205545.16512-10-pasha.tatashin@oracle.com
    8990cac6
setup.c 32.3 KB