diff options
| author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-12-30 10:14:15 -0500 |
|---|---|---|
| committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2019-01-05 19:46:51 -0500 |
| commit | e9666d10a5677a494260d60d1fa0b73cc7646eb3 (patch) | |
| tree | fd609e683efff32ed6cc1458e20c40969328a33e /arch | |
| parent | 72d3ebb929de339f991fc49b58942d2d5ecdb753 (diff) | |
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>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/Kconfig | 1 | ||||
| -rw-r--r-- | arch/arm/kernel/jump_label.c | 4 | ||||
| -rw-r--r-- | arch/arm64/kernel/jump_label.c | 4 | ||||
| -rw-r--r-- | arch/mips/kernel/jump_label.c | 4 | ||||
| -rw-r--r-- | arch/powerpc/include/asm/asm-prototypes.h | 2 | ||||
| -rw-r--r-- | arch/powerpc/kernel/jump_label.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/platforms/powernv/opal-tracepoints.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/platforms/powernv/opal-wrappers.S | 2 | ||||
| -rw-r--r-- | arch/powerpc/platforms/pseries/hvCall.S | 4 | ||||
| -rw-r--r-- | arch/powerpc/platforms/pseries/lpar.c | 2 | ||||
| -rw-r--r-- | arch/s390/kernel/Makefile | 3 | ||||
| -rw-r--r-- | arch/s390/kernel/jump_label.c | 4 | ||||
| -rw-r--r-- | arch/sparc/kernel/Makefile | 2 | ||||
| -rw-r--r-- | arch/sparc/kernel/jump_label.c | 4 | ||||
| -rw-r--r-- | arch/x86/Makefile | 2 | ||||
| -rw-r--r-- | arch/x86/entry/calling.h | 2 | ||||
| -rw-r--r-- | arch/x86/include/asm/cpufeature.h | 2 | ||||
| -rw-r--r-- | arch/x86/include/asm/jump_label.h | 13 | ||||
| -rw-r--r-- | arch/x86/include/asm/rmwcc.h | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/Makefile | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/jump_label.c | 4 | ||||
| -rw-r--r-- | arch/x86/kvm/emulate.c | 2 | ||||
| -rw-r--r-- | arch/xtensa/kernel/jump_label.c | 4 |
23 files changed, 19 insertions, 59 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index b70c952ac838..4cfb6de48f79 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
| @@ -71,6 +71,7 @@ config KPROBES | |||
| 71 | config JUMP_LABEL | 71 | config JUMP_LABEL |
| 72 | bool "Optimize very unlikely/likely branches" | 72 | bool "Optimize very unlikely/likely branches" |
| 73 | depends on HAVE_ARCH_JUMP_LABEL | 73 | depends on HAVE_ARCH_JUMP_LABEL |
| 74 | depends on CC_HAS_ASM_GOTO | ||
| 74 | help | 75 | help |
| 75 | This option enables a transparent branch optimization that | 76 | This option enables a transparent branch optimization that |
| 76 | makes certain almost-always-true or almost-always-false branch | 77 | makes certain almost-always-true or almost-always-false branch |
diff --git a/arch/arm/kernel/jump_label.c b/arch/arm/kernel/jump_label.c index 90bce3d9928e..303b3ab87f7e 100644 --- a/arch/arm/kernel/jump_label.c +++ b/arch/arm/kernel/jump_label.c | |||
| @@ -4,8 +4,6 @@ | |||
| 4 | #include <asm/patch.h> | 4 | #include <asm/patch.h> |
| 5 | #include <asm/insn.h> | 5 | #include <asm/insn.h> |
| 6 | 6 | ||
| 7 | #ifdef HAVE_JUMP_LABEL | ||
| 8 | |||
| 9 | static void __arch_jump_label_transform(struct jump_entry *entry, | 7 | static void __arch_jump_label_transform(struct jump_entry *entry, |
| 10 | enum jump_label_type type, | 8 | enum jump_label_type type, |
| 11 | bool is_static) | 9 | bool is_static) |
| @@ -35,5 +33,3 @@ void arch_jump_label_transform_static(struct jump_entry *entry, | |||
| 35 | { | 33 | { |
| 36 | __arch_jump_label_transform(entry, type, true); | 34 | __arch_jump_label_transform(entry, type, true); |
| 37 | } | 35 | } |
| 38 | |||
| 39 | #endif | ||
diff --git a/arch/arm64/kernel/jump_label.c b/arch/arm64/kernel/jump_label.c index 646b9562ee64..1eff270e8861 100644 --- a/arch/arm64/kernel/jump_label.c +++ b/arch/arm64/kernel/jump_label.c | |||
| @@ -20,8 +20,6 @@ | |||
| 20 | #include <linux/jump_label.h> | 20 | #include <linux/jump_label.h> |
| 21 | #include <asm/insn.h> | 21 | #include <asm/insn.h> |
| 22 | 22 | ||
| 23 | #ifdef HAVE_JUMP_LABEL | ||
| 24 | |||
| 25 | void arch_jump_label_transform(struct jump_entry *entry, | 23 | void arch_jump_label_transform(struct jump_entry *entry, |
| 26 | enum jump_label_type type) | 24 | enum jump_label_type type) |
| 27 | { | 25 | { |
| @@ -49,5 +47,3 @@ void arch_jump_label_transform_static(struct jump_entry *entry, | |||
| 49 | * NOP needs to be replaced by a branch. | 47 | * NOP needs to be replaced by a branch. |
| 50 | */ | 48 | */ |
| 51 | } | 49 | } |
| 52 | |||
| 53 | #endif /* HAVE_JUMP_LABEL */ | ||
diff --git a/arch/mips/kernel/jump_label.c b/arch/mips/kernel/jump_label.c index 32e3168316cd..ab943927f97a 100644 --- a/arch/mips/kernel/jump_label.c +++ b/arch/mips/kernel/jump_label.c | |||
| @@ -16,8 +16,6 @@ | |||
| 16 | #include <asm/cacheflush.h> | 16 | #include <asm/cacheflush.h> |
| 17 | #include <asm/inst.h> | 17 | #include <asm/inst.h> |
| 18 | 18 | ||
| 19 | #ifdef HAVE_JUMP_LABEL | ||
| 20 | |||
| 21 | /* | 19 | /* |
| 22 | * Define parameters for the standard MIPS and the microMIPS jump | 20 | * Define parameters for the standard MIPS and the microMIPS jump |
| 23 | * instruction encoding respectively: | 21 | * instruction encoding respectively: |
| @@ -70,5 +68,3 @@ void arch_jump_label_transform(struct jump_entry *e, | |||
| 70 | 68 | ||
| 71 | mutex_unlock(&text_mutex); | 69 | mutex_unlock(&text_mutex); |
| 72 | } | 70 | } |
| 73 | |||
| 74 | #endif /* HAVE_JUMP_LABEL */ | ||
diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h index 6f201b199c02..1d911f68a23b 100644 --- a/arch/powerpc/include/asm/asm-prototypes.h +++ b/arch/powerpc/include/asm/asm-prototypes.h | |||
| @@ -38,7 +38,7 @@ extern struct static_key hcall_tracepoint_key; | |||
| 38 | void __trace_hcall_entry(unsigned long opcode, unsigned long *args); | 38 | void __trace_hcall_entry(unsigned long opcode, unsigned long *args); |
| 39 | void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf); | 39 | void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf); |
| 40 | /* OPAL tracing */ | 40 | /* OPAL tracing */ |
| 41 | #ifdef HAVE_JUMP_LABEL | 41 | #ifdef CONFIG_JUMP_LABEL |
| 42 | extern struct static_key opal_tracepoint_key; | 42 | extern struct static_key opal_tracepoint_key; |
| 43 | #endif | 43 | #endif |
| 44 | 44 | ||
diff --git a/arch/powerpc/kernel/jump_label.c b/arch/powerpc/kernel/jump_label.c index 6472472093d0..0080c5fbd225 100644 --- a/arch/powerpc/kernel/jump_label.c +++ b/arch/powerpc/kernel/jump_label.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #include <linux/jump_label.h> | 11 | #include <linux/jump_label.h> |
| 12 | #include <asm/code-patching.h> | 12 | #include <asm/code-patching.h> |
| 13 | 13 | ||
| 14 | #ifdef HAVE_JUMP_LABEL | ||
| 15 | void arch_jump_label_transform(struct jump_entry *entry, | 14 | void arch_jump_label_transform(struct jump_entry *entry, |
| 16 | enum jump_label_type type) | 15 | enum jump_label_type type) |
| 17 | { | 16 | { |
| @@ -22,4 +21,3 @@ void arch_jump_label_transform(struct jump_entry *entry, | |||
| 22 | else | 21 | else |
| 23 | patch_instruction(addr, PPC_INST_NOP); | 22 | patch_instruction(addr, PPC_INST_NOP); |
| 24 | } | 23 | } |
| 25 | #endif | ||
diff --git a/arch/powerpc/platforms/powernv/opal-tracepoints.c b/arch/powerpc/platforms/powernv/opal-tracepoints.c index 1ab7d26c0a2c..f16a43540e30 100644 --- a/arch/powerpc/platforms/powernv/opal-tracepoints.c +++ b/arch/powerpc/platforms/powernv/opal-tracepoints.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include <asm/trace.h> | 4 | #include <asm/trace.h> |
| 5 | #include <asm/asm-prototypes.h> | 5 | #include <asm/asm-prototypes.h> |
| 6 | 6 | ||
| 7 | #ifdef HAVE_JUMP_LABEL | 7 | #ifdef CONFIG_JUMP_LABEL |
| 8 | struct static_key opal_tracepoint_key = STATIC_KEY_INIT; | 8 | struct static_key opal_tracepoint_key = STATIC_KEY_INIT; |
| 9 | 9 | ||
| 10 | int opal_tracepoint_regfunc(void) | 10 | int opal_tracepoint_regfunc(void) |
diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S index 251528231a9e..f4875fe3f8ff 100644 --- a/arch/powerpc/platforms/powernv/opal-wrappers.S +++ b/arch/powerpc/platforms/powernv/opal-wrappers.S | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | .section ".text" | 20 | .section ".text" |
| 21 | 21 | ||
| 22 | #ifdef CONFIG_TRACEPOINTS | 22 | #ifdef CONFIG_TRACEPOINTS |
| 23 | #ifdef HAVE_JUMP_LABEL | 23 | #ifdef CONFIG_JUMP_LABEL |
| 24 | #define OPAL_BRANCH(LABEL) \ | 24 | #define OPAL_BRANCH(LABEL) \ |
| 25 | ARCH_STATIC_BRANCH(LABEL, opal_tracepoint_key) | 25 | ARCH_STATIC_BRANCH(LABEL, opal_tracepoint_key) |
| 26 | #else | 26 | #else |
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S index d91412c591ef..50dc9426d0be 100644 --- a/arch/powerpc/platforms/pseries/hvCall.S +++ b/arch/powerpc/platforms/pseries/hvCall.S | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | #ifdef CONFIG_TRACEPOINTS | 20 | #ifdef CONFIG_TRACEPOINTS |
| 21 | 21 | ||
| 22 | #ifndef HAVE_JUMP_LABEL | 22 | #ifndef CONFIG_JUMP_LABEL |
| 23 | .section ".toc","aw" | 23 | .section ".toc","aw" |
| 24 | 24 | ||
| 25 | .globl hcall_tracepoint_refcount | 25 | .globl hcall_tracepoint_refcount |
| @@ -79,7 +79,7 @@ hcall_tracepoint_refcount: | |||
| 79 | mr r5,BUFREG; \ | 79 | mr r5,BUFREG; \ |
| 80 | __HCALL_INST_POSTCALL | 80 | __HCALL_INST_POSTCALL |
| 81 | 81 | ||
| 82 | #ifdef HAVE_JUMP_LABEL | 82 | #ifdef CONFIG_JUMP_LABEL |
| 83 | #define HCALL_BRANCH(LABEL) \ | 83 | #define HCALL_BRANCH(LABEL) \ |
| 84 | ARCH_STATIC_BRANCH(LABEL, hcall_tracepoint_key) | 84 | ARCH_STATIC_BRANCH(LABEL, hcall_tracepoint_key) |
| 85 | #else | 85 | #else |
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c index 32d4452973e7..f2a9f0adc2d3 100644 --- a/arch/powerpc/platforms/pseries/lpar.c +++ b/arch/powerpc/platforms/pseries/lpar.c | |||
| @@ -1040,7 +1040,7 @@ EXPORT_SYMBOL(arch_free_page); | |||
| 1040 | #endif /* CONFIG_PPC_BOOK3S_64 */ | 1040 | #endif /* CONFIG_PPC_BOOK3S_64 */ |
| 1041 | 1041 | ||
| 1042 | #ifdef CONFIG_TRACEPOINTS | 1042 | #ifdef CONFIG_TRACEPOINTS |
| 1043 | #ifdef HAVE_JUMP_LABEL | 1043 | #ifdef CONFIG_JUMP_LABEL |
| 1044 | struct static_key hcall_tracepoint_key = STATIC_KEY_INIT; | 1044 | struct static_key hcall_tracepoint_key = STATIC_KEY_INIT; |
| 1045 | 1045 | ||
| 1046 | int hcall_tracepoint_regfunc(void) | 1046 | int hcall_tracepoint_regfunc(void) |
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile index 386b1abb217b..e216e116a9a9 100644 --- a/arch/s390/kernel/Makefile +++ b/arch/s390/kernel/Makefile | |||
| @@ -48,7 +48,7 @@ CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' | |||
| 48 | obj-y := traps.o time.o process.o base.o early.o setup.o idle.o vtime.o | 48 | obj-y := traps.o time.o process.o base.o early.o setup.o idle.o vtime.o |
| 49 | obj-y += processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o | 49 | obj-y += processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o |
| 50 | obj-y += debug.o irq.o ipl.o dis.o diag.o vdso.o early_nobss.o | 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 | obj-y += runtime_instr.o cache.o fpu.o dumpstack.o guarded_storage.o sthyi.o | 52 | obj-y += runtime_instr.o cache.o fpu.o dumpstack.o guarded_storage.o sthyi.o |
| 53 | obj-y += entry.o reipl.o relocate_kernel.o kdebugfs.o alternative.o | 53 | obj-y += entry.o reipl.o relocate_kernel.o kdebugfs.o alternative.o |
| 54 | obj-y += nospec-branch.o ipl_vmparm.o | 54 | obj-y += nospec-branch.o ipl_vmparm.o |
| @@ -72,6 +72,7 @@ obj-$(CONFIG_KPROBES) += kprobes.o | |||
| 72 | obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o | 72 | obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o |
| 73 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | 73 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
| 74 | obj-$(CONFIG_UPROBES) += uprobes.o | 74 | obj-$(CONFIG_UPROBES) += uprobes.o |
| 75 | obj-$(CONFIG_JUMP_LABEL) += jump_label.o | ||
| 75 | 76 | ||
| 76 | obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o | 77 | obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o |
| 77 | obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o | 78 | obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o |
diff --git a/arch/s390/kernel/jump_label.c b/arch/s390/kernel/jump_label.c index 50a1798604a8..3f10b56bd5a3 100644 --- a/arch/s390/kernel/jump_label.c +++ b/arch/s390/kernel/jump_label.c | |||
| @@ -10,8 +10,6 @@ | |||
| 10 | #include <linux/jump_label.h> | 10 | #include <linux/jump_label.h> |
| 11 | #include <asm/ipl.h> | 11 | #include <asm/ipl.h> |
| 12 | 12 | ||
| 13 | #ifdef HAVE_JUMP_LABEL | ||
| 14 | |||
| 15 | struct insn { | 13 | struct insn { |
| 16 | u16 opcode; | 14 | u16 opcode; |
| 17 | s32 offset; | 15 | s32 offset; |
| @@ -103,5 +101,3 @@ void arch_jump_label_transform_static(struct jump_entry *entry, | |||
| 103 | { | 101 | { |
| 104 | __jump_label_transform(entry, type, 1); | 102 | __jump_label_transform(entry, type, 1); |
| 105 | } | 103 | } |
| 106 | |||
| 107 | #endif | ||
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index cf8640841b7a..97c0e19263d1 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile | |||
| @@ -118,4 +118,4 @@ pc--$(CONFIG_PERF_EVENTS) := perf_event.o | |||
| 118 | obj-$(CONFIG_SPARC64) += $(pc--y) | 118 | obj-$(CONFIG_SPARC64) += $(pc--y) |
| 119 | 119 | ||
| 120 | obj-$(CONFIG_UPROBES) += uprobes.o | 120 | obj-$(CONFIG_UPROBES) += uprobes.o |
| 121 | obj-$(CONFIG_SPARC64) += jump_label.o | 121 | obj-$(CONFIG_JUMP_LABEL) += jump_label.o |
diff --git a/arch/sparc/kernel/jump_label.c b/arch/sparc/kernel/jump_label.c index 7f8eac51df33..a4cfaeecaf5e 100644 --- a/arch/sparc/kernel/jump_label.c +++ b/arch/sparc/kernel/jump_label.c | |||
| @@ -9,8 +9,6 @@ | |||
| 9 | 9 | ||
| 10 | #include <asm/cacheflush.h> | 10 | #include <asm/cacheflush.h> |
| 11 | 11 | ||
| 12 | #ifdef HAVE_JUMP_LABEL | ||
| 13 | |||
| 14 | void arch_jump_label_transform(struct jump_entry *entry, | 12 | void arch_jump_label_transform(struct jump_entry *entry, |
| 15 | enum jump_label_type type) | 13 | enum jump_label_type type) |
| 16 | { | 14 | { |
| @@ -47,5 +45,3 @@ void arch_jump_label_transform(struct jump_entry *entry, | |||
| 47 | flushi(insn); | 45 | flushi(insn); |
| 48 | mutex_unlock(&text_mutex); | 46 | mutex_unlock(&text_mutex); |
| 49 | } | 47 | } |
| 50 | |||
| 51 | #endif | ||
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 16c3145c0a5f..9c5a67d1b9c1 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
| @@ -289,7 +289,7 @@ vdso_install: | |||
| 289 | 289 | ||
| 290 | archprepare: checkbin | 290 | archprepare: checkbin |
| 291 | checkbin: | 291 | checkbin: |
| 292 | ifndef CC_HAVE_ASM_GOTO | 292 | ifndef CONFIG_CC_HAS_ASM_GOTO |
| 293 | @echo Compiler lacks asm-goto support. | 293 | @echo Compiler lacks asm-goto support. |
| 294 | @exit 1 | 294 | @exit 1 |
| 295 | endif | 295 | endif |
diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h index 20d0885b00fb..efb0d1b1f15f 100644 --- a/arch/x86/entry/calling.h +++ b/arch/x86/entry/calling.h | |||
| @@ -351,7 +351,7 @@ For 32-bit we have the following conventions - kernel is built with | |||
| 351 | */ | 351 | */ |
| 352 | .macro CALL_enter_from_user_mode | 352 | .macro CALL_enter_from_user_mode |
| 353 | #ifdef CONFIG_CONTEXT_TRACKING | 353 | #ifdef CONFIG_CONTEXT_TRACKING |
| 354 | #ifdef HAVE_JUMP_LABEL | 354 | #ifdef CONFIG_JUMP_LABEL |
| 355 | STATIC_JUMP_IF_FALSE .Lafter_call_\@, context_tracking_enabled, def=0 | 355 | STATIC_JUMP_IF_FALSE .Lafter_call_\@, context_tracking_enabled, def=0 |
| 356 | #endif | 356 | #endif |
| 357 | call enter_from_user_mode | 357 | call enter_from_user_mode |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index aced6c9290d6..ce95b8cbd229 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
| @@ -140,7 +140,7 @@ extern void clear_cpu_cap(struct cpuinfo_x86 *c, unsigned int bit); | |||
| 140 | 140 | ||
| 141 | #define setup_force_cpu_bug(bit) setup_force_cpu_cap(bit) | 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 | * Workaround for the sake of BPF compilation which utilizes kernel | 146 | * Workaround for the sake of BPF compilation which utilizes kernel |
diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h index 21efc9d07ed9..65191ce8e1cf 100644 --- a/arch/x86/include/asm/jump_label.h +++ b/arch/x86/include/asm/jump_label.h | |||
| @@ -2,19 +2,6 @@ | |||
| 2 | #ifndef _ASM_X86_JUMP_LABEL_H | 2 | #ifndef _ASM_X86_JUMP_LABEL_H |
| 3 | #define _ASM_X86_JUMP_LABEL_H | 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 | #define JUMP_LABEL_NOP_SIZE 5 | 5 | #define JUMP_LABEL_NOP_SIZE 5 |
| 19 | 6 | ||
| 20 | #ifdef CONFIG_X86_64 | 7 | #ifdef CONFIG_X86_64 |
diff --git a/arch/x86/include/asm/rmwcc.h b/arch/x86/include/asm/rmwcc.h index 46ac84b506f5..8a9eba191516 100644 --- a/arch/x86/include/asm/rmwcc.h +++ b/arch/x86/include/asm/rmwcc.h | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | 11 | ||
| 12 | #define __CLOBBERS_MEM(clb...) "memory", ## clb | 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 | /* Use asm goto */ | 16 | /* Use asm goto */ |
| 17 | 17 | ||
| @@ -27,7 +27,7 @@ cc_label: c = true; \ | |||
| 27 | c; \ | 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 | /* Use flags output or a set instruction */ | 32 | /* Use flags output or a set instruction */ |
| 33 | 33 | ||
| @@ -40,7 +40,7 @@ cc_label: c = true; \ | |||
| 40 | c; \ | 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 | #define GEN_UNARY_RMWcc_4(op, var, cc, arg0) \ | 45 | #define GEN_UNARY_RMWcc_4(op, var, cc, arg0) \ |
| 46 | __GEN_RMWcc(op " " arg0, var, cc, __CLOBBERS_MEM()) | 46 | __GEN_RMWcc(op " " arg0, var, cc, __CLOBBERS_MEM()) |
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index eb51b0e1189c..00b7e27bc2b7 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
| @@ -49,7 +49,8 @@ obj-$(CONFIG_COMPAT) += signal_compat.o | |||
| 49 | obj-y += traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o | 49 | obj-y += traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o |
| 50 | obj-y += time.o ioport.o dumpstack.o nmi.o | 50 | obj-y += time.o ioport.o dumpstack.o nmi.o |
| 51 | obj-$(CONFIG_MODIFY_LDT_SYSCALL) += ldt.o | 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 | obj-$(CONFIG_IRQ_WORK) += irq_work.o | 54 | obj-$(CONFIG_IRQ_WORK) += irq_work.o |
| 54 | obj-y += probe_roms.o | 55 | obj-y += probe_roms.o |
| 55 | obj-$(CONFIG_X86_64) += sys_x86_64.o | 56 | obj-$(CONFIG_X86_64) += sys_x86_64.o |
diff --git a/arch/x86/kernel/jump_label.c b/arch/x86/kernel/jump_label.c index aac0c1f7e354..f99bd26bd3f1 100644 --- a/arch/x86/kernel/jump_label.c +++ b/arch/x86/kernel/jump_label.c | |||
| @@ -16,8 +16,6 @@ | |||
| 16 | #include <asm/alternative.h> | 16 | #include <asm/alternative.h> |
| 17 | #include <asm/text-patching.h> | 17 | #include <asm/text-patching.h> |
| 18 | 18 | ||
| 19 | #ifdef HAVE_JUMP_LABEL | ||
| 20 | |||
| 21 | union jump_code_union { | 19 | union jump_code_union { |
| 22 | char code[JUMP_LABEL_NOP_SIZE]; | 20 | char code[JUMP_LABEL_NOP_SIZE]; |
| 23 | struct { | 21 | struct { |
| @@ -130,5 +128,3 @@ __init_or_module void arch_jump_label_transform_static(struct jump_entry *entry, | |||
| 130 | if (jlstate == JL_STATE_UPDATE) | 128 | if (jlstate == JL_STATE_UPDATE) |
| 131 | __jump_label_transform(entry, type, text_poke_early, 1); | 129 | __jump_label_transform(entry, type, text_poke_early, 1); |
| 132 | } | 130 | } |
| 133 | |||
| 134 | #endif | ||
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 78e430f4e15c..c338984c850d 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
| @@ -456,7 +456,7 @@ FOP_END; | |||
| 456 | 456 | ||
| 457 | /* | 457 | /* |
| 458 | * XXX: inoutclob user must know where the argument is being expanded. | 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 | #define asm_safe(insn, inoutclob...) \ | 461 | #define asm_safe(insn, inoutclob...) \ |
| 462 | ({ \ | 462 | ({ \ |
diff --git a/arch/xtensa/kernel/jump_label.c b/arch/xtensa/kernel/jump_label.c index d108f721c116..61cf6497a646 100644 --- a/arch/xtensa/kernel/jump_label.c +++ b/arch/xtensa/kernel/jump_label.c | |||
| @@ -10,8 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | #include <asm/cacheflush.h> | 11 | #include <asm/cacheflush.h> |
| 12 | 12 | ||
| 13 | #ifdef HAVE_JUMP_LABEL | ||
| 14 | |||
| 15 | #define J_OFFSET_MASK 0x0003ffff | 13 | #define J_OFFSET_MASK 0x0003ffff |
| 16 | #define J_SIGN_MASK (~(J_OFFSET_MASK >> 1)) | 14 | #define J_SIGN_MASK (~(J_OFFSET_MASK >> 1)) |
| 17 | 15 | ||
| @@ -95,5 +93,3 @@ void arch_jump_label_transform(struct jump_entry *e, | |||
| 95 | 93 | ||
| 96 | patch_text(jump_entry_code(e), &insn, JUMP_LABEL_NOP_SIZE); | 94 | patch_text(jump_entry_code(e), &insn, JUMP_LABEL_NOP_SIZE); |
| 97 | } | 95 | } |
| 98 | |||
| 99 | #endif /* HAVE_JUMP_LABEL */ | ||
