Skip to content

Commit 3aaf33b

Browse files
author
Russell King
committed
ARM: avoid faulting on qemu
When qemu starts a kernel in a bare environment, the default SCR has the AW and FW bits clear, which means that the kernel can't modify the PSR A or PSR F bits, and means that FIQs and imprecise aborts are always masked. When running uboot under qemu, the AW and FW SCR bits are set, and the kernel functions normally - and this is how real hardware behaves. Fix this for qemu by ignoring the FIQ bit. Fixes: 8bafae2 ("ARM: BUG if jumping to usermode address in kernel mode") Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
1 parent 8bafae2 commit 3aaf33b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/arm/kernel/entry-header.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
mov r2, sp
300300
ldr r1, [r2, #\offset + S_PSR] @ get calling cpsr
301301
ldr lr, [r2, #\offset + S_PC]! @ get pc
302-
tst r1, #0xcf
302+
tst r1, #PSR_I_BIT | 0x0f
303303
bne 1f
304304
msr spsr_cxsf, r1 @ save in spsr_svc
305305
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K)
@@ -331,7 +331,7 @@
331331
ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr
332332
ldr lr, [sp, #\offset + S_PC] @ get pc
333333
add sp, sp, #\offset + S_SP
334-
tst r1, #0xcf
334+
tst r1, #PSR_I_BIT | 0x0f
335335
bne 1f
336336
msr spsr_cxsf, r1 @ save in spsr_svc
337337

0 commit comments

Comments
 (0)