* [PATCH 6.12 118/265] LoongArch/orc: Use RCU in all users of __module_address().
[not found] <20260312201018.128816016@linuxfoundation.org>
@ 2026-03-12 20:08 ` Greg Kroah-Hartman
2026-04-06 12:27 ` Harshit Mogalapalli
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2026-03-12 20:08 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Huacai Chen, WANG Xuerui, loongarch,
Sebastian Andrzej Siewior, Peter Zijlstra (Intel), Petr Pavlu,
Sasha Levin
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;
err:
state->error = true;
end:
- preempt_enable();
state->stack_info.type = STACK_TYPE_UNKNOWN;
return false;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 6.12 118/265] LoongArch/orc: Use RCU in all users of __module_address().
2026-03-12 20:08 ` [PATCH 6.12 118/265] LoongArch/orc: Use RCU in all users of __module_address() Greg Kroah-Hartman
@ 2026-04-06 12:27 ` Harshit Mogalapalli
2026-04-07 12:46 ` Huacai Chen
0 siblings, 1 reply; 3+ messages in thread
From: Harshit Mogalapalli @ 2026-04-06 12:27 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable, Huacai Chen,
Sebastian Andrzej Siewior, Sasha Levin
Cc: patches, WANG Xuerui, loongarch, Peter Zijlstra (Intel),
Petr Pavlu, Vegard Nossum
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;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 6.12 118/265] LoongArch/orc: Use RCU in all users of __module_address().
2026-04-06 12:27 ` Harshit Mogalapalli
@ 2026-04-07 12:46 ` Huacai Chen
0 siblings, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2026-04-07 12:46 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Greg Kroah-Hartman, stable, Sebastian Andrzej Siewior,
Sasha Levin, patches, WANG Xuerui, loongarch,
Peter Zijlstra (Intel), Petr Pavlu, Vegard Nossum
On Mon, Apr 6, 2026 at 8:28 PM Harshit Mogalapalli
<harshit.m.mogalapalli@oracle.com> wrote:
>
> 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/
Yes, I have also asked about this:
https://lore.kernel.org/stable/CAAhV-H7GxtWRZyAT=kedLEMu=C5wH--NUzRjwi3DKXzUq+QZjA@mail.gmail.com/
However, no answer and no action for this. I don't know what happened
to Greg and Sasha. Recently, similar accidents happen again and again.
Huacai
>
> Thanks,
> Harshit
>
> > err:
> > state->error = true;
> >
> > end:
> > - preempt_enable();
> > state->stack_info.type = STACK_TYPE_UNKNOWN;
> > return false;
> > }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-07 12:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260312201018.128816016@linuxfoundation.org>
2026-03-12 20:08 ` [PATCH 6.12 118/265] LoongArch/orc: Use RCU in all users of __module_address() Greg Kroah-Hartman
2026-04-06 12:27 ` Harshit Mogalapalli
2026-04-07 12:46 ` Huacai Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox