]> git.baikalelectronics.ru Git - kernel.git/commit
jump_label: Don't warn on __exit jump entries
authorAndrew Murray <andrew.murray@arm.com>
Wed, 28 Aug 2019 17:50:05 +0000 (18:50 +0100)
committerWill Deacon <will@kernel.org>
Thu, 29 Aug 2019 14:10:10 +0000 (15:10 +0100)
commitf4e34a209b86f630e623a0e3a0d48f0112c0b870
tree7c8c92bcc562cc79495a89ce0abec2a5ba38e201
parent98f2f03894443d3a44ddfe8334be57b6ae4f612b
jump_label: Don't warn on __exit jump entries

On architectures that discard .exit.* sections at runtime, a
warning is printed for each jump label that is used within an
in-kernel __exit annotated function:

can't patch jump_label at ehci_hcd_cleanup+0x8/0x3c
WARNING: CPU: 0 PID: 1 at kernel/jump_label.c:410 __jump_label_update+0x12c/0x138

As these functions will never get executed (they are free'd along
with the rest of initmem) - we do not need to patch them and should
not display any warnings.

The warning is displayed because the test required to satisfy
jump_entry_is_init is based on init_section_contains (__init_begin to
__init_end) whereas the test in __jump_label_update is based on
init_kernel_text (_sinittext to _einittext) via kernel_text_address).

Fixes: de1607f39381 ("jump_label: Annotate entries that operate on __init code earlier")
Signed-off-by: Andrew Murray <andrew.murray@arm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
kernel/jump_label.c