<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/arch/parisc/kernel/unwind.c, branch v4.10</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Replace &lt;asm/uaccess.h&gt; with &lt;linux/uaccess.h&gt; globally</title>
<updated>2016-12-24T19:46:01+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-12-24T19:46:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7c0f6ba682b9c7632072ffbedf8d328c8f3c42ba'/>
<id>7c0f6ba682b9c7632072ffbedf8d328c8f3c42ba</id>
<content type='text'>
This was entirely automated, using the script by Al:

  PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*&lt;asm/uaccess.h&gt;'
  sed -i -e "s!$PATT!#include &lt;linux/uaccess.h&gt;!" \
        $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)

to do the replacement at the end of the merge window.

Requested-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was entirely automated, using the script by Al:

  PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*&lt;asm/uaccess.h&gt;'
  sed -i -e "s!$PATT!#include &lt;linux/uaccess.h&gt;!" \
        $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)

to do the replacement at the end of the merge window.

Requested-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parisc: Fix backtrace on PA-RISC</title>
<updated>2016-06-04T20:05:07+00:00</updated>
<author>
<name>Mikulas Patocka</name>
<email>mpatocka@redhat.com</email>
</author>
<published>2011-06-28T22:48:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=be24a89700eef61bedaba40f3b05ef07f5806e38'/>
<id>be24a89700eef61bedaba40f3b05ef07f5806e38</id>
<content type='text'>
This patch fixes backtrace on PA-RISC

There were several problems:

1) The code that decodes instructions handles instructions that subtract
from the stack pointer incorrectly. If the instruction subtracts the
number X from the stack pointer the code increases the frame size by
(0x100000000-X).  This results in invalid accesses to memory and
recursive page faults.

2) Because gcc reorders blocks, handling instructions that subtract from
the frame pointer is incorrect. For example, this function
	int f(int a)
	{
		if (__builtin_expect(a, 1))
			return a;
		g();
		return a;
	}
is compiled in such a way, that the code that decreases the stack
pointer for the first "return a" is placed before the code for "g" call.
If we recognize this decrement, we mistakenly believe that the frame
size for the "g" call is zero.

To fix problems 1) and 2), the patch doesn't recognize instructions that
decrease the stack pointer at all. To further safeguard the unwind code
against nonsense values, we don't allow frame size larger than
Total_frame_size.

3) The backtrace is not locked. If stack dump races with module unload,
invalid table can be accessed.

This patch adds a spinlock when processing module tables.

Note, that for correct backtrace, you need recent binutils.
Binutils 2.18 from Debian 5 produce garbage unwind tables.
Binutils 2.21 work better (it sometimes forgets function frames, but at
least it doesn't generate garbage).

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes backtrace on PA-RISC

There were several problems:

1) The code that decodes instructions handles instructions that subtract
from the stack pointer incorrectly. If the instruction subtracts the
number X from the stack pointer the code increases the frame size by
(0x100000000-X).  This results in invalid accesses to memory and
recursive page faults.

2) Because gcc reorders blocks, handling instructions that subtract from
the frame pointer is incorrect. For example, this function
	int f(int a)
	{
		if (__builtin_expect(a, 1))
			return a;
		g();
		return a;
	}
is compiled in such a way, that the code that decreases the stack
pointer for the first "return a" is placed before the code for "g" call.
If we recognize this decrement, we mistakenly believe that the frame
size for the "g" call is zero.

To fix problems 1) and 2), the patch doesn't recognize instructions that
decrease the stack pointer at all. To further safeguard the unwind code
against nonsense values, we don't allow frame size larger than
Total_frame_size.

3) The backtrace is not locked. If stack dump races with module unload,
invalid table can be accessed.

This patch adds a spinlock when processing module tables.

