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

Mukesh Kumar Chaurasiya mkchauras at linux.ibm.com
Fri Nov 21 16:48:09 AEDT 2025


On 11/19/25 11:27 PM, Thomas Gleixner wrote:
> 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()
yeah we also found an issue with context tracking here. I am working on 
fixing it.
>
> 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.
This helps. Let me try this and i'll send a new version out as soon as 
we are done with testing.
> Thanks,
>
>          tglx

Thanks for the review.

Regards,

Mukesh



More information about the Linuxppc-dev mailing list