]> git.baikalelectronics.ru Git - kernel.git/commit
parisc: add kernel stack overflow check
authorHelge Deller <deller@gmx.de>
Tue, 7 May 2013 19:28:52 +0000 (19:28 +0000)
committerHelge Deller <deller@gmx.de>
Tue, 7 May 2013 19:34:07 +0000 (21:34 +0200)
commite0b0d778cdd315e3c4200fc53134bf1c1678b2c8
treef537999c1134549b14fce04a020e6e4d23d03d4c
parent078364bdc56b757c64a3b3dfd85aeacb8fb64d11
parisc: add kernel stack overflow check

Add the CONFIG_DEBUG_STACKOVERFLOW config option to enable checks to
detect kernel stack overflows.

Stack overflows can not be detected reliable since we do not want to
introduce too much overhead.

Instead, during irq processing in do_cpu_irq_mask() we check kernel
stack usage of the interrupted kernel process. Kernel threads can be
easily detected by checking the value of space register 7 (sr7) which
is zero when running inside the kernel.

Since THREAD_SIZE is 16k and PAGE_SIZE is 4k, reduce the alignment of
the init thread to the lower value (PAGE_SIZE) in the kernel
vmlinux.ld.S linker script.

Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/Kconfig.debug
arch/parisc/include/asm/thread_info.h
arch/parisc/kernel/irq.c
arch/parisc/kernel/vmlinux.lds.S