Note, that for correct backtrace, you need recent binutils.
Binutils 2.18 from Debian 5 produce garbage unwind tables.
Binutils 2.21 work better (it sometimes forgets function frames, but at
least it doesn't generate garbage).

Signed-off-by: Mikulas Patocka &lt;mpatocka@redhat.com&gt;
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parisc: use kernel_text_address() in unwind functions</title>
<updated>2013-11-30T21:08:54+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2013-11-30T20:23:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c790b41bac83512dc67da89b582daa6f4e1fab07'/>
<id>c790b41bac83512dc67da89b582daa6f4e1fab07</id>
<content type='text'>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parisc: unwind - optimise linked-list searches for modules</title>
<updated>2010-10-22T01:12:19+00:00</updated>
<author>
<name>Phil Carmody</name>
<email>ext-phil.2.carmody@nokia.com</email>
</author>
<published>2010-09-10T10:47:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b1b1d4a6f244eb9513f006a188f7ed30d5014de5'/>
<id>b1b1d4a6f244eb9513f006a188f7ed30d5014de5</id>
<content type='text'>
Having many dozens of modules, the searches down the linked
list of sections would dominate the lookup time, dwarfing
any savings from the binary search within the section.

A simple move-to-front optimisation exploits the commonality
of the code paths taken, and in simple real-world tests
on other architectures reduced the number of steps in the
search to barely more than 1.

Signed-off-by: Phil Carmody &lt;ext-phil.2.carmody@nokia.com&gt;
Signed-off-by: Kyle McMartin &lt;kyle@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Having many dozens of modules, the searches down the linked
list of sections would dominate the lookup time, dwarfing
any savings from the binary search within the section.

A simple move-to-front optimisation exploits the commonality
of the code paths taken, and in simple real-world tests
on other architectures reduced the number of steps in the
search to barely more than 1.

Signed-off-by: Phil Carmody &lt;ext-phil.2.carmody@nokia.com&gt;
Signed-off-by: Kyle McMartin &lt;kyle@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parisc: use sort() instead of home-made implementation (v2)</title>
<updated>2009-12-16T03:48:55+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2009-11-06T23:07:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8f78df872d463ac43315916663b3e688ebb2422f'/>
<id>8f78df872d463ac43315916663b3e688ebb2422f</id>
<content type='text'>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Randolph Chung &lt;tausq@parisc-linux.org&gt;
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Randolph Chung &lt;tausq@parisc-linux.org&gt;
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parisc: add CALLER_ADDR{0-6} macros</title>
<updated>2009-12-16T03:48:54+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2009-10-25T21:48:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=11e178091f6a9c5ca479f8a276b9dd0dfacf8fc4'/>
<id>11e178091f6a9c5ca479f8a276b9dd0dfacf8fc4</id>
<content type='text'>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parisc: fix unwind with recent gcc versions</title>
<updated>2009-11-30T16:20:24+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2009-11-28T20:33:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=33a932d14323b957a4e17a6c8428d3f048a30822'/>
<id>33a932d14323b957a4e17a6c8428d3f048a30822</id>
<content type='text'>
kernel unwinding is broken with gcc &gt;= 4.x.  Part of the problem is that
binutils seems very sensitive to where the unwind information is stored.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
kernel unwinding is broken with gcc &gt;= 4.x.  Part of the problem is that
binutils seems very sensitive to where the unwind information is stored.

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parisc: fix GFP_KERNEL use while atomic in unwinder</title>
<updated>2009-01-05T18:15:25+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2008-12-17T22:57:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e0e7ed4811ce32d48ca8ee9fd136357d093243a9'/>
<id>e0e7ed4811ce32d48ca8ee9fd136357d093243a9</id>
<content type='text'>
Since unwind_frame_init_from_blocked_task() may be called from
interrupt/in_atomic context, it needs to kmalloc() memory with
GFP_ATOMIC instead of GFP_KERNEL.

This fixes this warning (ShowTasks called from sysrq handler):

BUG: sleeping function called from invalid context at mm/slab.c:3044
in_atomic(): 1, irqs_disabled(): 1, pid: 2119, name: miniruby
Backtrace:
 [&lt;10132e78&gt;] __might_sleep+0x4c/0x118
 [&lt;1018f644&gt;] kmem_cache_alloc+0x2c/0xb4
 [&lt;1011bae0&gt;] unwind_frame_init_from_blocked_task+0x30/0xa0
 [&lt;1010fd3c&gt;] parisc_show_stack+0x3c/0xac
 [&lt;10132c7c&gt;] show_state_filter+0x80/0xd8
 [&lt;102f4074&gt;] __handle_sysrq+0xd0/0x1b0
 [&lt;102f9558&gt;] receive_chars+0x22c/0x318
 [&lt;102f9940&gt;] serial8250_handle_port+0x40/0x88
 [&lt;102f9a8c&gt;] serial8250_interrupt+0x104/0x10c
 [&lt;10161920&gt;] handle_IRQ_event+0x44/0x94
 [&lt;10161acc&gt;] __do_IRQ+0x15c/0x1dc
 [&lt;102c442c&gt;] superio_interrupt+0x74/0xa8
 [&lt;10161920&gt;] handle_IRQ_event+0x44/0x94
 [&lt;10161acc&gt;] __do_IRQ+0x15c/0x1dc
 [&lt;10110fb4&gt;] do_cpu_irq_mask+0x90/0xbc
 [&lt;10114068&gt;] intr_return+0x0/0x4

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since unwind_frame_init_from_blocked_task() may be called from
interrupt/in_atomic context, it needs to kmalloc() memory with
GFP_ATOMIC instead of GFP_KERNEL.

This fixes this warning (ShowTasks called from sysrq handler):

BUG: sleeping function called from invalid context at mm/slab.c:3044
in_atomic(): 1, irqs_disabled(): 1, pid: 2119, name: miniruby
Backtrace:
 [&lt;10132e78&gt;] __might_sleep+0x4c/0x118
 [&lt;1018f644&gt;] kmem_cache_alloc+0x2c/0xb4
 [&lt;1011bae0&gt;] unwind_frame_init_from_blocked_task+0x30/0xa0
 [&lt;1010fd3c&gt;] parisc_show_stack+0x3c/0xac
 [&lt;10132c7c&gt;] show_state_filter+0x80/0xd8
 [&lt;102f4074&gt;] __handle_sysrq+0xd0/0x1b0
 [&lt;102f9558&gt;] receive_chars+0x22c/0x318
 [&lt;102f9940&gt;] serial8250_handle_port+0x40/0x88
 [&lt;102f9a8c&gt;] serial8250_interrupt+0x104/0x10c
 [&lt;10161920&gt;] handle_IRQ_event+0x44/0x94
 [&lt;10161acc&gt;] __do_IRQ+0x15c/0x1dc
 [&lt;102c442c&gt;] superio_interrupt+0x74/0xa8
 [&lt;10161920&gt;] handle_IRQ_event+0x44/0x94
 [&lt;10161acc&gt;] __do_IRQ+0x15c/0x1dc
 [&lt;10110fb4&gt;] do_cpu_irq_mask+0x90/0xbc
 [&lt;10114068&gt;] intr_return+0x0/0x4

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>parisc: initialize unwinder much earlier</title>
<updated>2008-10-10T16:32:30+00:00</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2008-09-11T14:17:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f0514ae323f19ba1ad4bea4174ea274c812f7eee'/>
<id>f0514ae323f19ba1ad4bea4174ea274c812f7eee</id>
<content type='text'>
The unwinder was being initialized way too late to be any use
debugging early boot crashes. Instead of relying on module_init
initcalls to initialize it, let's do it explicitly as early as
we can.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The unwinder was being initialized way too late to be any use
debugging early boot crashes. Instead of relying on module_init
initcalls to initialize it, let's do it explicitly as early as
we can.

Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PARISC] Kill incorrect cast warning in unwinder</title>
<updated>2007-10-18T07:59:04+00:00</updated>
<author>
<name>Kyle McMartin</name>
<email>kyle@mcmartin.ca</email>
</author>
<published>2007-10-18T07:03:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7819994312fd4c3c04456abb6a64c810ecde3db4'/>
<id>7819994312fd4c3c04456abb6a64c810ecde3db4</id>
<content type='text'>
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
</pre>
</div>
</content>
</entry>
</feed>
