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

From
Mukesh Kumar Chaurasiya <hidden>
Date
2025-11-21 05:49:09
Also in
lkml
Reply to
Thomas Gleixner, 2025-11-19
On 11/19/25 11:27 PM, Thomas Gleixner wrote:
On Fri, Nov 07 2025 at 21:53, Shrikanth Hegde wrote:
quoted
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

Thread (15 messages) 15 messages, 4 authors, last reply 2025-11-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help