Re: [PATCH 6.12 118/265] LoongArch/orc: Use RCU in all users of __module_address().

Harshit Mogalapalli
2026-04-06T12:28:33Z

Hi all,

On 13/03/26 01:38, Greg Kroah-Hartman wrote:
> 6.12-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> [ Upstream commit f99d27d9feb755aee9350fc89f57814d7e1b4880 ]
>
> __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>
> Stable-dep-of: 055c7e75190e ("LoongArch: Handle percpu handler address for ORC unwinder")
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> arch/loongarch/kernel/unwind_orc.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/loongarch/kernel/unwind_orc.c b/arch/loongarch/kernel/unwind_orc.c
> index 471652c0c8653..59809c3406c03 100644
> --- a/arch/loongarch/kernel/unwind_orc.c
> +++ b/arch/loongarch/kernel/unwind_orc.c
> @@ -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;
>

Looks like this is dependent on commit: 7d9dda6f628f ("module: Allow
__module_address() to be called from RCU section."), so I feel pulling
in this patch without the mentioned missing prerequisite is wrong. Can
you please help review this ?

This is also part of a feature series in
https://lore.kernel.org/all/20250108090457.512198-13-bigeasy@linutronix.de/

Thanks,
Harshit

> err:
> state->error = true;
>
> end:
> - preempt_enable();
> state->stack_info.type = STACK_TYPE_UNKNOWN;
> return false;
> }