linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PowerPC: Sleeping function called from invalid context at emulate_instruction()
@ 2006-02-22 20:29 Michael Buesch
  2006-02-23  4:22 ` Kumar Gala
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Buesch @ 2006-02-22 20:29 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

Hi,

On a powerPC 32bit, I got the following debugging assertion failure:

[  733.209827] Debug: sleeping function called from invalid context at arch/powerpc/kernel/traps.c:697
[  733.210682] in_atomic():0, irqs_disabled():1
[  733.211347] Call Trace:
[  733.211969] [D6023EB0] [C0007F84] show_stack+0x58/0x174 (unreliable)
[  733.212765] [D6023EE0] [C0022C34] __might_sleep+0xbc/0xd0
[  733.213523] [D6023EF0] [C000D158] program_check_exception+0x1d8/0x4fc
[  733.214309] [D6023F40] [C000E744] ret_from_except_full+0x0/0x4c
[  733.215076] --- Exception: 700 at 0x102a7100
[  733.215785]     LR = 0xdb9ef04

It is caused by the line
if (get_user(instword, (u32 __user *)(regs->nip)))
in arch/powerpc/kernel/traps.c:emulate_instruction()

I am not sure, if this is an indication for a bug, or just false alarm.
In case of false alarm, the debugging message should be made quiet
somehow, though.

-- 
Greetings Michael.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PowerPC: Sleeping function called from invalid context at emulate_instruction()
  2006-02-22 20:29 PowerPC: Sleeping function called from invalid context at emulate_instruction() Michael Buesch
@ 2006-02-23  4:22 ` Kumar Gala
  2006-02-23 22:57   ` Paul Mackerras
  0 siblings, 1 reply; 3+ messages in thread
From: Kumar Gala @ 2006-02-23  4:22 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Linux Kernel, Michael Buesch, linuxppc-dev list


On Feb 22, 2006, at 2:29 PM, Michael Buesch wrote:

> Hi,
>
> On a powerPC 32bit, I got the following debugging assertion failure:
>
> [  733.209827] Debug: sleeping function called from invalid context  
> at arch/powerpc/kernel/traps.c:697
> [  733.210682] in_atomic():0, irqs_disabled():1
> [  733.211347] Call Trace:
> [  733.211969] [D6023EB0] [C0007F84] show_stack+0x58/0x174  
> (unreliable)
> [  733.212765] [D6023EE0] [C0022C34] __might_sleep+0xbc/0xd0
> [  733.213523] [D6023EF0] [C000D158] program_check_exception 
> +0x1d8/0x4fc
> [  733.214309] [D6023F40] [C000E744] ret_from_except_full+0x0/0x4c
> [  733.215076] --- Exception: 700 at 0x102a7100
> [  733.215785]     LR = 0xdb9ef04
>
> It is caused by the line
> if (get_user(instword, (u32 __user *)(regs->nip)))
> in arch/powerpc/kernel/traps.c:emulate_instruction()
>
> I am not sure, if this is an indication for a bug, or just false  
> alarm.
> In case of false alarm, the debugging message should be made quiet
> somehow, though.

Paul,

Last time this was brought up we left it wondering why you had made  
program_check_exception() run with interrupts disabled.  Any further  
ideas on that one?

- kumar

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PowerPC: Sleeping function called from invalid context at emulate_instruction()
  2006-02-23  4:22 ` Kumar Gala
@ 2006-02-23 22:57   ` Paul Mackerras
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Mackerras @ 2006-02-23 22:57 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Linux Kernel, Michael Buesch, linuxppc-dev list

Kumar Gala writes:

> Last time this was brought up we left it wondering why you had made  
> program_check_exception() run with interrupts disabled.  Any further  
> ideas on that one?

I think it was so that if we are entering the kernel debugger, we do
so on the same cpu that the exception was generated on.  This should
fix it.

Paul.

diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 7509aa6..98660ae 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -814,6 +814,8 @@ void __kprobes program_check_exception(s
 		return;
 	}
 
+	local_irq_enable();
+
 	/* Try to emulate it if we should. */
 	if (reason & (REASON_ILLEGAL | REASON_PRIVILEGED)) {
 		switch (emulate_instruction(regs)) {

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-02-23 22:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-22 20:29 PowerPC: Sleeping function called from invalid context at emulate_instruction() Michael Buesch
2006-02-23  4:22 ` Kumar Gala
2006-02-23 22:57   ` Paul Mackerras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).