[PATCH/RFC] Change the program check exception from EXC_XFER_STD to EXC_XFER_EE.
Kumar Gala
galak at kernel.crashing.org
Fri Dec 8 19:07:14 EST 2006
On Fri, 8 Dec 2006, Paul Mackerras wrote:
> Kumar Gala writes:
>
>> We don't need to rearrange anything, just put the local_irq_enable()
>> call in do_mathemu(). If we are a debugger than REASON_TRAP will
>> have to be set and we dont bother with do_mathemu() than.
>>
>> Do you think we should also move the local_irq_enable() that exists
>> in the handler into emulate_instruction().
>
> I'd rather have the local_irq_enable() calls in
> program_check_exception() so they're all in one place, preferably with
> a comment explaining why they're there. Having an unpaired
> local_irq_enable in do_mathemu() would seem a bit weird to me.
Ok, how about something like this, I'm a bit concerned about what effect
moving the do_mathemu call will have on things like the 405.
I'll put this in my tree with some other cleanup patches if it looks ok.
- k
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index fde820e..63073f9 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -792,9 +792,12 @@ #ifdef CONFIG_MATH_EMULATION
* hardware people - not sure if it can happen on any illegal
* instruction or only on FP instructions, whether there is a
* pattern to occurences etc. -dgibson 31/Mar/2003 */
- if (!(reason & REASON_TRAP) && do_mathemu(regs) == 0) {
- emulate_single_step(regs);
- return;
+ if (!(reason & REASON_TRAP)) {
+ local_irq_enable();
+ if (do_mathemu(regs) == 0) {
+ emulate_single_step(regs);
+ return;
+ }
}
#endif /* CONFIG_MATH_EMULATION */
More information about the Linuxppc-dev
mailing list