]> www.infradead.org Git - users/hch/misc.git/commitdiff
LoongArch/orc: Use RCU in all users of __module_address().
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 8 Jan 2025 09:04:47 +0000 (10:04 +0100)
committerPetr Pavlu <petr.pavlu@suse.com>
Mon, 10 Mar 2025 10:54:45 +0000 (11:54 +0100)
__module_address() can be invoked within a RCU section, there is no
requirement to have preemption disabled.

Replace the preempt_disable() section around __module_address() with
RCU.

Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: loongarch@lists.linux.dev
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250108090457.512198-19-bigeasy@linutronix.de
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
arch/loongarch/kernel/unwind_orc.c

index b25722876331792f5ac218fa4376f36318156f7f..d623935a75471ce2276457e6dc26709c02559a4f 100644 (file)
@@ -399,7 +399,7 @@ bool unwind_next_frame(struct unwind_state *state)
                return false;
 
        /* Don't let modules unload while we're reading their ORC data. */
-       preempt_disable();
+       guard(rcu)();
 
        if (is_entry_func(state->pc))
                goto end;
@@ -514,14 +514,12 @@ bool unwind_next_frame(struct unwind_state *state)
        if (!__kernel_text_address(state->pc))
                goto err;
 
-       preempt_enable();
        return true;
 
 err:
        state->error = true;
 
 end:
-       preempt_enable();
        state->stack_info.type = STACK_TYPE_UNKNOWN;
        return false;
 }