Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

jump_label: move 'asm goto' support test to Kconfig

Currently, CONFIG_JUMP_LABEL just means "I _want_ to use jump label".

The jump label is controlled by HAVE_JUMP_LABEL, which is defined
like this:

#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
# define HAVE_JUMP_LABEL
#endif

We can improve this by testing 'asm goto' support in Kconfig, then
make JUMP_LABEL depend on CC_HAS_ASM_GOTO.

Ugly #ifdef HAVE_JUMP_LABEL will go away, and CONFIG_JUMP_LABEL will
match to the real kernel capability.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>

+65 -119
-7
Makefile
··· 514 514 export RETPOLINE_CFLAGS 515 515 export RETPOLINE_VDSO_CFLAGS 516 516 517 - # check for 'asm goto' 518 - ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLAGS)), y) 519 - CC_HAVE_ASM_GOTO := 1 520 - KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO 521 - KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO 522 - endif 523 - 524 517 # The expansion should be delayed until arch/$(SRCARCH)/Makefile is included. 525 518 # Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile. 526 519 # CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
+1
arch/Kconfig
··· 71 71 config JUMP_LABEL 72 72 bool "Optimize very unlikely/likely branches" 73 73 depends on HAVE_ARCH_JUMP_LABEL 74 + depends on CC_HAS_ASM_GOTO 74 75 help 75 76 This option enables a transparent branch optimization that 76 77 makes certain almost-always-true or almost-always-false branch
-4
arch/arm/kernel/jump_label.c
··· 4 4 #include <asm/patch.h> 5 5 #include <asm/insn.h> 6 6 7 - #ifdef HAVE_JUMP_LABEL 8 - 9 7 static void __arch_jump_label_transform(struct jump_entry *entry, 10 8 enum jump_label_type type, 11 9 bool is_static) ··· 33 35 { 34 36 __arch_jump_label_transform(entry, type, true); 35 37 } 36 - 37 - #endif
-4
arch/arm64/kernel/jump_label.c
··· 20 20 #include <linux/jump_label.h> 21 21 #include <asm/insn.h> 22 22 23 - #ifdef HAVE_JUMP_LABEL 24 - 25 23 void arch_jump_label_transform(struct jump_entry *entry, 26 24 enum jump_label_type type) 27 25 { ··· 47 49 * NOP needs to be replaced by a branch. 48 50 */ 49 51 } 50 - 51 - #endif /* HAVE_JUMP_LABEL */
-4
arch/mips/kernel/jump_label.c
··· 16 16 #include <asm/cacheflush.h> 17 17 #include <asm/inst.h> 18 18 19 - #ifdef HAVE_JUMP_LABEL 20 - 21 19 /* 22 20 * Define parameters for the standard MIPS and the microMIPS jump 23 21 * instruction encoding respectively: ··· 68 70 69 71 mutex_unlock(&text_mutex); 70 72 } 71 - 72 - #endif /* HAVE_JUMP_LABEL */
+1 -1
arch/powerpc/include/asm/asm-prototypes.h
··· 38 38 void __trace_hcall_entry(unsigned long opcode, unsigned long *args); 39 39 void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf); 40 40 /* OPAL tracing */ 41 - #ifdef HAVE_JUMP_LABEL 41 + #ifdef CONFIG_JUMP_LABEL 42 42 extern struct static_key opal_tracepoint_key; 43 43 #endif 44 44
-2
arch/powerpc/kernel/jump_label.c
··· 11 11 #include <linux/jump_label.h> 12 12 #include <asm/code-patching.h> 13 13 14 - #ifdef HAVE_JUMP_LABEL 15 14 void arch_jump_label_transform(struct jump_entry *entry, 16 15 enum jump_label_type type) 17 16 { ··· 21 22 else 22 23 patch_instruction(addr, PPC_INST_NOP); 23 24 } 24 - #endif
+1 -1
arch/powerpc/platforms/powernv/opal-tracepoints.c
··· 4 4 #include <asm/trace.h> 5 5 #include <asm/asm-prototypes.h> 6 6 7 - #ifdef HAVE_JUMP_LABEL 7 + #ifdef CONFIG_JUMP_LABEL 8 8 struct static_key opal_tracepoint_key = STATIC_KEY_INIT; 9 9 10 10 int opal_tracepoint_regfunc(void)
+1 -1
arch/powerpc/platforms/powernv/opal-wrappers.S
··· 20 20 .section ".text" 21 21 22 22 #ifdef CONFIG_TRACEPOINTS 23 - #ifdef HAVE_JUMP_LABEL 23 + #ifdef CONFIG_JUMP_LABEL 24 24 #define OPAL_BRANCH(LABEL) \ 25 25 ARCH_STATIC_BRANCH(LABEL, opal_tracepoint_key) 26 26 #else
+2 -2
arch/powerpc/platforms/pseries/hvCall.S
··· 19 19 20 20 #ifdef CONFIG_TRACEPOINTS 21 21 22 - #ifndef HAVE_JUMP_LABEL 22 + #ifndef CONFIG_JUMP_LABEL 23 23 .section ".toc","aw" 24 24 25 25 .globl hcall_tracepoint_refcount ··· 79 79 mr r5,BUFREG; \ 80 80 __HCALL_INST_POSTCALL 81 81 82 - #ifdef HAVE_JUMP_LABEL 82 + #ifdef CONFIG_JUMP_LABEL 83 83 #define HCALL_BRANCH(LABEL) \ 84 84 ARCH_STATIC_BRANCH(LABEL, hcall_tracepoint_key) 85 85 #else
+1 -1
arch/powerpc/platforms/pseries/lpar.c
··· 1040 1040 #endif /* CONFIG_PPC_BOOK3S_64 */ 1041 1041 1042 1042 #ifdef CONFIG_TRACEPOINTS 1043 - #ifdef HAVE_JUMP_LABEL 1043 + #ifdef CONFIG_JUMP_LABEL 1044 1044 struct static_key hcall_tracepoint_key = STATIC_KEY_INIT; 1045 1045 1046 1046 int hcall_tracepoint_regfunc(void)
+2 -1
arch/s390/kernel/Makefile
··· 48 48 obj-y := traps.o time.o process.o base.o early.o setup.o idle.o vtime.o 49 49 obj-y += processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o 50 50 obj-y += debug.o irq.o ipl.o dis.o diag.o vdso.o early_nobss.o 51 - obj-y += sysinfo.o jump_label.o lgr.o os_info.o machine_kexec.o pgm_check.o 51 + obj-y += sysinfo.o lgr.o os_info.o machine_kexec.o pgm_check.o 52 52 obj-y += runtime_instr.o cache.o fpu.o dumpstack.o guarded_storage.o sthyi.o 53 53 obj-y += entry.o reipl.o relocate_kernel.o kdebugfs.o alternative.o 54 54 obj-y += nospec-branch.o ipl_vmparm.o ··· 72 72 obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o 73 73 obj-$(CONFIG_CRASH_DUMP) += crash_dump.o 74 74 obj-$(CONFIG_UPROBES) += uprobes.o 75 + obj-$(CONFIG_JUMP_LABEL) += jump_label.o 75 76 76 77 obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o 77 78 obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o
-4
arch/s390/kernel/jump_label.c
··· 10 10 #include <linux/jump_label.h> 11 11 #include <asm/ipl.h> 12 12 13 - #ifdef HAVE_JUMP_LABEL 14 - 15 13 struct insn { 16 14 u16 opcode; 17 15 s32 offset; ··· 101 103 { 102 104 __jump_label_transform(entry, type, 1); 103 105 } 104 - 105 - #endif
+1 -1
arch/sparc/kernel/Makefile
··· 118 118 obj-$(CONFIG_SPARC64) += $(pc--y) 119 119 120 120 obj-$(CONFIG_UPROBES) += uprobes.o 121 - obj-$(CONFIG_SPARC64) += jump_label.o 121 + obj-$(CONFIG_JUMP_LABEL) += jump_label.o
-4
arch/sparc/kernel/jump_label.c
··· 9 9 10 10 #include <asm/cacheflush.h> 11 11 12 - #ifdef HAVE_JUMP_LABEL 13 - 14 12 void arch_jump_label_transform(struct jump_entry *entry, 15 13 enum jump_label_type type) 16 14 { ··· 45 47 flushi(insn); 46 48 mutex_unlock(&text_mutex); 47 49 } 48 - 49 - #endif
+1 -1
arch/x86/Makefile
··· 289 289 290 290 archprepare: checkbin 291 291 checkbin: 292 - ifndef CC_HAVE_ASM_GOTO 292 + ifndef CONFIG_CC_HAS_ASM_GOTO 293 293 @echo Compiler lacks asm-goto support. 294 294 @exit 1 295 295 endif
+1 -1
arch/x86/entry/calling.h
··· 351 351 */ 352 352 .macro CALL_enter_from_user_mode 353 353 #ifdef CONFIG_CONTEXT_TRACKING 354 - #ifdef HAVE_JUMP_LABEL 354 + #ifdef CONFIG_JUMP_LABEL 355 355 STATIC_JUMP_IF_FALSE .Lafter_call_\@, context_tracking_enabled, def=0 356 356 #endif 357 357 call enter_from_user_mode
+1 -1
arch/x86/include/asm/cpufeature.h
··· 140 140 141 141 #define setup_force_cpu_bug(bit) setup_force_cpu_cap(bit) 142 142 143 - #if defined(__clang__) && !defined(CC_HAVE_ASM_GOTO) 143 + #if defined(__clang__) && !defined(CONFIG_CC_HAS_ASM_GOTO) 144 144 145 145 /* 146 146 * Workaround for the sake of BPF compilation which utilizes kernel
-13
arch/x86/include/asm/jump_label.h
··· 2 2 #ifndef _ASM_X86_JUMP_LABEL_H 3 3 #define _ASM_X86_JUMP_LABEL_H 4 4 5 - #ifndef HAVE_JUMP_LABEL 6 - /* 7 - * For better or for worse, if jump labels (the gcc extension) are missing, 8 - * then the entire static branch patching infrastructure is compiled out. 9 - * If that happens, the code in here will malfunction. Raise a compiler 10 - * error instead. 11 - * 12 - * In theory, jump labels and the static branch patching infrastructure 13 - * could be decoupled to fix this. 14 - */ 15 - #error asm/jump_label.h included on a non-jump-label kernel 16 - #endif 17 - 18 5 #define JUMP_LABEL_NOP_SIZE 5 19 6 20 7 #ifdef CONFIG_X86_64
+3 -3
arch/x86/include/asm/rmwcc.h
··· 11 11 12 12 #define __CLOBBERS_MEM(clb...) "memory", ## clb 13 13 14 - #if !defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(CC_HAVE_ASM_GOTO) 14 + #if !defined(__GCC_ASM_FLAG_OUTPUTS__) && defined(CONFIG_CC_HAS_ASM_GOTO) 15 15 16 16 /* Use asm goto */ 17 17 ··· 27 27 c; \ 28 28 }) 29 29 30 - #else /* defined(__GCC_ASM_FLAG_OUTPUTS__) || !defined(CC_HAVE_ASM_GOTO) */ 30 + #else /* defined(__GCC_ASM_FLAG_OUTPUTS__) || !defined(CONFIG_CC_HAS_ASM_GOTO) */ 31 31 32 32 /* Use flags output or a set instruction */ 33 33 ··· 40 40 c; \ 41 41 }) 42 42 43 - #endif /* defined(__GCC_ASM_FLAG_OUTPUTS__) || !defined(CC_HAVE_ASM_GOTO) */ 43 + #endif /* defined(__GCC_ASM_FLAG_OUTPUTS__) || !defined(CONFIG_CC_HAS_ASM_GOTO) */ 44 44 45 45 #define GEN_UNARY_RMWcc_4(op, var, cc, arg0) \ 46 46 __GEN_RMWcc(op " " arg0, var, cc, __CLOBBERS_MEM())
+2 -1
arch/x86/kernel/Makefile
··· 49 49 obj-y += traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o 50 50 obj-y += time.o ioport.o dumpstack.o nmi.o 51 51 obj-$(CONFIG_MODIFY_LDT_SYSCALL) += ldt.o 52 - obj-y += setup.o x86_init.o i8259.o irqinit.o jump_label.o 52 + obj-y += setup.o x86_init.o i8259.o irqinit.o 53 + obj-$(CONFIG_JUMP_LABEL) += jump_label.o 53 54 obj-$(CONFIG_IRQ_WORK) += irq_work.o 54 55 obj-y += probe_roms.o 55 56 obj-$(CONFIG_X86_64) += sys_x86_64.o
-4
arch/x86/kernel/jump_label.c
··· 16 16 #include <asm/alternative.h> 17 17 #include <asm/text-patching.h> 18 18 19 - #ifdef HAVE_JUMP_LABEL 20 - 21 19 union jump_code_union { 22 20 char code[JUMP_LABEL_NOP_SIZE]; 23 21 struct { ··· 128 130 if (jlstate == JL_STATE_UPDATE) 129 131 __jump_label_transform(entry, type, text_poke_early, 1); 130 132 } 131 - 132 - #endif
+1 -1
arch/x86/kvm/emulate.c
··· 456 456 457 457 /* 458 458 * XXX: inoutclob user must know where the argument is being expanded. 459 - * Relying on CC_HAVE_ASM_GOTO would allow us to remove _fault. 459 + * Relying on CONFIG_CC_HAS_ASM_GOTO would allow us to remove _fault. 460 460 */ 461 461 #define asm_safe(insn, inoutclob...) \ 462 462 ({ \
-4
arch/xtensa/kernel/jump_label.c
··· 10 10 11 11 #include <asm/cacheflush.h> 12 12 13 - #ifdef HAVE_JUMP_LABEL 14 - 15 13 #define J_OFFSET_MASK 0x0003ffff 16 14 #define J_SIGN_MASK (~(J_OFFSET_MASK >> 1)) 17 15 ··· 93 95 94 96 patch_text(jump_entry_code(e), &insn, JUMP_LABEL_NOP_SIZE); 95 97 } 96 - 97 - #endif /* HAVE_JUMP_LABEL */
+3 -3
include/linux/dynamic_debug.h
··· 2 2 #ifndef _DYNAMIC_DEBUG_H 3 3 #define _DYNAMIC_DEBUG_H 4 4 5 - #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) 5 + #if defined(CONFIG_JUMP_LABEL) 6 6 #include <linux/jump_label.h> 7 7 #endif 8 8 ··· 38 38 #define _DPRINTK_FLAGS_DEFAULT 0 39 39 #endif 40 40 unsigned int flags:8; 41 - #ifdef HAVE_JUMP_LABEL 41 + #ifdef CONFIG_JUMP_LABEL 42 42 union { 43 43 struct static_key_true dd_key_true; 44 44 struct static_key_false dd_key_false; ··· 83 83 dd_key_init(key, init) \ 84 84 } 85 85 86 - #ifdef HAVE_JUMP_LABEL 86 + #ifdef CONFIG_JUMP_LABEL 87 87 88 88 #define dd_key_init(key, init) key = (init) 89 89
+9 -13
include/linux/jump_label.h
··· 71 71 * Additional babbling in: Documentation/static-keys.txt 72 72 */ 73 73 74 - #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) 75 - # define HAVE_JUMP_LABEL 76 - #endif 77 - 78 74 #ifndef __ASSEMBLY__ 79 75 80 76 #include <linux/types.h> ··· 82 86 "%s(): static key '%pS' used before call to jump_label_init()", \ 83 87 __func__, (key)) 84 88 85 - #ifdef HAVE_JUMP_LABEL 89 + #ifdef CONFIG_JUMP_LABEL 86 90 87 91 struct static_key { 88 92 atomic_t enabled; ··· 110 114 struct static_key { 111 115 atomic_t enabled; 112 116 }; 113 - #endif /* HAVE_JUMP_LABEL */ 117 + #endif /* CONFIG_JUMP_LABEL */ 114 118 #endif /* __ASSEMBLY__ */ 115 119 116 - #ifdef HAVE_JUMP_LABEL 120 + #ifdef CONFIG_JUMP_LABEL 117 121 #include <asm/jump_label.h> 118 122 119 123 #ifndef __ASSEMBLY__ ··· 188 192 189 193 struct module; 190 194 191 - #ifdef HAVE_JUMP_LABEL 195 + #ifdef CONFIG_JUMP_LABEL 192 196 193 197 #define JUMP_TYPE_FALSE 0UL 194 198 #define JUMP_TYPE_TRUE 1UL ··· 241 245 { .enabled = { 0 }, \ 242 246 { .entries = (void *)JUMP_TYPE_FALSE } } 243 247 244 - #else /* !HAVE_JUMP_LABEL */ 248 + #else /* !CONFIG_JUMP_LABEL */ 245 249 246 250 #include <linux/atomic.h> 247 251 #include <linux/bug.h> ··· 326 330 #define STATIC_KEY_INIT_TRUE { .enabled = ATOMIC_INIT(1) } 327 331 #define STATIC_KEY_INIT_FALSE { .enabled = ATOMIC_INIT(0) } 328 332 329 - #endif /* HAVE_JUMP_LABEL */ 333 + #endif /* CONFIG_JUMP_LABEL */ 330 334 331 335 #define STATIC_KEY_INIT STATIC_KEY_INIT_FALSE 332 336 #define jump_label_enabled static_key_enabled ··· 390 394 static_key_count((struct static_key *)x) > 0; \ 391 395 }) 392 396 393 - #ifdef HAVE_JUMP_LABEL 397 + #ifdef CONFIG_JUMP_LABEL 394 398 395 399 /* 396 400 * Combine the right initial value (type) with the right branch order ··· 472 476 unlikely(branch); \ 473 477 }) 474 478 475 - #else /* !HAVE_JUMP_LABEL */ 479 + #else /* !CONFIG_JUMP_LABEL */ 476 480 477 481 #define static_branch_likely(x) likely(static_key_enabled(&(x)->key)) 478 482 #define static_branch_unlikely(x) unlikely(static_key_enabled(&(x)->key)) 479 483 480 - #endif /* HAVE_JUMP_LABEL */ 484 + #endif /* CONFIG_JUMP_LABEL */ 481 485 482 486 /* 483 487 * Advanced usage; refcount, branch is enabled when: count != 0
+3 -5
include/linux/jump_label_ratelimit.h
··· 5 5 #include <linux/jump_label.h> 6 6 #include <linux/workqueue.h> 7 7 8 - #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) 8 + #if defined(CONFIG_JUMP_LABEL) 9 9 struct static_key_deferred { 10 10 struct static_key key; 11 11 unsigned long timeout; 12 12 struct delayed_work work; 13 13 }; 14 - #endif 15 14 16 - #ifdef HAVE_JUMP_LABEL 17 15 extern void static_key_slow_dec_deferred(struct static_key_deferred *key); 18 16 extern void static_key_deferred_flush(struct static_key_deferred *key); 19 17 extern void 20 18 jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl); 21 19 22 - #else /* !HAVE_JUMP_LABEL */ 20 + #else /* !CONFIG_JUMP_LABEL */ 23 21 struct static_key_deferred { 24 22 struct static_key key; 25 23 }; ··· 36 38 { 37 39 STATIC_KEY_CHECK_USE(key); 38 40 } 39 - #endif /* HAVE_JUMP_LABEL */ 41 + #endif /* CONFIG_JUMP_LABEL */ 40 42 #endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */
+1 -1
include/linux/module.h
··· 436 436 unsigned int num_bpf_raw_events; 437 437 struct bpf_raw_event_map *bpf_raw_events; 438 438 #endif 439 - #ifdef HAVE_JUMP_LABEL 439 + #ifdef CONFIG_JUMP_LABEL 440 440 struct jump_entry *jump_entries; 441 441 unsigned int num_jump_entries; 442 442 #endif
+2 -2
include/linux/netfilter.h
··· 176 176 int nf_register_sockopt(struct nf_sockopt_ops *reg); 177 177 void nf_unregister_sockopt(struct nf_sockopt_ops *reg); 178 178 179 - #ifdef HAVE_JUMP_LABEL 179 + #ifdef CONFIG_JUMP_LABEL 180 180 extern struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; 181 181 #endif 182 182 ··· 198 198 struct nf_hook_entries *hook_head = NULL; 199 199 int ret = 1; 200 200 201 - #ifdef HAVE_JUMP_LABEL 201 + #ifdef CONFIG_JUMP_LABEL 202 202 if (__builtin_constant_p(pf) && 203 203 __builtin_constant_p(hook) && 204 204 !static_key_false(&nf_hooks_needed[pf][hook]))
+1 -1
include/linux/netfilter_ingress.h
··· 8 8 #ifdef CONFIG_NETFILTER_INGRESS 9 9 static inline bool nf_hook_ingress_active(const struct sk_buff *skb) 10 10 { 11 - #ifdef HAVE_JUMP_LABEL 11 + #ifdef CONFIG_JUMP_LABEL 12 12 if (!static_key_false(&nf_hooks_needed[NFPROTO_NETDEV][NF_NETDEV_INGRESS])) 13 13 return false; 14 14 #endif
+3
init/Kconfig
··· 23 23 int 24 24 default $(shell,$(srctree)/scripts/clang-version.sh $(CC)) 25 25 26 + config CC_HAS_ASM_GOTO 27 + def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC)) 28 + 26 29 config CONSTRUCTORS 27 30 bool 28 31 depends on !UML
+3 -7
kernel/jump_label.c
··· 18 18 #include <linux/cpu.h> 19 19 #include <asm/sections.h> 20 20 21 - #ifdef HAVE_JUMP_LABEL 22 - 23 21 /* mutex to protect coming/going of the the jump_label table */ 24 22 static DEFINE_MUTEX(jump_label_mutex); 25 23 ··· 78 80 static void jump_label_update(struct static_key *key); 79 81 80 82 /* 81 - * There are similar definitions for the !HAVE_JUMP_LABEL case in jump_label.h. 83 + * There are similar definitions for the !CONFIG_JUMP_LABEL case in jump_label.h. 82 84 * The use of 'atomic_read()' requires atomic.h and its problematic for some 83 85 * kernel headers such as kernel.h and others. Since static_key_count() is not 84 - * used in the branch statements as it is for the !HAVE_JUMP_LABEL case its ok 86 + * used in the branch statements as it is for the !CONFIG_JUMP_LABEL case its ok 85 87 * to have it be a function here. Similarly, for 'static_key_enable()' and 86 88 * 'static_key_disable()', which require bug.h. This should allow jump_label.h 87 - * to be included from most/all places for HAVE_JUMP_LABEL. 89 + * to be included from most/all places for CONFIG_JUMP_LABEL. 88 90 */ 89 91 int static_key_count(struct static_key *key) 90 92 { ··· 789 791 } 790 792 early_initcall(jump_label_test); 791 793 #endif /* STATIC_KEYS_SELFTEST */ 792 - 793 - #endif /* HAVE_JUMP_LABEL */
+1 -1
kernel/module.c
··· 3102 3102 sizeof(*mod->bpf_raw_events), 3103 3103 &mod->num_bpf_raw_events); 3104 3104 #endif 3105 - #ifdef HAVE_JUMP_LABEL 3105 + #ifdef CONFIG_JUMP_LABEL 3106 3106 mod->jump_entries = section_objs(info, "__jump_table", 3107 3107 sizeof(*mod->jump_entries), 3108 3108 &mod->num_jump_entries);
+1 -1
kernel/sched/core.c
··· 24 24 25 25 DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); 26 26 27 - #if defined(CONFIG_SCHED_DEBUG) && defined(HAVE_JUMP_LABEL) 27 + #if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_JUMP_LABEL) 28 28 /* 29 29 * Debugging: various feature bits 30 30 *
+2 -2
kernel/sched/debug.c
··· 73 73 return 0; 74 74 } 75 75 76 - #ifdef HAVE_JUMP_LABEL 76 + #ifdef CONFIG_JUMP_LABEL 77 77 78 78 #define jump_label_key__true STATIC_KEY_INIT_TRUE 79 79 #define jump_label_key__false STATIC_KEY_INIT_FALSE ··· 99 99 #else 100 100 static void sched_feat_disable(int i) { }; 101 101 static void sched_feat_enable(int i) { }; 102 - #endif /* HAVE_JUMP_LABEL */ 102 + #endif /* CONFIG_JUMP_LABEL */ 103 103 104 104 static int sched_feat_set(char *cmp) 105 105 {
+3 -3
kernel/sched/fair.c
··· 4217 4217 4218 4218 #ifdef CONFIG_CFS_BANDWIDTH 4219 4219 4220 - #ifdef HAVE_JUMP_LABEL 4220 + #ifdef CONFIG_JUMP_LABEL 4221 4221 static struct static_key __cfs_bandwidth_used; 4222 4222 4223 4223 static inline bool cfs_bandwidth_used(void) ··· 4234 4234 { 4235 4235 static_key_slow_dec_cpuslocked(&__cfs_bandwidth_used); 4236 4236 } 4237 - #else /* HAVE_JUMP_LABEL */ 4237 + #else /* CONFIG_JUMP_LABEL */ 4238 4238 static bool cfs_bandwidth_used(void) 4239 4239 { 4240 4240 return true; ··· 4242 4242 4243 4243 void cfs_bandwidth_usage_inc(void) {} 4244 4244 void cfs_bandwidth_usage_dec(void) {} 4245 - #endif /* HAVE_JUMP_LABEL */ 4245 + #endif /* CONFIG_JUMP_LABEL */ 4246 4246 4247 4247 /* 4248 4248 * default period for cfs group bandwidth.
+3 -3
kernel/sched/sched.h
··· 1488 1488 1489 1489 #undef SCHED_FEAT 1490 1490 1491 - #if defined(CONFIG_SCHED_DEBUG) && defined(HAVE_JUMP_LABEL) 1491 + #if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_JUMP_LABEL) 1492 1492 1493 1493 /* 1494 1494 * To support run-time toggling of sched features, all the translation units ··· 1508 1508 extern struct static_key sched_feat_keys[__SCHED_FEAT_NR]; 1509 1509 #define sched_feat(x) (static_branch_##x(&sched_feat_keys[__SCHED_FEAT_##x])) 1510 1510 1511 - #else /* !(SCHED_DEBUG && HAVE_JUMP_LABEL) */ 1511 + #else /* !(SCHED_DEBUG && CONFIG_JUMP_LABEL) */ 1512 1512 1513 1513 /* 1514 1514 * Each translation unit has its own copy of sysctl_sched_features to allow ··· 1524 1524 1525 1525 #define sched_feat(x) !!(sysctl_sched_features & (1UL << __SCHED_FEAT_##x)) 1526 1526 1527 - #endif /* SCHED_DEBUG && HAVE_JUMP_LABEL */ 1527 + #endif /* SCHED_DEBUG && CONFIG_JUMP_LABEL */ 1528 1528 1529 1529 extern struct static_key_false sched_numa_balancing; 1530 1530 extern struct static_key_false sched_schedstats;
+1 -1
lib/dynamic_debug.c
··· 188 188 newflags = (dp->flags & mask) | flags; 189 189 if (newflags == dp->flags) 190 190 continue; 191 - #ifdef HAVE_JUMP_LABEL 191 + #ifdef CONFIG_JUMP_LABEL 192 192 if (dp->flags & _DPRINTK_FLAGS_PRINT) { 193 193 if (!(flags & _DPRINTK_FLAGS_PRINT)) 194 194 static_branch_disable(&dp->key.dd_key_true);
+3 -3
net/core/dev.c
··· 1821 1821 #endif 1822 1822 1823 1823 static DEFINE_STATIC_KEY_FALSE(netstamp_needed_key); 1824 - #ifdef HAVE_JUMP_LABEL 1824 + #ifdef CONFIG_JUMP_LABEL 1825 1825 static atomic_t netstamp_needed_deferred; 1826 1826 static atomic_t netstamp_wanted; 1827 1827 static void netstamp_clear(struct work_struct *work) ··· 1840 1840 1841 1841 void net_enable_timestamp(void) 1842 1842 { 1843 - #ifdef HAVE_JUMP_LABEL 1843 + #ifdef CONFIG_JUMP_LABEL 1844 1844 int wanted; 1845 1845 1846 1846 while (1) { ··· 1860 1860 1861 1861 void net_disable_timestamp(void) 1862 1862 { 1863 - #ifdef HAVE_JUMP_LABEL 1863 + #ifdef CONFIG_JUMP_LABEL 1864 1864 int wanted; 1865 1865 1866 1866 while (1) {
+3 -3
net/netfilter/core.c
··· 33 33 DEFINE_PER_CPU(bool, nf_skb_duplicated); 34 34 EXPORT_SYMBOL_GPL(nf_skb_duplicated); 35 35 36 - #ifdef HAVE_JUMP_LABEL 36 + #ifdef CONFIG_JUMP_LABEL 37 37 struct static_key nf_hooks_needed[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; 38 38 EXPORT_SYMBOL(nf_hooks_needed); 39 39 #endif ··· 347 347 if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS) 348 348 net_inc_ingress_queue(); 349 349 #endif 350 - #ifdef HAVE_JUMP_LABEL 350 + #ifdef CONFIG_JUMP_LABEL 351 351 static_key_slow_inc(&nf_hooks_needed[pf][reg->hooknum]); 352 352 #endif 353 353 BUG_ON(p == new_hooks); ··· 405 405 if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS) 406 406 net_dec_ingress_queue(); 407 407 #endif 408 - #ifdef HAVE_JUMP_LABEL 408 + #ifdef CONFIG_JUMP_LABEL 409 409 static_key_slow_dec(&nf_hooks_needed[pf][reg->hooknum]); 410 410 #endif 411 411 } else {
+1 -1
scripts/gcc-goto.sh
··· 3 3 # Test for gcc 'asm goto' support 4 4 # Copyright (C) 2010, Jason Baron <jbaron@redhat.com> 5 5 6 - cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y" 6 + cat << "END" | $@ -x c - -fno-PIE -c -o /dev/null 7 7 int main(void) 8 8 { 9 9 #if defined(__arm__) || defined(__aarch64__)
+3 -3
tools/arch/x86/include/asm/rmwcc.h
··· 2 2 #ifndef _TOOLS_LINUX_ASM_X86_RMWcc 3 3 #define _TOOLS_LINUX_ASM_X86_RMWcc 4 4 5 - #ifdef CC_HAVE_ASM_GOTO 5 + #ifdef CONFIG_CC_HAS_ASM_GOTO 6 6 7 7 #define __GEN_RMWcc(fullop, var, cc, ...) \ 8 8 do { \ ··· 20 20 #define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ 21 21 __GEN_RMWcc(op " %1, " arg0, var, cc, vcon (val)) 22 22 23 - #else /* !CC_HAVE_ASM_GOTO */ 23 + #else /* !CONFIG_CC_HAS_ASM_GOTO */ 24 24 25 25 #define __GEN_RMWcc(fullop, var, cc, ...) \ 26 26 do { \ ··· 37 37 #define GEN_BINARY_RMWcc(op, var, vcon, val, arg0, cc) \ 38 38 __GEN_RMWcc(op " %2, " arg0, var, cc, vcon (val)) 39 39 40 - #endif /* CC_HAVE_ASM_GOTO */ 40 + #endif /* CONFIG_CC_HAS_ASM_GOTO */ 41 41 42 42 #endif /* _TOOLS_LINUX_ASM_X86_RMWcc */