linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Johannes Berg" <johannes@sipsolutions.net>
To: "Paul Mackerras" <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: illegal instructions / irqs disabled warning
Date: Thu, 15 Dec 2005 10:44:46 +0100 (CET)	[thread overview]
Message-ID: <4590.131.234.232.31.1134639886.squirrel@secure.sipsolutions.net> (raw)
In-Reply-To: <17312.38814.551675.906916@cargo.ozlabs.ibm.com>

Paul Mackerras wrote:
>> So I run across this warning:
>> [ 2724.595549] Debug: sleeping function called from invalid context at
>> arch/ppc/kernel/traps.c:528
>> [ 2724.595563] in_atomic():0, irqs_disabled():1
>
> Hmmm.  What kernel version is this?  I assume you are using ARCH=ppc,
> is that right?

2.6.15-rc5, IIRC (might have been rc1, I currently need to use both
kernels depending on what I want to do), and yes, ARCH=ppc.

> No, it doesn't mean that.  However, if the page isn't in memory,
> __copy_from_user_inatomic won't try to bring it in if it has been
> called from an atomic context (i.e. preempt or interrupts disabled).

Good, thanks. So essentially __copy_from_user has the same logic (since it
just calls __copy_from_user_inatomic) but calls might_sleep() to show the
developer what he's doing wrong although it won't actually hurt. Right?

> The real question is why we have interrupts disabled in the illegal
> instruction handler.  There was a reason why I wanted interrupts
> disabled on entry to program_check_exception which I don't recall
> clearly at the moment, but I think program_check_exception should be
> doing a local_irq_enable() at some point (and it also shouldn't be
> trying to emulate instructions for the kernel).

I don't have the code here right now but I did have a userspace program
that it tried to emulate (so I'm not sure if it would try to emulate
kernel instructions). And it wouldn't emulate that instruction, my program
died with SIGILL, but obviously it still needs to load it to see what kind
of instruction it was.

johannes

  parent reply	other threads:[~2005-12-15  9:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-14 14:05 illegal instructions / irqs disabled warning Johannes Berg
2005-12-14 14:41 ` Kumar Gala
2005-12-14 14:49   ` Johannes Berg
2005-12-14 15:07     ` Kumar Gala
2005-12-14 15:13       ` Johannes Berg
2005-12-14 21:46 ` Andy Fleming
2005-12-15  9:40   ` Johannes Berg
2005-12-14 22:07 ` Paul Mackerras
2005-12-14 22:29   ` Kumar Gala
2005-12-15  9:44   ` Johannes Berg [this message]
2005-12-15 14:04     ` Kumar Gala
2005-12-15 14:10       ` Johannes Berg
2005-12-15 15:47         ` Kumar Gala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4590.131.234.232.31.1134639886.squirrel@secure.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).