Commit ac99b862 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

jump_label: Provide jump_label_key initializers

Provide two initializers for jump_label_key that initialize it enabled
or disabled. Also modify all jump_label code to allow for jump_labels to be
initialized enabled.
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jason Baron <jbaron@redhat.com>
Link: http://lkml.kernel.org/n/tip-p40e3yj21b68y03z1yv825e7@git.kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 9cdbe1cb
...@@ -128,4 +128,7 @@ static inline void jump_label_rate_limit(struct jump_label_key_deferred *key, ...@@ -128,4 +128,7 @@ static inline void jump_label_rate_limit(struct jump_label_key_deferred *key,
} }
#endif /* HAVE_JUMP_LABEL */ #endif /* HAVE_JUMP_LABEL */
#define jump_label_key_enabled ((struct jump_label_key){ .enabled = ATOMIC_INIT(1), })
#define jump_label_key_disabled ((struct jump_label_key){ .enabled = ATOMIC_INIT(0), })
#endif /* _LINUX_JUMP_LABEL_H */ #endif /* _LINUX_JUMP_LABEL_H */
...@@ -248,8 +248,13 @@ void jump_label_apply_nops(struct module *mod) ...@@ -248,8 +248,13 @@ void jump_label_apply_nops(struct module *mod)
if (iter_start == iter_stop) if (iter_start == iter_stop)
return; return;
for (iter = iter_start; iter < iter_stop; iter++) for (iter = iter_start; iter < iter_stop; iter++) {
arch_jump_label_transform_static(iter, JUMP_LABEL_DISABLE); struct jump_label_key *iterk;
iterk = (struct jump_label_key *)(unsigned long)iter->key;
arch_jump_label_transform_static(iter, jump_label_enabled(iterk) ?
JUMP_LABEL_ENABLE : JUMP_LABEL_DISABLE);
}
} }
static int jump_label_add_module(struct module *mod) static int jump_label_add_module(struct module *mod)
...@@ -289,8 +294,7 @@ static int jump_label_add_module(struct module *mod) ...@@ -289,8 +294,7 @@ static int jump_label_add_module(struct module *mod)
key->next = jlm; key->next = jlm;
if (jump_label_enabled(key)) if (jump_label_enabled(key))
__jump_label_update(key, iter, iter_stop, __jump_label_update(key, iter, iter_stop, JUMP_LABEL_ENABLE);
JUMP_LABEL_ENABLE);
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment