History log of /arch/sh/kernel/traps.c
Revision Date Author Comments
373d4d099761cb1f637bed488ab3871945882273 21-Jan-2013 Rusty Russell <rusty@rustcorp.com.au> taint: add explicit flag to show whether lock dep is still OK.

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 <rusty@rustcorp.com.au>
5f857bce21cfd0531dc7d4daac74d976caf6166b 14-Jun-2012 Paul Mundt <lethal@linux-sh.org> sh: Consolidate die definitions for trap handlers.

This kills off the _64 versions and consolidates on the more robust _32
versions instead.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e839ca528718e68cad32a307dc9aabf01ef3eb05 28-Mar-2012 David Howells <dhowells@redhat.com> Disintegrate asm/system.h for SH

Disintegrate asm/system.h for SH.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-sh@vger.kernel.org
9d56dd3b083a3bec56e9da35ce07baca81030b03 25-Jan-2010 Paul Mundt <lethal@linux-sh.org> sh: Mass ctrl_in/outX to __raw_read/writeX conversion.

The old ctrl in/out routines are non-portable and unsuitable for
cross-platform use. While drivers/sh has already been sanitized, there
is still quite a lot of code that is not. This converts the arch/sh/ bits
over, which permits us to flag the routines as deprecated whilst still
building with -Werror for the architecture code, and to ensure that
future users are not added.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
626ac8e1388ac128495a3b7188e9d86464de6c5b 12-Nov-2009 Paul Mundt <lethal@linux-sh.org> sh64: Fix up the CONFIG_GENERIC_BUG=n build.

sh64 doesn't use GENERIC_BUG, which presently causes the handle_BUG()
code to blow up. Fix up the dependencies and get it all building again.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
731ba3301de41d2ffae9dd3e0f85f7361d8ad8f4 14-Oct-2009 Paul Mundt <lethal@linux-sh.org> sh: Count NMIs in irq_cpustat_t.

This plugs in support for NMI counting per-CPU via irq_cpustat_t.
Modelled after the x86 implementation.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1e1030dccb1084c8a38976d3656aab1d50d762da 01-Sep-2009 Paul Mundt <lethal@linux-sh.org> sh: nmi_debug support.

This implements support for NMI debugging that was shamelessly copied
from the avr32 port. A bit of special magic is needed in the interrupt
exception path given that the NMI exception handler is stubbed in to the
regular exception handling table despite being reported in INTEVT. So we
mangle the lookup and kick off an EXPEVT-style exception dispatch from
the INTEVT path for exceptions that do_IRQ() has no chance of handling.
As a result, we also drop the evt2irq() conversion from the do_IRQ() path
and just do it in assembly.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e115f2c17cbceee93b34d787a7a4a867fc73e7b4 21-Aug-2009 Paul Mundt <lethal@linux-sh.org> sh: unwinder: Use a special bug flag for unwinder traps.

This simplifies the unwinder trap handling, dropping the use of the
special trapa vector and simply piggybacking on top of the BUG support. A
new BUGFLAG_UNWINDER is added for flagging the unwinder fault, before
continuing on with regular BUG dispatch.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
b344e24a8e8ceda83d1285d22e3e5baf4f5e42d3 16-Aug-2009 Matt Fleming <matt@console-pimps.org> sh: unwinder: Introduce UNWINDER_BUG() and UNWINDER_BUG_ON()

We can't assume that if we execute the unwinder code and the unwinder
was already running that it has faulted. Clearly two kernel threads can
invoke the unwinder at the same time and may be running simultaneously.

The previous approach used BUG() and BUG_ON() in the unwinder code to
detect whether the unwinder was incapable of unwinding the stack, and
that the next available unwinder should be used instead. A better
approach is to explicitly invoke a trap handler to switch unwinders when
the current unwinder cannot continue.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
0ec39885b237c35109644f5d8232228026a72715 17-Jun-2009 Magnus Damm <damm@igel.co.jp> sh: unbreak WARN_ON()

