<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/bug.c, branch v3.10.44</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.44</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10.44'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-01-21T06:47:57Z</updated>
<entry>
<title>taint: add explicit flag to show whether lock dep is still OK.</title>
<updated>2013-01-21T06:47:57Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2013-01-21T06:47:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=373d4d099761cb1f637bed488ab3871945882273'/>
<id>urn:sha1:373d4d099761cb1f637bed488ab3871945882273</id>
<content type='text'>
Fix up all callers as they were before, with make one change: an
unsigned module taints the kernel, but doesn't turn off lockdep.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: put modules in list much earlier.</title>
<updated>2013-01-12T02:57:46Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2013-01-12T02:57:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1fb9341ac34825aa40354e74d9a2c69df7d2c304'/>
<id>urn:sha1:1fb9341ac34825aa40354e74d9a2c69df7d2c304</id>
<content type='text'>
Prarit's excellent bug report:
&gt; In recent Fedora releases (F17 &amp; F18) some users have reported seeing
&gt; messages similar to
&gt;
&gt; [   15.478160] kvm: Could not allocate 304 bytes percpu data
&gt; [   15.478174] PERCPU: allocation failed, size=304 align=32, alloc from
&gt; reserved chunk failed
&gt;
&gt; during system boot.  In some cases, users have also reported seeing this
&gt; message along with a failed load of other modules.
&gt;
&gt; What is happening is systemd is loading an instance of the kvm module for
&gt; each cpu found (see commit e9bda3b).  When the module load occurs the kernel
&gt; currently allocates the modules percpu data area prior to checking to see
&gt; if the module is already loaded or is in the process of being loaded.  If
&gt; the module is already loaded, or finishes load, the module loading code
&gt; releases the current instance's module's percpu data.

Now we have a new state MODULE_STATE_UNFORMED, we can insert the
module into the list (and thus guarantee its uniqueness) before we
allocate the per-cpu region.

Reported-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Tested-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
</content>
</entry>
<entry>
<title>bugs, x86: Fix printk levels for panic, softlockups and stack dumps</title>
<updated>2012-01-26T20:28:45Z</updated>
<author>
<name>Prarit Bhargava</name>
<email>prarit@redhat.com</email>
</author>
<published>2012-01-26T13:55:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b0f4c4b32c8e3aa0d44fc4dd6c40a9a9a8d66b63'/>
<id>urn:sha1:b0f4c4b32c8e3aa0d44fc4dd6c40a9a9a8d66b63</id>
<content type='text'>
rsyslog will display KERN_EMERG messages on a connected
terminal.  However, these messages are useless/undecipherable
for a general user.

For example, after a softlockup we get:

 Message from syslogd@intel-s3e37-04 at Jan 25 14:18:06 ...
 kernel:Stack:

 Message from syslogd@intel-s3e37-04 at Jan 25 14:18:06 ...
 kernel:Call Trace:

 Message from syslogd@intel-s3e37-04 at Jan 25 14:18:06 ...
 kernel:Code: ff ff a8 08 75 25 31 d2 48 8d 86 38 e0 ff ff 48 89
 d1 0f 01 c8 0f ae f0 48 8b 86 38 e0 ff ff a8 08 75 08 b1 01 4c 89 e0 0f 01 c9 &lt;e8&gt; ea 69 dd ff 4c 29 e8 48 89 c7 e8 0f bc da ff 49 89 c4 49 89

This happens because the printk levels for these messages are
incorrect. Only an informational message should be displayed on
a terminal.

I modified the printk levels for various messages in the kernel
and tested the output by using the drivers/misc/lkdtm.c kernel
modules (ie, softlockups, panics, hard lockups, etc.) and
confirmed that the console output was still the same and that
the output to the terminals was correct.

For example, in the case of a softlockup we now see the much
more informative:

 Message from syslogd@intel-s3e37-04 at Jan 25 10:18:06 ...
 BUG: soft lockup - CPU4 stuck for 60s!

instead of the above confusing messages.

