* [PATCH 1/3] jump_label: Allow asm/jump_label.h to be included in assembly
@ 2015-04-09 3:51 ` Anton Blanchard
0 siblings, 0 replies; 23+ messages in thread
From: Anton Blanchard @ 2015-04-09 3:51 UTC (permalink / raw)
To: benh, paulus, mpe, mmarek, akpm, jbaron, peterz, liuj97, mingo,
mgorman, linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, rostedt
Cc: linuxppc-dev, linux-kbuild, linux-kernel
Wrap asm/jump_label.h for all archs with #ifndef __ASSEMBLY__.
Since these are kernel only headers, we don't need #ifdef __KERNEL__
so can simplify things a bit.
If an architecture wants to use jump labels in assembly, it
will still need to define a macro to create the __jump_table
entries (see ARCH_STATIC_BRANCH in the powerpc asm/jump_label.h
for an example).
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/arm/include/asm/jump_label.h | 5 ++---
arch/arm64/include/asm/jump_label.h | 8 ++++----
arch/mips/include/asm/jump_label.h | 7 +++----
arch/s390/include/asm/jump_label.h | 3 +++
arch/sparc/include/asm/jump_label.h | 5 ++---
arch/x86/include/asm/jump_label.h | 5 ++---
6 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/arch/arm/include/asm/jump_label.h b/arch/arm/include/asm/jump_label.h
index 70f9b9b..5f337dc 100644
--- a/arch/arm/include/asm/jump_label.h
+++ b/arch/arm/include/asm/jump_label.h
@@ -1,7 +1,7 @@
#ifndef _ASM_ARM_JUMP_LABEL_H
#define _ASM_ARM_JUMP_LABEL_H
-#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
#include <linux/types.h>
@@ -27,8 +27,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
typedef u32 jump_label_t;
struct jump_entry {
@@ -37,4 +35,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
diff --git a/arch/arm64/include/asm/jump_label.h b/arch/arm64/include/asm/jump_label.h
index 076a1c7..c0e5165 100644
--- a/arch/arm64/include/asm/jump_label.h
+++ b/arch/arm64/include/asm/jump_label.h
@@ -18,11 +18,12 @@
*/
#ifndef __ASM_JUMP_LABEL_H
#define __ASM_JUMP_LABEL_H
+
+#ifndef __ASSEMBLY__
+
#include <linux/types.h>
#include <asm/insn.h>
-#ifdef __KERNEL__
-
#define JUMP_LABEL_NOP_SIZE AARCH64_INSN_SIZE
static __always_inline bool arch_static_branch(struct static_key *key)
@@ -39,8 +40,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
typedef u64 jump_label_t;
struct jump_entry {
@@ -49,4 +48,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif /* __ASM_JUMP_LABEL_H */
diff --git a/arch/mips/include/asm/jump_label.h b/arch/mips/include/asm/jump_label.h
index fdbff44..608aa57 100644
--- a/arch/mips/include/asm/jump_label.h
+++ b/arch/mips/include/asm/jump_label.h
@@ -8,9 +8,9 @@
#ifndef _ASM_MIPS_JUMP_LABEL_H
#define _ASM_MIPS_JUMP_LABEL_H
-#include <linux/types.h>
+#ifndef __ASSEMBLY__
-#ifdef __KERNEL__
+#include <linux/types.h>
#define JUMP_LABEL_NOP_SIZE 4
@@ -39,8 +39,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
#ifdef CONFIG_64BIT
typedef u64 jump_label_t;
#else
@@ -53,4 +51,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif /* _ASM_MIPS_JUMP_LABEL_H */
diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm/jump_label.h
index 58642fd..2b77e23 100644
--- a/arch/s390/include/asm/jump_label.h
+++ b/arch/s390/include/asm/jump_label.h
@@ -1,6 +1,8 @@
#ifndef _ASM_S390_JUMP_LABEL_H
#define _ASM_S390_JUMP_LABEL_H
+#ifndef __ASSEMBLY__
+
#include <linux/types.h>
#define JUMP_LABEL_NOP_SIZE 6
@@ -39,4 +41,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
diff --git a/arch/sparc/include/asm/jump_label.h b/arch/sparc/include/asm/jump_label.h
index ec2e2e2..cc9b04a 100644
--- a/arch/sparc/include/asm/jump_label.h
+++ b/arch/sparc/include/asm/jump_label.h
@@ -1,7 +1,7 @@
#ifndef _ASM_SPARC_JUMP_LABEL_H
#define _ASM_SPARC_JUMP_LABEL_H
-#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
#include <linux/types.h>
@@ -22,8 +22,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
typedef u32 jump_label_t;
struct jump_entry {
@@ -32,4 +30,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h
index 6a2cefb..a4c1cf7 100644
--- a/arch/x86/include/asm/jump_label.h
+++ b/arch/x86/include/asm/jump_label.h
@@ -1,7 +1,7 @@
#ifndef _ASM_X86_JUMP_LABEL_H
#define _ASM_X86_JUMP_LABEL_H
-#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
#include <linux/stringify.h>
#include <linux/types.h>
@@ -30,8 +30,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
#ifdef CONFIG_X86_64
typedef u64 jump_label_t;
#else
@@ -44,4 +42,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
--
2.1.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 1/3] jump_label: Allow asm/jump_label.h to be included in assembly
@ 2015-04-09 3:51 ` Anton Blanchard
0 siblings, 0 replies; 23+ messages in thread
From: Anton Blanchard @ 2015-04-09 3:51 UTC (permalink / raw)
To: benh, paulus, mpe, mmarek, akpm, jbaron, peterz, liuj97, mingo,
mgorman, linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, rostedt
Cc: linuxppc-dev, linux-kernel, linux-kbuild
Wrap asm/jump_label.h for all archs with #ifndef __ASSEMBLY__.
Since these are kernel only headers, we don't need #ifdef __KERNEL__
so can simplify things a bit.
If an architecture wants to use jump labels in assembly, it
will still need to define a macro to create the __jump_table
entries (see ARCH_STATIC_BRANCH in the powerpc asm/jump_label.h
for an example).
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/arm/include/asm/jump_label.h | 5 ++---
arch/arm64/include/asm/jump_label.h | 8 ++++----
arch/mips/include/asm/jump_label.h | 7 +++----
arch/s390/include/asm/jump_label.h | 3 +++
arch/sparc/include/asm/jump_label.h | 5 ++---
arch/x86/include/asm/jump_label.h | 5 ++---
6 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/arch/arm/include/asm/jump_label.h b/arch/arm/include/asm/jump_label.h
index 70f9b9b..5f337dc 100644
--- a/arch/arm/include/asm/jump_label.h
+++ b/arch/arm/include/asm/jump_label.h
@@ -1,7 +1,7 @@
#ifndef _ASM_ARM_JUMP_LABEL_H
#define _ASM_ARM_JUMP_LABEL_H
-#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
#include <linux/types.h>
@@ -27,8 +27,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
typedef u32 jump_label_t;
struct jump_entry {
@@ -37,4 +35,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
diff --git a/arch/arm64/include/asm/jump_label.h b/arch/arm64/include/asm/jump_label.h
index 076a1c7..c0e5165 100644
--- a/arch/arm64/include/asm/jump_label.h
+++ b/arch/arm64/include/asm/jump_label.h
@@ -18,11 +18,12 @@
*/
#ifndef __ASM_JUMP_LABEL_H
#define __ASM_JUMP_LABEL_H
+
+#ifndef __ASSEMBLY__
+
#include <linux/types.h>
#include <asm/insn.h>
-#ifdef __KERNEL__
-
#define JUMP_LABEL_NOP_SIZE AARCH64_INSN_SIZE
static __always_inline bool arch_static_branch(struct static_key *key)
@@ -39,8 +40,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
typedef u64 jump_label_t;
struct jump_entry {
@@ -49,4 +48,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif /* __ASM_JUMP_LABEL_H */
diff --git a/arch/mips/include/asm/jump_label.h b/arch/mips/include/asm/jump_label.h
index fdbff44..608aa57 100644
--- a/arch/mips/include/asm/jump_label.h
+++ b/arch/mips/include/asm/jump_label.h
@@ -8,9 +8,9 @@
#ifndef _ASM_MIPS_JUMP_LABEL_H
#define _ASM_MIPS_JUMP_LABEL_H
-#include <linux/types.h>
+#ifndef __ASSEMBLY__
-#ifdef __KERNEL__
+#include <linux/types.h>
#define JUMP_LABEL_NOP_SIZE 4
@@ -39,8 +39,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
#ifdef CONFIG_64BIT
typedef u64 jump_label_t;
#else
@@ -53,4 +51,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif /* _ASM_MIPS_JUMP_LABEL_H */
diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm/jump_label.h
index 58642fd..2b77e23 100644
--- a/arch/s390/include/asm/jump_label.h
+++ b/arch/s390/include/asm/jump_label.h
@@ -1,6 +1,8 @@
#ifndef _ASM_S390_JUMP_LABEL_H
#define _ASM_S390_JUMP_LABEL_H
+#ifndef __ASSEMBLY__
+
#include <linux/types.h>
#define JUMP_LABEL_NOP_SIZE 6
@@ -39,4 +41,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
diff --git a/arch/sparc/include/asm/jump_label.h b/arch/sparc/include/asm/jump_label.h
index ec2e2e2..cc9b04a 100644
--- a/arch/sparc/include/asm/jump_label.h
+++ b/arch/sparc/include/asm/jump_label.h
@@ -1,7 +1,7 @@
#ifndef _ASM_SPARC_JUMP_LABEL_H
#define _ASM_SPARC_JUMP_LABEL_H
-#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
#include <linux/types.h>
@@ -22,8 +22,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
typedef u32 jump_label_t;
struct jump_entry {
@@ -32,4 +30,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h
index 6a2cefb..a4c1cf7 100644
--- a/arch/x86/include/asm/jump_label.h
+++ b/arch/x86/include/asm/jump_label.h
@@ -1,7 +1,7 @@
#ifndef _ASM_X86_JUMP_LABEL_H
#define _ASM_X86_JUMP_LABEL_H
-#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
#include <linux/stringify.h>
#include <linux/types.h>
@@ -30,8 +30,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
#ifdef CONFIG_X86_64
typedef u64 jump_label_t;
#else
@@ -44,4 +42,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
--
2.1.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 2/3] jump_label: Allow jump labels to be used in assembly
2015-04-09 3:51 ` Anton Blanchard
@ 2015-04-09 3:51 ` Anton Blanchard
-1 siblings, 0 replies; 23+ messages in thread
From: Anton Blanchard @ 2015-04-09 3:51 UTC (permalink / raw)
To: benh, paulus, mpe, mmarek, akpm, jbaron, peterz, liuj97, mingo,
mgorman, linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, rostedt
Cc: linuxppc-dev, linux-kbuild, linux-kernel
To use jump labels in assembly we need the HAVE_JUMP_LABEL define,
so we select a fallback version if the toolchain does not support
them.
Modify linux/jump_label.h so it can be included by assembly files.
We also need to add -DCC_HAVE_ASM_GOTO to KBUILD_AFLAGS.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Makefile | 1 +
include/linux/jump_label.h | 21 +++++++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index e734965..3624215 100644
--- a/Makefile
+++ b/Makefile
@@ -779,6 +779,7 @@ KBUILD_ARFLAGS := $(call ar-option,D)
# check for 'asm goto'
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y)
KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
+ KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
endif
include $(srctree)/scripts/Makefile.kasan
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 98f923b6..f4de473 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -45,6 +45,12 @@
* same as using STATIC_KEY_INIT_FALSE.
*/
+#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
+# define HAVE_JUMP_LABEL
+#endif
+
+#ifndef __ASSEMBLY__
+
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/bug.h>
@@ -55,7 +61,7 @@ extern bool static_key_initialized;
"%s used before call to jump_label_init", \
__func__)
-#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
+#ifdef HAVE_JUMP_LABEL
struct static_key {
atomic_t enabled;
@@ -66,13 +72,18 @@ struct static_key {
#endif
};
-# include <asm/jump_label.h>
-# define HAVE_JUMP_LABEL
#else
struct static_key {
atomic_t enabled;
};
-#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */
+#endif /* HAVE_JUMP_LABEL */
+#endif /* __ASSEMBLY__ */
+
+#ifdef HAVE_JUMP_LABEL
+#include <asm/jump_label.h>
+#endif
+
+#ifndef __ASSEMBLY__
enum jump_label_type {
JUMP_LABEL_DISABLE = 0,
@@ -203,3 +214,5 @@ static inline bool static_key_enabled(struct static_key *key)
}
#endif /* _LINUX_JUMP_LABEL_H */
+
+#endif /* __ASSEMBLY__ */
--
2.1.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 2/3] jump_label: Allow jump labels to be used in assembly
@ 2015-04-09 3:51 ` Anton Blanchard
0 siblings, 0 replies; 23+ messages in thread
From: Anton Blanchard @ 2015-04-09 3:51 UTC (permalink / raw)
To: benh, paulus, mpe, mmarek, akpm, jbaron, peterz, liuj97, mingo,
mgorman, linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, rostedt
Cc: linuxppc-dev, linux-kernel, linux-kbuild
To use jump labels in assembly we need the HAVE_JUMP_LABEL define,
so we select a fallback version if the toolchain does not support
them.
Modify linux/jump_label.h so it can be included by assembly files.
We also need to add -DCC_HAVE_ASM_GOTO to KBUILD_AFLAGS.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Makefile | 1 +
include/linux/jump_label.h | 21 +++++++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index e734965..3624215 100644
--- a/Makefile
+++ b/Makefile
@@ -779,6 +779,7 @@ KBUILD_ARFLAGS := $(call ar-option,D)
# check for 'asm goto'
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y)
KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
+ KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
endif
include $(srctree)/scripts/Makefile.kasan
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 98f923b6..f4de473 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -45,6 +45,12 @@
* same as using STATIC_KEY_INIT_FALSE.
*/
+#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
+# define HAVE_JUMP_LABEL
+#endif
+
+#ifndef __ASSEMBLY__
+
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/bug.h>
@@ -55,7 +61,7 @@ extern bool static_key_initialized;
"%s used before call to jump_label_init", \
__func__)
-#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
+#ifdef HAVE_JUMP_LABEL
struct static_key {
atomic_t enabled;
@@ -66,13 +72,18 @@ struct static_key {
#endif
};
-# include <asm/jump_label.h>
-# define HAVE_JUMP_LABEL
#else
struct static_key {
atomic_t enabled;
};
-#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */
+#endif /* HAVE_JUMP_LABEL */
+#endif /* __ASSEMBLY__ */
+
+#ifdef HAVE_JUMP_LABEL
+#include <asm/jump_label.h>
+#endif
+
+#ifndef __ASSEMBLY__
enum jump_label_type {
JUMP_LABEL_DISABLE = 0,
@@ -203,3 +214,5 @@ static inline bool static_key_enabled(struct static_key *key)
}
#endif /* _LINUX_JUMP_LABEL_H */
+
+#endif /* __ASSEMBLY__ */
--
2.1.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 3/3] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define
2015-04-09 3:51 ` Anton Blanchard
@ 2015-04-09 3:51 ` Anton Blanchard
-1 siblings, 0 replies; 23+ messages in thread
From: Anton Blanchard @ 2015-04-09 3:51 UTC (permalink / raw)
To: benh, paulus, mpe, mmarek, akpm, jbaron, peterz, liuj97, mingo,
mgorman, linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, rostedt
Cc: linuxppc-dev, linux-kbuild, linux-kernel
Commit 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
converted uses of CONFIG_JUMP_LABEL to HAVE_JUMP_LABEL in
some assembly files.
HAVE_JUMP_LABEL is defined in linux/jump_label.h, so we need to
include this or we always get the non jump label fallback code.
Fixes: 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/platforms/powernv/opal-wrappers.S | 2 +-
arch/powerpc/platforms/pseries/hvCall.S | 2 +-
arch/powerpc/platforms/pseries/lpar.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S
index b23fe7c..4c4fe6f 100644
--- a/arch/powerpc/platforms/powernv/opal-wrappers.S
+++ b/arch/powerpc/platforms/powernv/opal-wrappers.S
@@ -9,11 +9,11 @@
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/jump_label.h>
#include <asm/ppc_asm.h>
#include <asm/hvcall.h>
#include <asm/asm-offsets.h>
#include <asm/opal.h>
-#include <asm/jump_label.h>
.section ".text"
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index ccd53f9..74b5b8e 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -7,12 +7,12 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/jump_label.h>
#include <asm/hvcall.h>
#include <asm/processor.h>
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
#include <asm/ptrace.h>
-#include <asm/jump_label.h>
.section ".text"
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index b5682fd..b7a67e3 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -26,7 +26,7 @@
#include <linux/dma-mapping.h>
#include <linux/console.h>
#include <linux/export.h>
-#include <linux/static_key.h>
+#include <linux/jump_label.h>
#include <asm/processor.h>
#include <asm/mmu.h>
#include <asm/page.h>
--
2.1.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH 3/3] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define
@ 2015-04-09 3:51 ` Anton Blanchard
0 siblings, 0 replies; 23+ messages in thread
From: Anton Blanchard @ 2015-04-09 3:51 UTC (permalink / raw)
To: benh, paulus, mpe, mmarek, akpm, jbaron, peterz, liuj97, mingo,
mgorman, linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, rostedt
Cc: linuxppc-dev, linux-kernel, linux-kbuild
Commit 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
converted uses of CONFIG_JUMP_LABEL to HAVE_JUMP_LABEL in
some assembly files.
HAVE_JUMP_LABEL is defined in linux/jump_label.h, so we need to
include this or we always get the non jump label fallback code.
Fixes: 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/platforms/powernv/opal-wrappers.S | 2 +-
arch/powerpc/platforms/pseries/hvCall.S | 2 +-
arch/powerpc/platforms/pseries/lpar.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S
index b23fe7c..4c4fe6f 100644
--- a/arch/powerpc/platforms/powernv/opal-wrappers.S
+++ b/arch/powerpc/platforms/powernv/opal-wrappers.S
@@ -9,11 +9,11 @@
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/jump_label.h>
#include <asm/ppc_asm.h>
#include <asm/hvcall.h>
#include <asm/asm-offsets.h>
#include <asm/opal.h>
-#include <asm/jump_label.h>
.section ".text"
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index ccd53f9..74b5b8e 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -7,12 +7,12 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/jump_label.h>
#include <asm/hvcall.h>
#include <asm/processor.h>
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
#include <asm/ptrace.h>
-#include <asm/jump_label.h>
.section ".text"
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index b5682fd..b7a67e3 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -26,7 +26,7 @@
#include <linux/dma-mapping.h>
#include <linux/console.h>
#include <linux/export.h>
-#include <linux/static_key.h>
+#include <linux/jump_label.h>
#include <asm/processor.h>
#include <asm/mmu.h>
#include <asm/page.h>
--
2.1.0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 1/3] jump_label: Allow asm/jump_label.h to be included in assembly
2015-04-09 3:51 ` Anton Blanchard
@ 2015-04-09 7:08 ` Peter Zijlstra
-1 siblings, 0 replies; 23+ messages in thread
From: Peter Zijlstra @ 2015-04-09 7:08 UTC (permalink / raw)
To: Anton Blanchard
Cc: benh, paulus, mpe, mmarek, akpm, jbaron, liuj97, mingo, mgorman,
linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, rostedt, linuxppc-dev,
linux-kbuild, linux-kernel
On Thu, Apr 09, 2015 at 01:51:30PM +1000, Anton Blanchard wrote:
> Wrap asm/jump_label.h for all archs with #ifndef __ASSEMBLY__.
> Since these are kernel only headers, we don't need #ifdef __KERNEL__
> so can simplify things a bit.
>
> If an architecture wants to use jump labels in assembly, it
> will still need to define a macro to create the __jump_table
> entries (see ARCH_STATIC_BRANCH in the powerpc asm/jump_label.h
> for an example).
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 1/3] jump_label: Allow asm/jump_label.h to be included in assembly
@ 2015-04-09 7:08 ` Peter Zijlstra
0 siblings, 0 replies; 23+ messages in thread
From: Peter Zijlstra @ 2015-04-09 7:08 UTC (permalink / raw)
To: Anton Blanchard
Cc: heiko.carstens, paulus, hpa, mingo, linux, mingo, mgorman,
catalin.marinas, liuj97, linux-kbuild, will.deacon, rostedt,
jbaron, tglx, mmarek, linux-kernel, ralf, schwidefsky, akpm,
linuxppc-dev, davem
On Thu, Apr 09, 2015 at 01:51:30PM +1000, Anton Blanchard wrote:
> Wrap asm/jump_label.h for all archs with #ifndef __ASSEMBLY__.
> Since these are kernel only headers, we don't need #ifdef __KERNEL__
> so can simplify things a bit.
>
> If an architecture wants to use jump labels in assembly, it
> will still need to define a macro to create the __jump_table
> entries (see ARCH_STATIC_BRANCH in the powerpc asm/jump_label.h
> for an example).
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 2/3] jump_label: Allow jump labels to be used in assembly
2015-04-09 3:51 ` Anton Blanchard
@ 2015-04-09 7:08 ` Peter Zijlstra
-1 siblings, 0 replies; 23+ messages in thread
From: Peter Zijlstra @ 2015-04-09 7:08 UTC (permalink / raw)
To: Anton Blanchard
Cc: benh, paulus, mpe, mmarek, akpm, jbaron, liuj97, mingo, mgorman,
linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, rostedt, linuxppc-dev,
linux-kbuild, linux-kernel
On Thu, Apr 09, 2015 at 01:51:31PM +1000, Anton Blanchard wrote:
> To use jump labels in assembly we need the HAVE_JUMP_LABEL define,
> so we select a fallback version if the toolchain does not support
> them.
>
> Modify linux/jump_label.h so it can be included by assembly files.
> We also need to add -DCC_HAVE_ASM_GOTO to KBUILD_AFLAGS.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 2/3] jump_label: Allow jump labels to be used in assembly
@ 2015-04-09 7:08 ` Peter Zijlstra
0 siblings, 0 replies; 23+ messages in thread
From: Peter Zijlstra @ 2015-04-09 7:08 UTC (permalink / raw)
To: Anton Blanchard
Cc: heiko.carstens, paulus, hpa, mingo, linux, mingo, mgorman,
catalin.marinas, liuj97, linux-kbuild, will.deacon, rostedt,
jbaron, tglx, mmarek, linux-kernel, ralf, schwidefsky, akpm,
linuxppc-dev, davem
On Thu, Apr 09, 2015 at 01:51:31PM +1000, Anton Blanchard wrote:
> To use jump labels in assembly we need the HAVE_JUMP_LABEL define,
> so we select a fallback version if the toolchain does not support
> them.
>
> Modify linux/jump_label.h so it can be included by assembly files.
> We also need to add -DCC_HAVE_ASM_GOTO to KBUILD_AFLAGS.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define
2015-04-09 3:51 ` Anton Blanchard
@ 2015-04-09 7:08 ` Peter Zijlstra
-1 siblings, 0 replies; 23+ messages in thread
From: Peter Zijlstra @ 2015-04-09 7:08 UTC (permalink / raw)
To: Anton Blanchard
Cc: benh, paulus, mpe, mmarek, akpm, jbaron, liuj97, mingo, mgorman,
linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, rostedt, linuxppc-dev,
linux-kbuild, linux-kernel
On Thu, Apr 09, 2015 at 01:51:32PM +1000, Anton Blanchard wrote:
> Commit 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> converted uses of CONFIG_JUMP_LABEL to HAVE_JUMP_LABEL in
> some assembly files.
>
> HAVE_JUMP_LABEL is defined in linux/jump_label.h, so we need to
> include this or we always get the non jump label fallback code.
>
> Fixes: 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define
@ 2015-04-09 7:08 ` Peter Zijlstra
0 siblings, 0 replies; 23+ messages in thread
From: Peter Zijlstra @ 2015-04-09 7:08 UTC (permalink / raw)
To: Anton Blanchard
Cc: heiko.carstens, paulus, hpa, mingo, linux, mingo, mgorman,
catalin.marinas, liuj97, linux-kbuild, will.deacon, rostedt,
jbaron, tglx, mmarek, linux-kernel, ralf, schwidefsky, akpm,
linuxppc-dev, davem
On Thu, Apr 09, 2015 at 01:51:32PM +1000, Anton Blanchard wrote:
> Commit 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> converted uses of CONFIG_JUMP_LABEL to HAVE_JUMP_LABEL in
> some assembly files.
>
> HAVE_JUMP_LABEL is defined in linux/jump_label.h, so we need to
> include this or we always get the non jump label fallback code.
>
> Fixes: 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define
2015-04-09 3:51 ` Anton Blanchard
@ 2015-04-09 7:33 ` Michael Ellerman
-1 siblings, 0 replies; 23+ messages in thread
From: Michael Ellerman @ 2015-04-09 7:33 UTC (permalink / raw)
To: Anton Blanchard
Cc: benh, paulus, mmarek, akpm, jbaron, peterz, liuj97, mingo,
mgorman, linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, rostedt, linuxppc-dev,
linux-kbuild, linux-kernel
On Thu, 2015-04-09 at 13:51 +1000, Anton Blanchard wrote:
> Commit 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> converted uses of CONFIG_JUMP_LABEL to HAVE_JUMP_LABEL in
> some assembly files.
>
> HAVE_JUMP_LABEL is defined in linux/jump_label.h, so we need to
> include this or we always get the non jump label fallback code.
>
> Fixes: 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> arch/powerpc/platforms/powernv/opal-wrappers.S | 2 +-
> arch/powerpc/platforms/pseries/hvCall.S | 2 +-
> arch/powerpc/platforms/pseries/lpar.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
I assume it's best for Andrew to take this series with all the cross-archness?
cheers
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define
@ 2015-04-09 7:33 ` Michael Ellerman
0 siblings, 0 replies; 23+ messages in thread
From: Michael Ellerman @ 2015-04-09 7:33 UTC (permalink / raw)
To: Anton Blanchard
Cc: peterz, heiko.carstens, paulus, hpa, mingo, linux, mingo,
mgorman, catalin.marinas, liuj97, linux-kbuild, will.deacon,
rostedt, jbaron, tglx, mmarek, linux-kernel, ralf, schwidefsky,
akpm, linuxppc-dev, davem
On Thu, 2015-04-09 at 13:51 +1000, Anton Blanchard wrote:
> Commit 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> converted uses of CONFIG_JUMP_LABEL to HAVE_JUMP_LABEL in
> some assembly files.
>
> HAVE_JUMP_LABEL is defined in linux/jump_label.h, so we need to
> include this or we always get the non jump label fallback code.
>
> Fixes: 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> arch/powerpc/platforms/powernv/opal-wrappers.S | 2 +-
> arch/powerpc/platforms/pseries/hvCall.S | 2 +-
> arch/powerpc/platforms/pseries/lpar.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
I assume it's best for Andrew to take this series with all the cross-archness?
cheers
^ permalink raw reply [flat|nested] 23+ messages in thread
* [tip:locking/core] jump_label: Allow asm/ jump_label.h to be included in assembly
2015-04-09 3:51 ` Anton Blanchard
` (3 preceding siblings ...)
(?)
@ 2015-04-09 9:00 ` tip-bot for Anton Blanchard
-1 siblings, 0 replies; 23+ messages in thread
From: tip-bot for Anton Blanchard @ 2015-04-09 9:00 UTC (permalink / raw)
To: linux-tip-commits
Cc: peterz, anton, mingo, paulmck, tglx, linux-kernel, akpm, torvalds, hpa
Commit-ID: 55dd0df781e58ec23d218376ea4a676e7362a98c
Gitweb: http://git.kernel.org/tip/55dd0df781e58ec23d218376ea4a676e7362a98c
Author: Anton Blanchard <anton@samba.org>
AuthorDate: Thu, 9 Apr 2015 13:51:30 +1000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 9 Apr 2015 09:40:23 +0200
jump_label: Allow asm/jump_label.h to be included in assembly
Wrap asm/jump_label.h for all archs with #ifndef __ASSEMBLY__.
Since these are kernel only headers, we don't need #ifdef
__KERNEL__ so can simplify things a bit.
If an architecture wants to use jump labels in assembly, it
will still need to define a macro to create the __jump_table
entries (see ARCH_STATIC_BRANCH in the powerpc asm/jump_label.h
for an example).
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: benh@kernel.crashing.org
Cc: catalin.marinas@arm.com
Cc: davem@davemloft.net
Cc: heiko.carstens@de.ibm.com
Cc: jbaron@akamai.com
Cc: linux@arm.linux.org.uk
Cc: linuxppc-dev@lists.ozlabs.org
Cc: liuj97@gmail.com
Cc: mgorman@suse.de
Cc: mmarek@suse.cz
Cc: mpe@ellerman.id.au
Cc: paulus@samba.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: schwidefsky@de.ibm.com
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/1428551492-21977-1-git-send-email-anton@samba.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/arm/include/asm/jump_label.h | 5 ++---
arch/arm64/include/asm/jump_label.h | 8 ++++----
arch/mips/include/asm/jump_label.h | 7 +++----
arch/s390/include/asm/jump_label.h | 3 +++
arch/sparc/include/asm/jump_label.h | 5 ++---
arch/x86/include/asm/jump_label.h | 5 ++---
6 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/arch/arm/include/asm/jump_label.h b/arch/arm/include/asm/jump_label.h
index 70f9b9b..5f337dc 100644
--- a/arch/arm/include/asm/jump_label.h
+++ b/arch/arm/include/asm/jump_label.h
@@ -1,7 +1,7 @@
#ifndef _ASM_ARM_JUMP_LABEL_H
#define _ASM_ARM_JUMP_LABEL_H
-#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
#include <linux/types.h>
@@ -27,8 +27,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
typedef u32 jump_label_t;
struct jump_entry {
@@ -37,4 +35,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
diff --git a/arch/arm64/include/asm/jump_label.h b/arch/arm64/include/asm/jump_label.h
index 076a1c7..c0e5165 100644
--- a/arch/arm64/include/asm/jump_label.h
+++ b/arch/arm64/include/asm/jump_label.h
@@ -18,11 +18,12 @@
*/
#ifndef __ASM_JUMP_LABEL_H
#define __ASM_JUMP_LABEL_H
+
+#ifndef __ASSEMBLY__
+
#include <linux/types.h>
#include <asm/insn.h>
-#ifdef __KERNEL__
-
#define JUMP_LABEL_NOP_SIZE AARCH64_INSN_SIZE
static __always_inline bool arch_static_branch(struct static_key *key)
@@ -39,8 +40,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
typedef u64 jump_label_t;
struct jump_entry {
@@ -49,4 +48,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif /* __ASM_JUMP_LABEL_H */
diff --git a/arch/mips/include/asm/jump_label.h b/arch/mips/include/asm/jump_label.h
index fdbff44..608aa57 100644
--- a/arch/mips/include/asm/jump_label.h
+++ b/arch/mips/include/asm/jump_label.h
@@ -8,9 +8,9 @@
#ifndef _ASM_MIPS_JUMP_LABEL_H
#define _ASM_MIPS_JUMP_LABEL_H
-#include <linux/types.h>
+#ifndef __ASSEMBLY__
-#ifdef __KERNEL__
+#include <linux/types.h>
#define JUMP_LABEL_NOP_SIZE 4
@@ -39,8 +39,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
#ifdef CONFIG_64BIT
typedef u64 jump_label_t;
#else
@@ -53,4 +51,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif /* _ASM_MIPS_JUMP_LABEL_H */
diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm/jump_label.h
index 58642fd..2b77e23 100644
--- a/arch/s390/include/asm/jump_label.h
+++ b/arch/s390/include/asm/jump_label.h
@@ -1,6 +1,8 @@
#ifndef _ASM_S390_JUMP_LABEL_H
#define _ASM_S390_JUMP_LABEL_H
+#ifndef __ASSEMBLY__
+
#include <linux/types.h>
#define JUMP_LABEL_NOP_SIZE 6
@@ -39,4 +41,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
diff --git a/arch/sparc/include/asm/jump_label.h b/arch/sparc/include/asm/jump_label.h
index ec2e2e2..cc9b04a 100644
--- a/arch/sparc/include/asm/jump_label.h
+++ b/arch/sparc/include/asm/jump_label.h
@@ -1,7 +1,7 @@
#ifndef _ASM_SPARC_JUMP_LABEL_H
#define _ASM_SPARC_JUMP_LABEL_H
-#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
#include <linux/types.h>
@@ -22,8 +22,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
typedef u32 jump_label_t;
struct jump_entry {
@@ -32,4 +30,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h
index 6a2cefb..a4c1cf7 100644
--- a/arch/x86/include/asm/jump_label.h
+++ b/arch/x86/include/asm/jump_label.h
@@ -1,7 +1,7 @@
#ifndef _ASM_X86_JUMP_LABEL_H
#define _ASM_X86_JUMP_LABEL_H
-#ifdef __KERNEL__
+#ifndef __ASSEMBLY__
#include <linux/stringify.h>
#include <linux/types.h>
@@ -30,8 +30,6 @@ l_yes:
return true;
}
-#endif /* __KERNEL__ */
-
#ifdef CONFIG_X86_64
typedef u64 jump_label_t;
#else
@@ -44,4 +42,5 @@ struct jump_entry {
jump_label_t key;
};
+#endif /* __ASSEMBLY__ */
#endif
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [tip:locking/core] jump_label: Allow jump labels to be used in assembly
2015-04-09 3:51 ` Anton Blanchard
(?)
(?)
@ 2015-04-09 9:01 ` tip-bot for Anton Blanchard
-1 siblings, 0 replies; 23+ messages in thread
From: tip-bot for Anton Blanchard @ 2015-04-09 9:01 UTC (permalink / raw)
To: linux-tip-commits
Cc: tglx, hpa, paulmck, linux-kernel, akpm, torvalds, mingo, peterz, anton
Commit-ID: c0ccf6f99e3a43b87980c9df7da48427885206d0
Gitweb: http://git.kernel.org/tip/c0ccf6f99e3a43b87980c9df7da48427885206d0
Author: Anton Blanchard <anton@samba.org>
AuthorDate: Thu, 9 Apr 2015 13:51:31 +1000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 9 Apr 2015 09:40:24 +0200
jump_label: Allow jump labels to be used in assembly
To use jump labels in assembly we need the HAVE_JUMP_LABEL
define, so we select a fallback version if the toolchain does
not support them.
Modify linux/jump_label.h so it can be included by assembly
files. We also need to add -DCC_HAVE_ASM_GOTO to KBUILD_AFLAGS.
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: benh@kernel.crashing.org
Cc: catalin.marinas@arm.com
Cc: davem@davemloft.net
Cc: heiko.carstens@de.ibm.com
Cc: jbaron@akamai.com
Cc: linux@arm.linux.org.uk
Cc: linuxppc-dev@lists.ozlabs.org
Cc: liuj97@gmail.com
Cc: mgorman@suse.de
Cc: mmarek@suse.cz
Cc: mpe@ellerman.id.au
Cc: paulus@samba.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: schwidefsky@de.ibm.com
Cc: will.deacon@arm.com
Link: http://lkml.kernel.org/r/1428551492-21977-2-git-send-email-anton@samba.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
Makefile | 1 +
include/linux/jump_label.h | 21 +++++++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 9fab639..a2aa475 100644
--- a/Makefile
+++ b/Makefile
@@ -779,6 +779,7 @@ KBUILD_ARFLAGS := $(call ar-option,D)
# check for 'asm goto'
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y)
KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
+ KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
endif
include $(srctree)/scripts/Makefile.kasan
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 98f923b6..f4de473 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -45,6 +45,12 @@
* same as using STATIC_KEY_INIT_FALSE.
*/
+#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
+# define HAVE_JUMP_LABEL
+#endif
+
+#ifndef __ASSEMBLY__
+
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/bug.h>
@@ -55,7 +61,7 @@ extern bool static_key_initialized;
"%s used before call to jump_label_init", \
__func__)
-#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
+#ifdef HAVE_JUMP_LABEL
struct static_key {
atomic_t enabled;
@@ -66,13 +72,18 @@ struct static_key {
#endif
};
-# include <asm/jump_label.h>
-# define HAVE_JUMP_LABEL
#else
struct static_key {
atomic_t enabled;
};
-#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */
+#endif /* HAVE_JUMP_LABEL */
+#endif /* __ASSEMBLY__ */
+
+#ifdef HAVE_JUMP_LABEL
+#include <asm/jump_label.h>
+#endif
+
+#ifndef __ASSEMBLY__
enum jump_label_type {
JUMP_LABEL_DISABLE = 0,
@@ -203,3 +214,5 @@ static inline bool static_key_enabled(struct static_key *key)
}
#endif /* _LINUX_JUMP_LABEL_H */
+
+#endif /* __ASSEMBLY__ */
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [tip:locking/core] powerpc, jump_label: Include linux/ jump_label.h to get HAVE_JUMP_LABEL define
2015-04-09 3:51 ` Anton Blanchard
` (2 preceding siblings ...)
(?)
@ 2015-04-09 9:01 ` tip-bot for Anton Blanchard
-1 siblings, 0 replies; 23+ messages in thread
From: tip-bot for Anton Blanchard @ 2015-04-09 9:01 UTC (permalink / raw)
To: linux-tip-commits
Cc: torvalds, anton, tglx, paulmck, peterz, mpe, mingo, hpa,
linux-kernel, akpm
Commit-ID: 58995a9a5b292458f94a2356b8c878230fa56fe0
Gitweb: http://git.kernel.org/tip/58995a9a5b292458f94a2356b8c878230fa56fe0
Author: Anton Blanchard <anton@samba.org>
AuthorDate: Thu, 9 Apr 2015 13:51:32 +1000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 9 Apr 2015 09:40:29 +0200
powerpc, jump_label: Include linux/jump_label.h to get HAVE_JUMP_LABEL define
Commit 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
converted uses of CONFIG_JUMP_LABEL to HAVE_JUMP_LABEL in
some assembly files.
HAVE_JUMP_LABEL is defined in linux/jump_label.h, so we need to
include this or we always get the non jump label fallback code.
Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: benh@kernel.crashing.org
Cc: catalin.marinas@arm.com
Cc: davem@davemloft.net
Cc: heiko.carstens@de.ibm.com
Cc: jbaron@akamai.com
Cc: linux@arm.linux.org.uk
Cc: linuxppc-dev@lists.ozlabs.org
Cc: liuj97@gmail.com
Cc: mgorman@suse.de
Cc: mmarek@suse.cz
Cc: paulus@samba.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: schwidefsky@de.ibm.com
Cc: will.deacon@arm.com
Fixes: 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
Link: http://lkml.kernel.org/r/1428551492-21977-3-git-send-email-anton@samba.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/powerpc/platforms/powernv/opal-wrappers.S | 2 +-
arch/powerpc/platforms/pseries/hvCall.S | 2 +-
arch/powerpc/platforms/pseries/lpar.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S
index 0509bca..fcbe899 100644
--- a/arch/powerpc/platforms/powernv/opal-wrappers.S
+++ b/arch/powerpc/platforms/powernv/opal-wrappers.S
@@ -9,11 +9,11 @@
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/jump_label.h>
#include <asm/ppc_asm.h>
#include <asm/hvcall.h>
#include <asm/asm-offsets.h>
#include <asm/opal.h>
-#include <asm/jump_label.h>
.section ".text"
diff --git a/arch/powerpc/platforms/pseries/hvCall.S b/arch/powerpc/platforms/pseries/hvCall.S
index ccd53f9..74b5b8e 100644
--- a/arch/powerpc/platforms/pseries/hvCall.S
+++ b/arch/powerpc/platforms/pseries/hvCall.S
@@ -7,12 +7,12 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#include <linux/jump_label.h>
#include <asm/hvcall.h>
#include <asm/processor.h>
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
#include <asm/ptrace.h>
-#include <asm/jump_label.h>
.section ".text"
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index b5682fd..b7a67e3 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -26,7 +26,7 @@
#include <linux/dma-mapping.h>
#include <linux/console.h>
#include <linux/export.h>
-#include <linux/static_key.h>
+#include <linux/jump_label.h>
#include <asm/processor.h>
#include <asm/mmu.h>
#include <asm/page.h>
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH 1/3] jump_label: Allow asm/jump_label.h to be included in assembly
2015-04-09 3:51 ` Anton Blanchard
@ 2015-04-09 14:00 ` Steven Rostedt
-1 siblings, 0 replies; 23+ messages in thread
From: Steven Rostedt @ 2015-04-09 14:00 UTC (permalink / raw)
To: Anton Blanchard
Cc: benh, paulus, mpe, mmarek, akpm, jbaron, peterz, liuj97, mingo,
mgorman, linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, linuxppc-dev,
linux-kbuild, linux-kernel
On Thu, 9 Apr 2015 13:51:30 +1000
Anton Blanchard <anton@samba.org> wrote:
> Wrap asm/jump_label.h for all archs with #ifndef __ASSEMBLY__.
> Since these are kernel only headers, we don't need #ifdef __KERNEL__
> so can simplify things a bit.
>
> If an architecture wants to use jump labels in assembly, it
> will still need to define a macro to create the __jump_table
> entries (see ARCH_STATIC_BRANCH in the powerpc asm/jump_label.h
> for an example).
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> arch/arm/include/asm/jump_label.h | 5 ++---
> arch/arm64/include/asm/jump_label.h | 8 ++++----
> arch/mips/include/asm/jump_label.h | 7 +++----
> arch/s390/include/asm/jump_label.h | 3 +++
> arch/sparc/include/asm/jump_label.h | 5 ++---
> arch/x86/include/asm/jump_label.h | 5 ++---
> 6 files changed, 16 insertions(+), 17 deletions(-)
>
> diff --git a/arch/arm/include/asm/jump_label.h b/arch/arm/include/asm/jump_label.h
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 1/3] jump_label: Allow asm/jump_label.h to be included in assembly
@ 2015-04-09 14:00 ` Steven Rostedt
0 siblings, 0 replies; 23+ messages in thread
From: Steven Rostedt @ 2015-04-09 14:00 UTC (permalink / raw)
To: Anton Blanchard
Cc: peterz, heiko.carstens, paulus, hpa, mingo, linux, mingo,
mgorman, catalin.marinas, liuj97, linux-kbuild, will.deacon,
jbaron, tglx, mmarek, linux-kernel, ralf, schwidefsky, akpm,
linuxppc-dev, davem
On Thu, 9 Apr 2015 13:51:30 +1000
Anton Blanchard <anton@samba.org> wrote:
> Wrap asm/jump_label.h for all archs with #ifndef __ASSEMBLY__.
> Since these are kernel only headers, we don't need #ifdef __KERNEL__
> so can simplify things a bit.
>
> If an architecture wants to use jump labels in assembly, it
> will still need to define a macro to create the __jump_table
> entries (see ARCH_STATIC_BRANCH in the powerpc asm/jump_label.h
> for an example).
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> arch/arm/include/asm/jump_label.h | 5 ++---
> arch/arm64/include/asm/jump_label.h | 8 ++++----
> arch/mips/include/asm/jump_label.h | 7 +++----
> arch/s390/include/asm/jump_label.h | 3 +++
> arch/sparc/include/asm/jump_label.h | 5 ++---
> arch/x86/include/asm/jump_label.h | 5 ++---
> 6 files changed, 16 insertions(+), 17 deletions(-)
>
> diff --git a/arch/arm/include/asm/jump_label.h b/arch/arm/include/asm/jump_label.h
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 2/3] jump_label: Allow jump labels to be used in assembly
2015-04-09 3:51 ` Anton Blanchard
@ 2015-04-09 14:03 ` Steven Rostedt
-1 siblings, 0 replies; 23+ messages in thread
From: Steven Rostedt @ 2015-04-09 14:03 UTC (permalink / raw)
To: Anton Blanchard
Cc: benh, paulus, mpe, mmarek, akpm, jbaron, peterz, liuj97, mingo,
mgorman, linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, linuxppc-dev,
linux-kbuild, linux-kernel
On Thu, 9 Apr 2015 13:51:31 +1000
Anton Blanchard <anton@samba.org> wrote:
> To use jump labels in assembly we need the HAVE_JUMP_LABEL define,
> so we select a fallback version if the toolchain does not support
> them.
>
> Modify linux/jump_label.h so it can be included by assembly files.
> We also need to add -DCC_HAVE_ASM_GOTO to KBUILD_AFLAGS.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 2/3] jump_label: Allow jump labels to be used in assembly
@ 2015-04-09 14:03 ` Steven Rostedt
0 siblings, 0 replies; 23+ messages in thread
From: Steven Rostedt @ 2015-04-09 14:03 UTC (permalink / raw)
To: Anton Blanchard
Cc: peterz, heiko.carstens, paulus, hpa, mingo, linux, mingo,
mgorman, catalin.marinas, liuj97, linux-kbuild, will.deacon,
jbaron, tglx, mmarek, linux-kernel, ralf, schwidefsky, akpm,
linuxppc-dev, davem
On Thu, 9 Apr 2015 13:51:31 +1000
Anton Blanchard <anton@samba.org> wrote:
> To use jump labels in assembly we need the HAVE_JUMP_LABEL define,
> so we select a fallback version if the toolchain does not support
> them.
>
> Modify linux/jump_label.h so it can be included by assembly files.
> We also need to add -DCC_HAVE_ASM_GOTO to KBUILD_AFLAGS.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define
2015-04-09 3:51 ` Anton Blanchard
@ 2015-04-09 14:04 ` Steven Rostedt
-1 siblings, 0 replies; 23+ messages in thread
From: Steven Rostedt @ 2015-04-09 14:04 UTC (permalink / raw)
To: Anton Blanchard
Cc: benh, paulus, mpe, mmarek, akpm, jbaron, peterz, liuj97, mingo,
mgorman, linux, catalin.marinas, will.deacon, ralf, schwidefsky,
heiko.carstens, davem, tglx, mingo, hpa, linuxppc-dev,
linux-kbuild, linux-kernel
On Thu, 9 Apr 2015 13:51:32 +1000
Anton Blanchard <anton@samba.org> wrote:
> Commit 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> converted uses of CONFIG_JUMP_LABEL to HAVE_JUMP_LABEL in
> some assembly files.
>
> HAVE_JUMP_LABEL is defined in linux/jump_label.h, so we need to
> include this or we always get the non jump label fallback code.
>
> Fixes: 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH 3/3] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define
@ 2015-04-09 14:04 ` Steven Rostedt
0 siblings, 0 replies; 23+ messages in thread
From: Steven Rostedt @ 2015-04-09 14:04 UTC (permalink / raw)
To: Anton Blanchard
Cc: peterz, heiko.carstens, paulus, hpa, mingo, linux, mingo,
mgorman, catalin.marinas, liuj97, linux-kbuild, will.deacon,
jbaron, tglx, mmarek, linux-kernel, ralf, schwidefsky, akpm,
linuxppc-dev, davem
On Thu, 9 Apr 2015 13:51:32 +1000
Anton Blanchard <anton@samba.org> wrote:
> Commit 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> converted uses of CONFIG_JUMP_LABEL to HAVE_JUMP_LABEL in
> some assembly files.
>
> HAVE_JUMP_LABEL is defined in linux/jump_label.h, so we need to
> include this or we always get the non jump label fallback code.
>
> Fixes: 1bc9e47aa8e4 ("powerpc/jump_label: Use HAVE_JUMP_LABEL")
> Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2015-04-09 14:05 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-09 3:51 [PATCH 1/3] jump_label: Allow asm/jump_label.h to be included in assembly Anton Blanchard
2015-04-09 3:51 ` Anton Blanchard
2015-04-09 3:51 ` [PATCH 2/3] jump_label: Allow jump labels to be used " Anton Blanchard
2015-04-09 3:51 ` Anton Blanchard
2015-04-09 7:08 ` Peter Zijlstra
2015-04-09 7:08 ` Peter Zijlstra
2015-04-09 9:01 ` [tip:locking/core] " tip-bot for Anton Blanchard
2015-04-09 14:03 ` [PATCH 2/3] " Steven Rostedt
2015-04-09 14:03 ` Steven Rostedt
2015-04-09 3:51 ` [PATCH 3/3] powerpc: Include linux/jump_label.h to get HAVE_JUMP_LABEL define Anton Blanchard
2015-04-09 3:51 ` Anton Blanchard
2015-04-09 7:08 ` Peter Zijlstra
2015-04-09 7:08 ` Peter Zijlstra
2015-04-09 7:33 ` Michael Ellerman
2015-04-09 7:33 ` Michael Ellerman
2015-04-09 9:01 ` [tip:locking/core] powerpc, jump_label: Include linux/ jump_label.h " tip-bot for Anton Blanchard
2015-04-09 14:04 ` [PATCH 3/3] powerpc: Include linux/jump_label.h " Steven Rostedt
2015-04-09 14:04 ` Steven Rostedt
2015-04-09 7:08 ` [PATCH 1/3] jump_label: Allow asm/jump_label.h to be included in assembly Peter Zijlstra
2015-04-09 7:08 ` Peter Zijlstra
2015-04-09 9:00 ` [tip:locking/core] jump_label: Allow asm/ jump_label.h " tip-bot for Anton Blanchard
2015-04-09 14:00 ` [PATCH 1/3] jump_label: Allow asm/jump_label.h " Steven Rostedt
2015-04-09 14:00 ` Steven Rostedt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.