Browse Source

powerpc: Fix might-sleep warning in program check exception handler

On 32-bit, the exception prolog for the program check exception doesn't
enable interrupts early on.  If it is an illegal instruction exception,
we read the instruction in order to emulate certain instructions, and
the get_user of the instruction triggers a WARN_ON since interrupts
are still disabled.  This adds a local_irq_enable() to enable
interrupts before reading the instruction.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Paul Mackerras 19 years ago
parent
commit
cd8a5673e9
1 changed files with 2 additions and 0 deletions
  1. 2 0
      arch/powerpc/kernel/traps.c

+ 2 - 0
arch/powerpc/kernel/traps.c

@@ -814,6 +814,8 @@ void __kprobes program_check_exception(struct pt_regs *regs)
 		return;
 		return;
 	}
 	}
 
 
+	local_irq_enable();
+
 	/* Try to emulate it if we should. */
 	/* Try to emulate it if we should. */
 	if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
 	if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
 		switch (emulate_instruction(regs)) {
 		switch (emulate_instruction(regs)) {