From: Johannes Berg <johannes@sipsolutions.net>
To: linuxppc-dev@ozlabs.org
Subject: illegal instructions / irqs disabled warning
Date: Wed, 14 Dec 2005 15:05:18 +0100 [thread overview]
Message-ID: <1134569118.3875.9.camel@localhost> (raw)
[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]
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
[ 2724.595568] Call trace:
[ 2724.595573] [c001fe54] __might_sleep+0xd4/0xf0
[ 2724.595592] [c0005ad8] program_check_exception+0xb8/0x520
[ 2724.595606] [c0004f04] ret_from_except_full+0x0/0x4c
when I wrote a program calling illegal instructions. I then checked out
why this happened and the cause is the might_sleep() here:
#define __get_user_check(x, ptr, size) \
({ \
long __gu_err = -EFAULT; \
unsigned long __gu_val = 0; \
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
might_sleep(); \
...
I then figured I could use __copy_from_user_inatomic to access the
instruction word to fix this (as far as I can tell only the warning is
annoying, because the instruction already failed at that point so it
must be in memory, right?)
But here's the actual question:
static inline unsigned long __copy_from_user(void *to,
const void __user *from, unsigned long size)
{
might_sleep();
return __copy_from_user_inatomic(to, from, size);
}
Does that mean __copy_from_user_inatomic isn't actually valid to call in
atomic context? Or is this only so that kernel developers that use
powerpc see the bugs their code would have on other platforms? The magic
in get_user_asm thoroughly confuses me.
[Somehow I got sidetracked. I only wanted to look at implementing
backtrace support for oprofile...]
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next reply other threads:[~2005-12-14 14:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-14 14:05 Johannes Berg [this message]
2005-12-14 14:41 ` illegal instructions / irqs disabled warning 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
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=1134569118.3875.9.camel@localhost \
--to=johannes@sipsolutions.net \
--cc=linuxppc-dev@ozlabs.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).