[PATCH 11/12] jump_label: declare jump table as external array

From: Vegard Nossum
Date: Sun Oct 16 2016 - 11:19:41 EST


Cc: Jason Baron <jbaron@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Signed-off-by: Vegard Nossum <vegard.nossum@xxxxxxxxxx>
---
include/linux/jump_label.h | 4 ++--
kernel/jump_label.c | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index a0547c5..7ba9918 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -76,6 +76,7 @@

#ifndef __ASSEMBLY__

+#include <linux/extarray.h>
#include <linux/types.h>
#include <linux/compiler.h>

@@ -132,8 +133,7 @@ static __always_inline bool static_key_true(struct static_key *key)
return !arch_static_branch(key, true);
}

-extern struct jump_entry __start___jump_table[];
-extern struct jump_entry __stop___jump_table[];
+DECLARE_EXTARRAY(struct jump_entry, __jump_table);

extern void jump_label_init(void);
extern void jump_label_lock(void);
diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index 93ad6c1..bf14906 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -274,8 +274,8 @@ static void __jump_label_update(struct static_key *key,

void __init jump_label_init(void)
{
- struct jump_entry *iter_start = __start___jump_table;
- struct jump_entry *iter_stop = __stop___jump_table;
+ struct jump_entry *iter_start = ext_start(__jump_table);
+ struct jump_entry *iter_stop = ext_end(__jump_table);
struct static_key *key = NULL;
struct jump_entry *iter;

@@ -539,8 +539,8 @@ early_initcall(jump_label_init_module);
*/
int jump_label_text_reserved(void *start, void *end)
{
- int ret = __jump_label_text_reserved(__start___jump_table,
- __stop___jump_table, start, end);
+ int ret = __jump_label_text_reserved(ext_start(__jump_table),
+ ext_end(__jump_table), start, end);

if (ret)
return ret;
@@ -553,7 +553,7 @@ int jump_label_text_reserved(void *start, void *end)

static void jump_label_update(struct static_key *key)
{
- struct jump_entry *stop = __stop___jump_table;
+ struct jump_entry *stop = ext_end(__jump_table);
struct jump_entry *entry = static_key_entries(key);
#ifdef CONFIG_MODULES
struct module *mod;
--
2.10.0.479.g221bd91