s390: Revert "s390/irq/idle: Remove psw bits early"
Heiko Carstens
maintainerPATCH 1/1 s390: Revert "s390/irq/idle: Remove psw bits early"
This reverts commit d8b5cf9c63143fae54a734c41e3bb55cf3f365c7.
Mikhail Zaslonko reported that linux-next doesn't boot anymore [2]. Reason for this is recent change [2] was supposed to slightly optimize the irq entry/exit path by removing some psw bits early in case of an idle exit.
This however is incorrect since irqentry_exit() requires the correct old psw state at irq entry. Otherwise the embedded regs_irqs_disabled() will not provide the correct result.
With linux-next and HRTIMER_REARM_DEFERRED this leads to the observed boot problems, however the commit is broken in any case.
Revert the commit which introduced this.
Thanks to Peter Zijlstra for pointing out that this is a bug in the s390 entry code.
--- arch/s390/kernel/irq.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
arch/s390/kernel/irq.c +8 -6
@@ -147,10 +147,8 @@ void noinstr do_io_irq(struct pt_regs *regs)bool from_idle; from_idle =test_and_clear_cpu_flag (CIF_ENABLED_WAIT ); -if (from_idle) { +if (from_idle)update_timer_idle (); - regs->psw.mask &= ~(PSW_MASK_EXT |PSW_MASK_IO |PSW_MASK_WAIT ); - }irq_enter_rcu ();
@@ -176,6 +174,9 @@ void noinstr do_io_irq(struct pt_regs *regs)set_irq_regs (old_regs);irqentry_exit (regs, state); + +if (from_idle) + regs->psw.mask &= ~(PSW_MASK_EXT |PSW_MASK_IO |PSW_MASK_WAIT ); } void noinstr do_ext_irq(struct pt_regs *regs)
@@ -185,10 +186,8 @@ void noinstr do_ext_irq(struct pt_regs *regs)bool from_idle; from_idle =test_and_clear_cpu_flag (CIF_ENABLED_WAIT ); -if (from_idle) { +if (from_idle)update_timer_idle (); - regs->psw.mask &= ~(PSW_MASK_EXT |PSW_MASK_IO |PSW_MASK_WAIT ); - }irq_enter_rcu ();
@@ -210,6 +209,9 @@ void noinstr do_ext_irq(struct pt_regs *regs)irq_exit_rcu ();set_irq_regs (old_regs);irqentry_exit (regs, state); + +if (from_idle) + regs->psw.mask &= ~(PSW_MASK_EXT |PSW_MASK_IO |PSW_MASK_WAIT ); }static void show_msi_interrupt (struct seq_file *p,int irq)
Signature · 1 line
2.51.0
Quoted 18 lines · Heiko Carstens
This reverts commit
d8b5cf9c63143fae54a734c41e3bb55cf3f365c7.Mikhail Zaslonko reported that linux-next doesn't boot anymore [2]. Reason for this is recent change [2] was supposed to slightly optimize the irq entry/exit path by removing some psw bits early in case of an idle exit.
This however is incorrect since
irqentry_exit()requires the correct old psw state at irq entry. Otherwise the embeddedregs_irqs_disabled()will not provide the correct result.With linux-next and
HRTIMER_REARM_DEFERREDthis leads to the observed boot problems, however the commit is broken in any case.Revert the commit which introduced this.
Thanks to Peter Zijlstra for pointing out that this is a bug in the s390 entry code.
Quoted 8 lines
Fixes d8b5cf9c6314 ("s390/irq/idle: Remove psw bits early") [1]Reported-by Mikhail Zaslonko <[email protected]>Reported-by Peter Zijlstra <[email protected]>Signed-off-by Heiko Carstens <[email protected]>--- arch/s390/kernel/irq.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
Applied, thank you!
Quoted 66 lines · Heiko Carstens
This reverts commit
d8b5cf9c63143fae54a734c41e3bb55cf3f365c7.Mikhail Zaslonko reported that linux-next doesn't boot anymore [2]. Reason for this is recent change [2] was supposed to slightly optimize the irq entry/exit path by removing some psw bits early in case of an idle exit.
This however is incorrect since
irqentry_exit()requires the correct old psw state at irq entry. Otherwise the embeddedregs_irqs_disabled()will not provide the correct result.With linux-next and
HRTIMER_REARM_DEFERREDthis leads to the observed boot problems, however the commit is broken in any case.Revert the commit which introduced this.
Thanks to Peter Zijlstra for pointing out that this is a bug in the s390 entry code.
Fixes d8b5cf9c6314 ("s390/irq/idle: Remove psw bits early") [1]Reported-by Mikhail Zaslonko <[email protected]>Reported-by Peter Zijlstra <[email protected]>Signed-off-by Heiko Carstens <[email protected]>--- arch/s390/kernel/irq.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)arch/s390/kernel/irq.c +5
-6@@ -147,10 +147,8 @@ void noinstr do_io_irq(struct pt_regs *regs)bool from_idle; from_idle =test_and_clear_cpu_flag (CIF_ENABLED_WAIT ); -if (from_idle) { +if (from_idle)update_timer_idle (); - regs->psw.mask &= ~(PSW_MASK_EXT |PSW_MASK_IO |PSW_MASK_WAIT ); - }irq_enter_rcu ();@@ -176,6 +174,9 @@ void noinstr do_io_irq(struct pt_regs *regs)set_irq_regs (old_regs);irqentry_exit (regs, state); + +if (from_idle) + regs->psw.mask &= ~(PSW_MASK_EXT |PSW_MASK_IO |PSW_MASK_WAIT ); } void noinstr do_ext_irq(struct pt_regs *regs)@@ -185,10 +186,8 @@ void noinstr do_ext_irq(struct pt_regs *regs)bool from_idle; from_idle =test_and_clear_cpu_flag (CIF_ENABLED_WAIT ); -if (from_idle) { +if (from_idle)update_timer_idle (); - regs->psw.mask &= ~(PSW_MASK_EXT |PSW_MASK_IO |PSW_MASK_WAIT ); - }irq_enter_rcu ();
arch/s390/kernel/irq.c void noinstr do_ext_irq(struct pt_regs *regs) · line 217
Quoted 9 lines
arch/s390/kernel/irq.c +3
-0@@ -210,6 +209,9 @@ void noinstr do_ext_irq(struct pt_regs *regs)irq_exit_rcu ();set_irq_regs (old_regs);irqentry_exit (regs, state); + +if (from_idle) + regs->psw.mask &= ~(PSW_MASK_EXT |PSW_MASK_IO |PSW_MASK_WAIT ); }static void show_msi_interrupt (struct seq_file *p,int irq)
Indeed, with this revert no more kernel-next boot problems observed.