Fix WARN_ON() by modifying the bug trap handling code to
always return in the in-kernel instruction pointer case.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2bcfffa42309b6f73042c62459bf5207762a271d 09-May-2009 Paul Mundt <lethal@linux-sh.org> sh: Rename opcode_t to insn_size_t.

This is now clashing with a driver, so just rename it.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
9a33fc217d2248838d52f8ef214b1909073f3eb4 19-May-2008 Paul Mundt <lethal@linux-sh.org> sh: Make is_valid_bugaddr() more intelligent on nommu.

Currently is_valid_bugaddr() is true for anything >= PAGE_OFFSET, which
happens to be 0 on nommu configurations. Make this a bit smarter by just
reading in the opcode and comparing it against the trap type that we
already know. Follows the logic from avr32.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
47a3eb95560ea525a2dfbee1c4e7f03a45fd2207 26-Nov-2007 Paul Mundt <lethal@linux-sh.org> sh: Fix the arch/sh/kernel/traps.c build for sh32.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
5a4f7c66be981c6b5f44a4d66a14ea6ac9b7b6b0 20-Nov-2007 Paul Mundt <lethal@linux-sh.org> sh: Share bug/debug traps across _32 and _64.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2f75fbf16bd87f36f3e72396b603bc6689e04be4 10-Nov-2007 Paul Mundt <lethal@linux-sh.org> sh: Move in the SH-5 traps.c impl.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
19c5870c0eefd27c6d09d867465e0571262e05d0 19-Oct-2007 Alexey Dobriyan <adobriyan@openvz.org> Use helpers to obtain task pid in printks (arch code)

One of the easiest things to isolate is the pid printed in kernel log.
There was a patch, that made this for arch-independent code, this one makes
so for arch/xxx files.

It took some time to cross-compile it, but hopefully these are all the
printks in arch code.

Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
aba1030a7e529ec9fe47a8cfc06d12a39180fa71 21-Sep-2007 Paul Mundt <lethal@linux-sh.org> sh: Bring SMP support back from the dead.

There was a very preliminary bunch of SMP code scattered around for the
SH7604 microcontrollers from way back when, and it has mostly suffered
bitrot since then. With the tree already having been slowly getting
prepped for SMP, this plugs in most of the remaining platform-independent
bits.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e0a3647fd7729bee1ed9667ce5d8eb88f0604138 01-Aug-2007 Paul Mundt <lethal@linux-sh.org> sh: Fix SH-X3 FPU exception handling.

SH-X3 has the FPU exceptions on different vectors completely,
patch in do_fpu_state_restore() to the proper vectors.

Results in a much happier userspace.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
bcdcd8e725b923ad7c0de809680d5d5658a7bf8c 17-Jul-2007 Pavel Emelianov <xemul@openvz.org> Report that kernel is tainted if there was an OOPS