AFAICT, the messages no longer have to be KERN_EMERG.  In the
most important case of a panic we set console_verbose().  As for
the other less severe cases the correct data is output to the
console and /var/log/messages.

Successfully tested by me using the drivers/misc/lkdtm.c module.

Signed-off-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Cc: dzickus@redhat.com
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Link: http://lkml.kernel.org/r/1327586134-11926-1-git-send-email-prarit@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>modules: Fix module_bug_list list corruption race</title>
<updated>2010-10-05T18:29:27Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-10-05T18:29:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5336377d6225959624146629ce3fc88ee8ecda3d'/>
<id>urn:sha1:5336377d6225959624146629ce3fc88ee8ecda3d</id>
<content type='text'>
With all the recent module loading cleanups, we've minimized the code
that sits under module_mutex, fixing various deadlocks and making it
possible to do most of the module loading in parallel.

However, that whole conversion totally missed the rather obscure code
that adds a new module to the list for BUG() handling.  That code was
doubly obscure because (a) the code itself lives in lib/bugs.c (for
dubious reasons) and (b) it gets called from the architecture-specific
"module_finalize()" rather than from generic code.

Calling it from arch-specific code makes no sense what-so-ever to begin
with, and is now actively wrong since that code isn't protected by the
module loading lock any more.

So this commit moves the "module_bug_{finalize,cleanup}()" calls away
from the arch-specific code, and into the generic code - and in the
process protects it with the module_mutex so that the list operations
are now safe.

Future fixups:
 - move the module list handling code into kernel/module.c where it
   belongs.
 - get rid of 'module_bug_list' and just use the regular list of modules
   (called 'modules' - imagine that) that we already create and maintain
   for other reasons.

Reported-and-tested-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Adrian Bunk &lt;bunk@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/bug.c: add oops end marker to WARN implementation</title>
<updated>2010-08-11T15:59:22Z</updated>
<author>
<name>Anton Blanchard</name>
<email>anton@samba.org</email>
</author>
<published>2010-08-11T01:03:30Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=863a6049202412a6d655d052eb1c45ca7dd74a83'/>
<id>urn:sha1:863a6049202412a6d655d052eb1c45ca7dd74a83</id>
<content type='text'>
We are missing the oops end marker for the exception based WARN implementation
in lib/bug.c. This is useful for logfile analysis tools.

Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
Cc: "Kirill A. Shutemov" &lt;kirill@shutemov.name&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/bug.c: make WARN implementation match the kernel/panic.c one</title>
<updated>2010-08-11T15:59:22Z</updated>
<author>
<name>Anton Blanchard</name>
<email>anton@samba.org</email>
</author>
<published>2010-08-11T01:03:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e2e7e093259d4c6b73b432122974393d6fcdfc2a'/>
<id>urn:sha1:e2e7e093259d4c6b73b432122974393d6fcdfc2a</id>
<content type='text'>
There are a few issues with the exception based WARN implementation in
lib/bug.c:

- Inconsistent printk flags. The "cut here" line is printed at KERN_EMERG, so
  the console and all logged in users see the single line:

------------[ cut here ]------------

  for each WARN. Fix this so we print everything at KERN_WARNING to match the
  kernel/panic.c version.

- The lib/bug.c WARN would print "Badness at". Change it to match the
  kernel/panic.c version which prints "WARNING: at".

- Print the list of modules, similar to kernel/panic.c of modules, similar to
  kernel/panic.c

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;
Cc: "Kirill A. Shutemov" &lt;kirill@shutemov.name&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>panic: Allow warnings to set different taint flags</title>
<updated>2010-05-19T07:36:48Z</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2010-04-03T18:34:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b2be05273a1744d175bf4b67f6665637bb9ac7a8'/>
<id>urn:sha1:b2be05273a1744d175bf4b67f6665637bb9ac7a8</id>
<content type='text'>
WARN() is used in some places to report firmware or hardware bugs that
are then worked-around.  These bugs do not affect the stability of the
kernel and should not set the flag for TAINT_WARN.  To allow for this,
add WARN_TAINT() and WARN_TAINT_ONCE() macros that take a taint number
as argument.

