Subject: Re: [PATCH 0/8] Generic IRQ entry/exit support for powerpc

From: Thomas Gleixner <[email-masked]>
Date: Wed, 19 Nov 2025 18:57:01 +0100

On Fri, Nov 07 2025 at 21:53, Shrikanth Hegde wrote:
> On 11/2/25 5:23 PM, Mukesh Kumar Chaurasiya wrote:
> diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
> index ce59431f977c..c7cf9a3f1202 100644
> --- a/arch/powerpc/kernel/interrupt.c
> +++ b/arch/powerpc/kernel/interrupt.c
> @@ -118,16 +118,18 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3,
>                  regs->exit_flags |= _TIF_RESTOREALL;
>          }
>   
> -again:
> +       local_irq_disable();
> +
> +       user_exit_irqoff();
>          syscall_exit_to_user_mode(regs);
>   
> -       user_enter_irqoff();
> -       if (!prep_irq_for_enabled_exit(true)) {
> -               user_exit_irqoff();
> -               local_irq_enable();
> -               local_irq_disable();
> -               goto again;
> -       }
> +again:
> +       if (!prep_irq_for_enabled_exit(true)) {
> +               local_irq_enable();
> +               local_irq_disable();
> +               goto again;
> +       }
> +

This does not look right at all.

          syscall_exit_to_user_mode(regs)
                syscall_exit_to_user_mode_work()
                exit_to_user_mode()
                   user_exit_irqoff()

What you really want to do here is:

 again:
	syscall_exit_to_user_mode_work(regs);
 
	exit_to_user_mode(regs);
 	if (!prep_irq_for_enabled_exit(true)) {
        	// Re-establishes the full state required
                // to restart
		enter_from_user_mode(regs);
 		local_irq_enable();
 		local_irq_disable();
 		goto again;

That should cure it. Same issue in the other places.

Thanks,

        tglx