If the kernel OOPSed or BUGed then it probably should be considered as
tainted. Thus, all subsequent OOPSes and SysRq dumps will report the
tainted kernel. This saves a lot of time explaining oddities in the
calltraces.

Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
[ Added parisc patch from Matthew Wilson -Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
608e2619682e951f525b08e7a48669a3c0263b41 16-Jul-2007 Heiko Carstens <heiko.carstens@de.ibm.com> generic bug: use show_regs() instead of dump_stack()

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():

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

Acked-by: Jeremy Fitzhardinge <jeremy@goop.org>
Acked-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Kyle McMartin <kyle@parisc-linux.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
5527398218aae85f37552a69fad163fa500c39e4 18-Jun-2007 Paul Mundt <lethal@linux-sh.org> sh: oops_enter()/oops_exit() in die().

As Russell helpfully pointed out on linux-arch:

http://marc.info/?l=linux-arch&m=118208089204630&w=2

We were missing the oops_enter/exit() in the sh die() implementation.
As we do support lockdep, it's beneficial to add these calls so lockdep
properly disables itself in the die() case.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
b66d51cb8039cf80b8aa5b157ed055cdea811104 01-Jun-2007 Paul Mundt <lethal@linux-sh.org> sh: Tidy compiler warnings for SH-2A build.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
882c12c4e1a95e55227f06dbb99eca90f237c018 14-May-2007 Paul Mundt <lethal@linux-sh.org> sh: Shut up SH2-DSP compile warnings.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e08f457c7c0cc7720f28349f8780ea752c063441 13-May-2007 Paul Mundt <lethal@linux-sh.org> sh: __user annotations for __get/__put_user().

This adds in some more __user annotations. These weren't being
handled properly in some of the __get_user and __put_user paths,
so tidy those up.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e113276624104d9c3b25f333d8dd999b804d980a 15-May-2007 Paul Mundt <lethal@linux-sh.org> sh: Wire up kdump crash kernel exec in die().

Now that we have the basic kdump support in place, add it in to
die() so we can enter the crash kernel automatically.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
e868d61272caa648214046a096e5a6bfc068dc8c 14-May-2007 Simon Arlott <simon@fire.lp0.eu> spelling fixes: arch/sh/

Spelling fixes in arch/sh/.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
b118ca572db5af832c6fc1af7b301105378d1a08 09-May-2007 Paul Mundt <lethal@linux-sh.org> sh: Convert to common die chain.

This went in immediately after SH added the die chain notifiers,
so move over to that instead..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
53f983a90d7908bcece51f86180c7c9b575a1e4d 08-May-2007 Paul Mundt <lethal@linux-sh.org> sh: Fix PC adjustments for varying opcode length.

There are a few different cases for figuring out how to
size the instruction. We read in the instruction located
at regs->pc - 4 when rewinding the opcode to figure out if
there's a 32-bit opcode before the faulting instruction, with
a default of a - 2 adjustment on a mismatch. In practice this
works for the cases where pc - 4 is just another 16-bit opcode,
or we happen to have a 32-bit and a 16-bit immediately
preceeding the pc value.

In the cases where we aren't rewinding, this is much less ugly..

We also don't bother fixing up the places where we're explicitly
dealing with 16-bit instructions, since this might lead to
confusion regarding the encoding size possibilities on other
CPU variants.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
3a2e117e220f000f95187ea1e1bbe83b0ed5fdfb 01-May-2007 Paul Mundt <lethal@linux-sh.org> sh: Add die chain notifiers.

Add the atomic die chains in, kprobes needs these.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
fa69151173b1fc6fa3ced0edd5c2ea83b5d32bc1 08-Mar-2007 Paul Mundt <lethal@linux-sh.org> sh: generic BUG() support.

Wire up GENERIC_BUG for SH. This moves off of the special bug
frame and on to the generic struct bug_entry. Roughly the same
semantics are retained, and we can kill off some of the verbose
BUG() reporting code.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
11c1965687b0a472add948d4240dfe65a2fcb298 25-Dec-2006 Paul Mundt <lethal@linux-sh.org> sh: Fixup cpu_data references for the non-boot CPUs.

There are a lot of bogus cpu_data-> references that only end up working
for the boot CPU, convert these to current_cpu_data to fixup SMP.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
86b67ef7518d1fcd4489dc464d4c33a274a1c635 01-Jan-2007 Nobuhiro Iwamatsu <hemamu@t-base.ne.jp> sh: Fix handle_BUG() compile error.

handle_BUG() uses TRAPA_BUG_OPCODE which is only defined for
CONFIG_BUG, make sure it's not built when CONFIG_BUG=n.

Signed-off-by: Nobuhiro Iwamatsu <hemamu@t-base.ne.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
dc34d312c7b25d5d0f54c16d143a9526936e5d38 08-Dec-2006 Paul Mundt <lethal@linux-sh.org> sh: BUG() handling through trapa vector.

Previously we haven't been doing anything with verbose BUG() reporting,
and we've been relying on the oops path for handling BUG()'s, which is
rather sub-optimal.

This switches BUG handling to use a fixed trapa vector (#0x3e) where we
construct a small bug frame post trapa instruction to get the context
right. This also makes it trivial to wire up a DIE_BUG for the atomic
die chain, which we couldn't really do before.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
9b8c90eb0d916f6802f8bbac79f61aca6ac533e8 06-Dec-2006 Paul Mundt <lethal@linux-sh.org> sh: show held locks in stack trace with lockdep.

Follows the same change as other architectures..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
b5a1bcbee434b843c8850a968d9a6c7541f1be9d 21-Nov-2006 Stuart Menefy <stuart.menefy@st.com> sh: Set up correct siginfo structures for page faults.

Remove the previous saving of fault codes into the thread_struct
as they are never used, and appeared to be inherited from x86.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
f0bc814cfbc212683c882e58b3d1afec6b3e3aa3 21-Nov-2006 Stuart Menefy <stuart.menefy@st.com> sh: gcc4 support.

This fixes up the kernel for gcc4. The existing exception handlers
needed some wrapping for pt_regs access, acessing the registers
via a RELOC_HIDE() pointer.

The strcpy() issues popped up here too, so add -ffreestanding and
kill off the symbol export.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
710ee0cc45d095f7697821b330a3f8280205c2be 05-Nov-2006 Paul Mundt <lethal@linux-sh.org> sh: SE7206 build fixes.

A number of API changes happened underneath the 7206 patches, update
for everything that broke.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
0983b31849bbe1fe82520947acc1bec97c457d4b 05-Nov-2006 Yoshinori Sato <ysato@users.sourceforge.jp> sh: Wire up division and address error exceptions on SH-2A.

SH-2A has special division hardware as opposed to a full-fledged FPU,
wire up the exception handlers for this.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1f666587dbf6bc660b23d8dd8abb6c572ce3eae5 19-Oct-2006 Paul Mundt <lethal@linux-sh.org> sh: Fix exception_handling_table alignment.

With the recent change ripping out interrupt_table, explicit
padding of the table was missing, causing bad things to happen
when manually inserting handlers in to the table. This problem
particularly showed up in relation to do_fpu_state_restore()
which was inserted quite deeply in to the table and ended up
scribbling over a slab object.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
6b0022305f80cf249de69e746f6f5ccf7ffc5b7c 12-Oct-2006 Paul Mundt <lethal@linux-sh.org> sh: Proper show_stack/show_trace() implementation.

This splits out some of the previous show_stack() implementation which
was mostly doing the show_trace() work without actually dumping any of
the stack contents. This now gets split in to two sections, where we
do the fetching of the stack pointer and subsequent stack dumping in
show_stack(), while moving the call trace in to show_trace().

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
a6a31139897a5e539efe7ad3b7bd351fa9673ce8 27-Sep-2006 Paul Mundt <lethal@linux-sh.org> sh: Add support for 4K stacks.

This enables support for 4K stacks on SH.

Currently this depends on DEBUG_KERNEL, but likely all boards
will switch to this as the default in the future.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
4b565680d16300acab0ff167e24f0ea289a6bd5d 27-Sep-2006 Takashi YOSHII <takasi-y@ops.dti.ne.jp> sh: math-emu support

This implements initial math-emu support, aimed primarily at SH-3.

Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
765ae317ce030217af556dc46bec238dab15091e 27-Sep-2006 Paul Mundt <lethal@linux-sh.org> sh: Fixup some uninitialized spinlocks.

Fix use of uninitialized spinlocks, caught with spinlock debugging..

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
6ab3d5624e172c553004ecc862bfeac16d9d68b7 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de> Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!