Architectures that implement warnings using trap instructions instead
of calls to warn_slowpath_*() now implement __WARN_TAINT(taint)
instead of __WARN().

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Acked-by: Helge Deller &lt;deller@gmx.de&gt;
Tested-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
Signed-off-by: David Woodhouse &lt;David.Woodhouse@intel.com&gt;
</content>
</entry>
<entry>
<title>allow bug table entries to use relative pointers (and use it on x86-64)</title>
<updated>2008-12-16T17:40:32Z</updated>
<author>
<name>Jan Beulich</name>
<email>jbeulich@novell.com</email>
</author>
<published>2008-12-16T11:40:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b93a531e315e97ef00367099e6b5f19651936e20'/>
<id>urn:sha1:b93a531e315e97ef00367099e6b5f19651936e20</id>
<content type='text'>
Impact: reduce bug table size

This allows reducing the bug table size by half. Perhaps there are
other 64-bit architectures that could also make use of this.

Signed-off-by: Jan Beulich &lt;jbeulich@novell.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>lib: taint kernel in common report_bug() WARN path.</title>
<updated>2008-07-04T17:40:05Z</updated>
<author>
<name>Paul Mundt</name>
<email>lethal@linux-sh.org</email>
</author>
<published>2008-07-04T16:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=da9eac8990dc614ab4756f2a3d84870b675f1f1e'/>
<id>urn:sha1:da9eac8990dc614ab4756f2a3d84870b675f1f1e</id>
<content type='text'>
Commit 95b570c9cef3b12356454c7112571b7e406b4b51 ("Taint kernel after
WARN_ON(condition)") introduced a TAINT_WARN that was implemented for
all architectures using the generic warn_on_slowpath(), which excluded
any architecture that set HAVE_ARCH_WARN_ON.

As all of the architectures that implement their own WARN_ON() all go
through the report_bug() path (specifically handling BUG_TRAP_TYPE_WARN),
taint the kernel there as well for consistency.

Tested on avr32 and sh. Also relevant for s390, parisc, and powerpc.

Signed-off-by: Haavard Skinnemoen &lt;hskinnemoen@atmel.com&gt;
Signed-off-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
Acked-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>generic bug: use show_regs() instead of dump_stack()</title>
<updated>2007-07-16T16:05:51Z</updated>
<author>
<name>Heiko Carstens</name>
<email>heiko.carstens@de.ibm.com</email>
</author>
<published>2007-07-16T06:41:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=608e2619682e951f525b08e7a48669a3c0263b41'/>
<id>urn:sha1:608e2619682e951f525b08e7a48669a3c0263b41</id>
<content type='text'>
The current generic bug implementation has a call to dump_stack() in case a
WARN_ON(whatever) gets hit.  Since report_bug(), which calls dump_stack(),
gets called from an exception handler we can do better: just pass the
pt_regs structure to report_bug() and pass it to show_regs() in case of a
warning.  This will give more debug informations like register contents,
etc...  In addition this avoids some pointless lines that dump_stack()
emits, since it includes a stack backtrace of the exception handler which
is of no interest in case of a warning.  E.g.  on s390 the following lines
are currently always present in a stack backtrace if dump_stack() gets
called from report_bug():

 [&lt;000000000001517a&gt;] show_trace+0x92/0xe8)
 [&lt;0000000000015270&gt;] show_stack+0xa0/0xd0
 [&lt;00000000000152ce&gt;] dump_stack+0x2e/0x3c
 [&lt;0000000000195450&gt;] report_bug+0x98/0xf8
 [&lt;0000000000016cc8&gt;] illegal_op+0x1fc/0x21c
 [&lt;00000000000227d6&gt;] sysc_return+0x0/0x10

Acked-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
Acked-by: Haavard Skinnemoen &lt;hskinnemoen@atmel.com&gt;
Cc: Andi Kleen &lt;ak@suse.de&gt;
Cc: Kyle McMartin &lt;kyle@parisc-linux.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Paul Mundt &lt;lethal@linux-sh.org&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
