summaryrefslogtreecommitdiff
path: root/kernel/jump_label.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-05-06 22:34:00 +0300
committerIngo Molnar <mingo@kernel.org>2021-05-12 15:54:55 +0300
commit5af0ea293d78c8b8f0b87ae2b13f7ac584057bc3 (patch)
tree041c397efaf5536d0d1fa709d69d53704186938e /kernel/jump_label.c
parent001951bea748d3f675e1778f42b17290a8c551bf (diff)
downloadlinux-5af0ea293d78c8b8f0b87ae2b13f7ac584057bc3.tar.xz
jump_label: Free jump_entry::key bit1 for build use
Have jump_label_init() set jump_entry::key bit1 to either 0 ot 1 unconditionally. This makes it available for build-time games. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20210506194157.906893264@infradead.org
Diffstat (limited to 'kernel/jump_label.c')
-rw-r--r--kernel/jump_label.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index 521cafcfcb69..bdb0681bece8 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -483,13 +483,14 @@ void __init jump_label_init(void)
for (iter = iter_start; iter < iter_stop; iter++) {
struct static_key *iterk;
+ bool in_init;
/* rewrite NOPs */
if (jump_label_type(iter) == JUMP_LABEL_NOP)
arch_jump_label_transform_static(iter, JUMP_LABEL_NOP);
- if (init_section_contains((void *)jump_entry_code(iter), 1))
- jump_entry_set_init(iter);
+ in_init = init_section_contains((void *)jump_entry_code(iter), 1);
+ jump_entry_set_init(iter, in_init);
iterk = jump_entry_key(iter);
if (iterk == key)
@@ -634,9 +635,10 @@ static int jump_label_add_module(struct module *mod)
for (iter = iter_start; iter < iter_stop; iter++) {
struct static_key *iterk;
+ bool in_init;
- if (within_module_init(jump_entry_code(iter), mod))
- jump_entry_set_init(iter);
+ in_init = within_module_init(jump_entry_code(iter), mod);
+ jump_entry_set_init(iter, in_init);
iterk = jump_entry_key(iter);
if (iterk == key)