diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-03-04 18:55:04 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-03-08 18:55:18 -0500 |
commit | 9424fabf8617c15e18a5ffd29bc3bcfa36620473 (patch) | |
tree | 6ce26cef57e7a3b60507b823191afed84d3f36a4 /arch/powerpc | |
parent | 990118c84b3e90b2b5354b6e2acd961044d7fa12 (diff) |
powerpc: Fix 64-bit BookE FP unavailable exceptions
We were using CR0.EQ after EXCEPTION_COMMON, hoping it still
contained whether we came from userspace or kernel space.
However, under some circumstances, EXCEPTION_COMMON will
call C code and clobber non-volatile registers, so we really
need to re-load the previous MSR from the stackframe and
re-test.
While there, invert the condition to make the fast path more
obvious and remove the BUG_OPCODE which was a debugging
leftover and call .ret_from_except as we should.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/exceptions-64e.S | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S index 3de9993c5c65..c4c34665c221 100644 --- a/arch/powerpc/kernel/exceptions-64e.S +++ b/arch/powerpc/kernel/exceptions-64e.S | |||
@@ -353,15 +353,16 @@ interrupt_end_book3e: | |||
353 | NORMAL_EXCEPTION_PROLOG(0x800, PROLOG_ADDITION_NONE) | 353 | NORMAL_EXCEPTION_PROLOG(0x800, PROLOG_ADDITION_NONE) |
354 | /* we can probably do a shorter exception entry for that one... */ | 354 | /* we can probably do a shorter exception entry for that one... */ |
355 | EXCEPTION_COMMON(0x800, PACA_EXGEN, INTS_KEEP) | 355 | EXCEPTION_COMMON(0x800, PACA_EXGEN, INTS_KEEP) |
356 | bne 1f /* if from user, just load it up */ | 356 | ld r12,_MSR(r1) |
357 | INTS_DISABLE_ALL | 357 | andi. r0,r12,MSR_PR; |
358 | beq- 1f | ||
359 | bl .load_up_fpu | ||
360 | b fast_exception_return | ||
361 | 1: INTS_DISABLE_ALL | ||
358 | bl .save_nvgprs | 362 | bl .save_nvgprs |
359 | addi r3,r1,STACK_FRAME_OVERHEAD | 363 | addi r3,r1,STACK_FRAME_OVERHEAD |
360 | bl .kernel_fp_unavailable_exception | 364 | bl .kernel_fp_unavailable_exception |
361 | BUG_OPCODE | 365 | b .ret_from_except |
362 | 1: ld r12,_MSR(r1) | ||
363 | bl .load_up_fpu | ||
364 | b fast_exception_return | ||
365 | 366 | ||
366 | /* Decrementer Interrupt */ | 367 | /* Decrementer Interrupt */ |
367 | MASKABLE_EXCEPTION(0x900, decrementer, .timer_interrupt, ACK_DEC) | 368 | MASKABLE_EXCEPTION(0x900, decrementer, .timer_interrupt, ACK_DEC) |