diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-11-27 06:22:42 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2017-11-27 06:22:42 -0500 |
commit | 3aaf33bebda8d4ffcc0fc8ef39e6c1ac68823b11 (patch) | |
tree | cea1260797f0c3af391c048a53f46db026221f87 | |
parent | 8bafae202c82dc257f649ea3c275a0f35ee15113 (diff) |
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: 8bafae202c82 ("ARM: BUG if jumping to usermode address in kernel mode")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | arch/arm/kernel/entry-header.S | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index 75f7a4e8541a..e056c9a9aa9d 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -299,7 +299,7 @@ | |||
299 | mov r2, sp | 299 | mov r2, sp |
300 | ldr r1, [r2, #\offset + S_PSR] @ get calling cpsr | 300 | ldr r1, [r2, #\offset + S_PSR] @ get calling cpsr |
301 | ldr lr, [r2, #\offset + S_PC]! @ get pc | 301 | ldr lr, [r2, #\offset + S_PC]! @ get pc |
302 | tst r1, #0xcf | 302 | tst r1, #PSR_I_BIT | 0x0f |
303 | bne 1f | 303 | bne 1f |
304 | msr spsr_cxsf, r1 @ save in spsr_svc | 304 | msr spsr_cxsf, r1 @ save in spsr_svc |
305 | #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K) | 305 | #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K) |
@@ -331,7 +331,7 @@ | |||
331 | ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr | 331 | ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr |
332 | ldr lr, [sp, #\offset + S_PC] @ get pc | 332 | ldr lr, [sp, #\offset + S_PC] @ get pc |
333 | add sp, sp, #\offset + S_SP | 333 | add sp, sp, #\offset + S_SP |
334 | tst r1, #0xcf | 334 | tst r1, #PSR_I_BIT | 0x0f |
335 | bne 1f | 335 | bne 1f |
336 | msr spsr_cxsf, r1 @ save in spsr_svc | 336 | msr spsr_cxsf, r1 @ save in spsr_svc |
337 | 337 | ||