Skip to contentSkip to conversation

jump_label: explicitly annotate inittext labels as init

PATCH New Alexander Gordeev 1 participant 1 message Dec 10, 2022 Static branch/call

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 jump_label: explicitly annotate inittext labels as init

inittext code may be out of [__init_begin, __init_end] range on some architectures. Yet, the jump_label_init() only calls init_section_contains() function to check if a label needs to be annotated as init and inittext code could be left behind.

By contrast, checking whether a jump_label belongs to the inittext code is enough.

Fixes 19483677684b ("jump_label: Annotate entries that operate on __init code earlier")
---
 kernel/jump_label.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/jump_label.c +1 -1
index 714ac4c3b556..7a20879b54dd 100644
@@ -487,7 +487,7 @@ void __init jump_label_init(void)
 		if (jump_label_type(iter) == JUMP_LABEL_NOP)
 			arch_jump_label_transform_static(iter, JUMP_LABEL_NOP);
 
-		in_init = init_section_contains((void *)jump_entry_code(iter), 1);
+		in_init = is_kernel_inittext(jump_entry_code(iter));
 		jump_entry_set_init(iter, in_init);
 
 		iterk = jump_entry_key(iter);
Signature · 1 line
2.34.1