Skip to content

Commit d8b5cf9

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/irq/idle: Remove psw bits early
Remove wait, io, external interrupt bits early in do_io_irq()/do_ext_irq() when previous context was idle. This saves one conditional branch and is closer to the original old assembly code. Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 257c14e commit d8b5cf9

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

arch/s390/kernel/irq.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,10 @@ void noinstr do_io_irq(struct pt_regs *regs)
147147
bool from_idle;
148148

149149
from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
150-
if (from_idle)
150+
if (from_idle) {
151151
update_timer_idle();
152+
regs->psw.mask &= ~(PSW_MASK_EXT | PSW_MASK_IO | PSW_MASK_WAIT);
153+
}
152154

153155
irq_enter_rcu();
154156

@@ -174,9 +176,6 @@ void noinstr do_io_irq(struct pt_regs *regs)
174176

175177
set_irq_regs(old_regs);
176178
irqentry_exit(regs, state);
177-
178-
if (from_idle)
179-
regs->psw.mask &= ~(PSW_MASK_EXT | PSW_MASK_IO | PSW_MASK_WAIT);
180179
}
181180

182181
void noinstr do_ext_irq(struct pt_regs *regs)
@@ -186,8 +185,10 @@ void noinstr do_ext_irq(struct pt_regs *regs)
186185
bool from_idle;
187186

188187
from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
189-
if (from_idle)
188+
if (from_idle) {
190189
update_timer_idle();
190+
regs->psw.mask &= ~(PSW_MASK_EXT | PSW_MASK_IO | PSW_MASK_WAIT);
191+
}
191192

192193
irq_enter_rcu();
193194

@@ -209,9 +210,6 @@ void noinstr do_ext_irq(struct pt_regs *regs)
209210
irq_exit_rcu();
210211
set_irq_regs(old_regs);
211212
irqentry_exit(regs, state);
212-
213-
if (from_idle)
214-
regs->psw.mask &= ~(PSW_MASK_EXT | PSW_MASK_IO | PSW_MASK_WAIT);
215213
}
216214

217215
static void show_msi_interrupt(struct seq_file *p, int irq)

0 commit comments

Comments
 (0)