Skip to content

Commit 17a9992

Browse files
Sebastian Andrzej Siewiorpetrpavlu
authored andcommitted
arm64: module: Use RCU in all users of __module_text_address().
__module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: Catalin Marinas <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Pavlu <[email protected]>
1 parent 59aa141 commit 17a9992

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/arm64/kernel/ftrace.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,13 @@ static bool ftrace_find_callable_addr(struct dyn_ftrace *rec,
320320
* dealing with an out-of-range condition, we can assume it
321321
* is due to a module being loaded far away from the kernel.
322322
*
323-
* NOTE: __module_text_address() must be called with preemption
324-
* disabled, but we can rely on ftrace_lock to ensure that 'mod'
323+
* NOTE: __module_text_address() must be called within a RCU read
324+
* section, but we can rely on ftrace_lock to ensure that 'mod'
325325
* retains its validity throughout the remainder of this code.
326326
*/
327327
if (!mod) {
328-
preempt_disable();
328+
guard(rcu)();
329329
mod = __module_text_address(pc);
330-
preempt_enable();
331330
}
332331

333332
if (WARN_ON(!mod))

0 commit comments

Comments
 (0)