mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] jump_label: explicitly annotate inittext labels as init
@ 2022-12-10  6:18 Alexander Gordeev
  0 siblings, 0 replies; only message in thread
From: Alexander Gordeev @ 2022-12-10  6:18 UTC (permalink / raw)
  To: Ard Biesheuvel, Peter Zijlstra, Josh Poimboeuf, Jason Baron
  Cc: linux-kernel, Alexander Gordeev

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")
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
---
 kernel/jump_label.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index 714ac4c3b556..7a20879b54dd 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -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);
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-10  6:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-10  6:18 [PATCH v2] jump_label: explicitly annotate inittext labels as init Alexander Gordeev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®