Skip to content

Commit f8f02ec

Browse files
author
Russell King
committed
ARM: entry: move disable_irq_notrace into svc_exit
All svc exit paths need IRQs off. Rather than placing this before every user of svc_exit, combine it into this macro. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 9b56feb commit f8f02ec

2 files changed

Lines changed: 6 additions & 18 deletions

File tree

‎arch/arm/kernel/entry-armv.S‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,6 @@ __dabt_svc:
192192
svc_entry
193193
mov r2, sp
194194
dabt_helper
195-
196-
@
197-
@ IRQs off again before pulling preserved data off the stack
198-
@
199-
disable_irq_notrace
200195
svc_exit r5 @ return from exception
201196
UNWIND(.fnend )
202197
ENDPROC(__dabt_svc)
@@ -283,15 +278,7 @@ __und_svc_fault:
283278
mov r0, sp @ struct pt_regs *regs
284279
bl __und_fault
285280

286-
@
287-
@ IRQs off again before pulling preserved data off the stack
288-
@
289281
__und_svc_finish:
290-
disable_irq_notrace
291-
292-
@
293-
@ restore SPSR and restart the instruction
294-
@
295282
ldr r5, [sp, #S_PSR] @ Get SVC cpsr
296283
svc_exit r5 @ return from exception
297284
UNWIND(.fnend )
@@ -302,11 +289,6 @@ __pabt_svc:
302289
svc_entry
303290
mov r2, sp @ regs
304291
pabt_helper
305-
306-
@
307-
@ IRQs off again before pulling preserved data off the stack
308-
@
309-
disable_irq_notrace
310292
svc_exit r5 @ return from exception
311293
UNWIND(.fnend )
312294
ENDPROC(__pabt_svc)

‎arch/arm/kernel/entry-header.S‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,15 @@
7676
#ifndef CONFIG_THUMB2_KERNEL
7777
.macro svc_exit, rpsr, irq = 0
7878
.if \irq != 0
79+
@ IRQs already off
7980
#ifdef CONFIG_TRACE_IRQFLAGS
8081
@ The parent context IRQs must have been enabled to get here in
8182
@ the first place, so there's no point checking the PSR I bit.
8283
bl trace_hardirqs_on
8384
#endif
8485
.else
86+
@ IRQs off again before pulling preserved data off the stack
87+
disable_irq_notrace
8588
#ifdef CONFIG_TRACE_IRQFLAGS
8689
tst \rpsr, #PSR_I_BIT
8790
bleq trace_hardirqs_on
@@ -136,12 +139,15 @@
136139
#else /* CONFIG_THUMB2_KERNEL */
137140
.macro svc_exit, rpsr, irq = 0
138141
.if \irq != 0
142+
@ IRQs already off
139143
#ifdef CONFIG_TRACE_IRQFLAGS
140144
@ The parent context IRQs must have been enabled to get here in
141145
@ the first place, so there's no point checking the PSR I bit.
142146
bl trace_hardirqs_on
143147
#endif
144148
.else
149+
@ IRQs off again before pulling preserved data off the stack
150+
disable_irq_notrace
145151
#ifdef CONFIG_TRACE_IRQFLAGS
146152
tst \rpsr, #PSR_I_BIT
147153
bleq trace_hardirqs_on

0 commit comments

Comments
 (0)