diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-03-07 00:48:45 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-03-08 18:55:08 -0500 |
commit | a546498f3bf9aac311c66f965186373aee2ca0b0 (patch) | |
tree | 86fb9a778aba26df3810acd8e52a921a2d84489b /arch/powerpc/kernel/head_8xx.S | |
parent | 1b70117924a4f254840ed70fbe3020d4519a1a9a (diff) |
powerpc: Call do_page_fault() with interrupts off
We currently turn interrupts back to their previous state before
calling do_page_fault(). This can be annoying when debugging as
a bad fault will potentially have lost some processor state before
getting into the debugger.
We also end up calling some generic code with interrupts enabled
such as notify_page_fault() with interrupts enabled, which could
be unexpected.
This changes our code to behave more like other architectures,
and make the assembly entry code call into do_page_faults() with
interrupts disabled. They are conditionally re-enabled from
within do_page_fault() in the same spot x86 does it.
While there, add the might_sleep() test in the case of a successful
trylock of the mmap semaphore, again like x86.
Also fix a bug in the existing assembly where r12 (_MSR) could get
clobbered by C calls (the DTL accounting in the exception common
macro and DISABLE_INTS) in some cases.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
v2. Add the r12 clobber fix
Diffstat (limited to 'arch/powerpc/kernel/head_8xx.S')
-rw-r--r-- | arch/powerpc/kernel/head_8xx.S | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index b68cb173ba2c..b2a5860accfb 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S | |||
@@ -220,7 +220,7 @@ DataAccess: | |||
220 | mfspr r4,SPRN_DAR | 220 | mfspr r4,SPRN_DAR |
221 | li r10,0x00f0 | 221 | li r10,0x00f0 |
222 | mtspr SPRN_DAR,r10 /* Tag DAR, to be used in DTLB Error */ | 222 | mtspr SPRN_DAR,r10 /* Tag DAR, to be used in DTLB Error */ |
223 | EXC_XFER_EE_LITE(0x300, handle_page_fault) | 223 | EXC_XFER_LITE(0x300, handle_page_fault) |
224 | 224 | ||
225 | /* Instruction access exception. | 225 | /* Instruction access exception. |
226 | * This is "never generated" by the MPC8xx. We jump to it for other | 226 | * This is "never generated" by the MPC8xx. We jump to it for other |
@@ -231,7 +231,7 @@ InstructionAccess: | |||
231 | EXCEPTION_PROLOG | 231 | EXCEPTION_PROLOG |
232 | mr r4,r12 | 232 | mr r4,r12 |
233 | mr r5,r9 | 233 | mr r5,r9 |
234 | EXC_XFER_EE_LITE(0x400, handle_page_fault) | 234 | EXC_XFER_LITE(0x400, handle_page_fault) |
235 | 235 | ||
236 | /* External interrupt */ | 236 | /* External interrupt */ |
237 | EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) | 237 | EXCEPTION(0x500, HardwareInterrupt, do_IRQ, EXC_XFER_LITE) |