[PATCH 2/5] powerpc/kprobes: Have optimized_callback() use preempt_enable()
Nicholas Piggin
npiggin at gmail.com
Mon Nov 7 21:18:40 AEDT 2022
On Fri Oct 21, 2022 at 3:28 AM AEST, Naveen N. Rao wrote:
> Similar to x86 commit 2e62024c265aa6 ("kprobes/x86: Use preempt_enable()
> in optimized_callback()"), change powerpc optprobes to use
> preempt_enable() rather than preempt_enable_no_resched() since powerpc
> also removed irq disabling for optprobes in commit f72180cc93a2c6
> ("powerpc/kprobes: Do not disable interrupts for optprobes and
> kprobes_on_ftrace").
Looks okay. Even if we did have irqs disabled here, we should just use
preempt_enable(), which nests properly inside or outside local irqs.
Reviewed-by: Nicholas Piggin <npiggin at gmail.com>
>
> Reported-by: Nicholas Piggin <npiggin at gmail.com>
> Signed-off-by: Naveen N. Rao <naveen.n.rao at linux.vnet.ibm.com>
> ---
> arch/powerpc/kernel/optprobes.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c
> index 3b1c2236cbee57..004fae2044a3e0 100644
> --- a/arch/powerpc/kernel/optprobes.c
> +++ b/arch/powerpc/kernel/optprobes.c
> @@ -112,7 +112,7 @@ static void optimized_callback(struct optimized_kprobe *op,
> __this_cpu_write(current_kprobe, NULL);
> }
>
> - preempt_enable_no_resched();
> + preempt_enable();
> }
> NOKPROBE_SYMBOL(optimized_callback);
>
> --
> 2.38.0
More information about the Linuxppc-dev
mailing list