fd78a76aef
This cleans up the irqflags tracing code quite a bit and ties it in to various missing callsites that caused an imbalance when CONFIG_PROVE_LOCKING was enabled. Previously this was catching on: 987 #ifdef CONFIG_PROVE_LOCKING 988 DEBUG_LOCKS_WARN_ON(!p->hardirqs_enabled); 989 DEBUG_LOCKS_WARN_ON(!p->softirqs_enabled); 990 #endif 991 retval = -EAGAIN; with hardirqs being doubly enabled, and subsequently bailing out with the following call trace: Call trace: [<88035224>] __lock_acquire+0x616/0x6a6 [<88015a8c>] do_fork+0xf8/0x2b0 [<880331ec>] trace_hardirqs_on_caller+0xd4/0x114 [<88241074>] _spin_unlock_irq+0x20/0x64 [<88035224>] __lock_acquire+0x616/0x6a6 [<8800386c>] kernel_thread+0x48/0x70 [<88024ecc>] ____call_usermodehelper+0x0/0x110 [<88024ecc>] ____call_usermodehelper+0x0/0x110 [<88003894>] kernel_thread_helper+0x0/0x14 [<88024bac>] __call_usermodehelper+0x38/0x70 [<88025dc0>] worker_thread+0x150/0x274 [<88035b9c>] lock_release+0x0/0x198 [<88024b74>] __call_usermodehelper+0x0/0x70 [<88028cf0>] autoremove_wake_function+0x0/0x30 [<88028bf2>] kthread+0x3e/0x70 [<88025c70>] worker_thread+0x0/0x274 [<8800389c>] kernel_thread_helper+0x8/0x14 [<88028bb4>] kthread+0x0/0x70 [<88003894>] kernel_thread_helper+0x0/0x14 Reported-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Stuart Menefy <stuart.menefy@st.com> Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
133 lines
4.8 KiB
Text
133 lines
4.8 KiB
Text
menu "Kernel hacking"
|
|
|
|
config TRACE_IRQFLAGS_SUPPORT
|
|
def_bool y
|
|
|
|
source "lib/Kconfig.debug"
|
|
|
|
config SH_STANDARD_BIOS
|
|
bool "Use LinuxSH standard BIOS"
|
|
depends on SUPERH32
|
|
help
|
|
Say Y here if your target has the gdb-sh-stub
|
|
package from www.m17n.org (or any conforming standard LinuxSH BIOS)
|
|
in FLASH or EPROM. The kernel will use standard BIOS calls during
|
|
boot for various housekeeping tasks (including calls to read and
|
|
write characters to a system console, get a MAC address from an
|
|
on-board Ethernet interface, and shut down the hardware). Note this
|
|
does not work with machines with an existing operating system in
|
|
mask ROM and no flash (WindowsCE machines fall in this category).
|
|
If unsure, say N.
|
|
|
|
config EARLY_SCIF_CONSOLE
|
|
bool "Use early SCIF console"
|
|
help
|
|
This enables an early console using a fixed SCIF port. This can
|
|
be used by platforms that are either not running the SH
|
|
standard BIOS, or do not wish to use the BIOS callbacks for the
|
|
serial I/O.
|
|
|
|
config EARLY_SCIF_CONSOLE_PORT
|
|
hex
|
|
depends on EARLY_SCIF_CONSOLE
|
|
default "0xa4400000" if CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7705
|
|
default "0xa4430000" if CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721
|
|
default "0xf8420000" if CPU_SUBTYPE_SH7619
|
|
default "0xff804000" if CPU_SUBTYPE_MXG
|
|
default "0xffc30000" if CPU_SUBTYPE_SHX3
|
|
default "0xffe00000" if CPU_SUBTYPE_SH7780 || CPU_SUBTYPE_SH7763 || \
|
|
CPU_SUBTYPE_SH7722 || CPU_SUBTYPE_SH7366 || \
|
|
CPU_SUBTYPE_SH7343
|
|
default "0xffeb0000" if CPU_SUBTYPE_SH7785
|
|
default "0xffeb0000" if CPU_SUBTYPE_SH7786
|
|
default "0xfffe8000" if CPU_SUBTYPE_SH7203
|
|
default "0xfffe9800" if CPU_SUBTYPE_SH7206 || CPU_SUBTYPE_SH7263
|
|
default "0xffe80000" if CPU_SH4
|
|
default "0x00000000"
|
|
|
|
config EARLY_PRINTK
|
|
bool "Early printk support"
|
|
depends on SH_STANDARD_BIOS || EARLY_SCIF_CONSOLE
|
|
help
|
|
Say Y here to redirect kernel printk messages to the serial port
|
|
used by the SH-IPL bootloader, starting very early in the boot
|
|
process and ending when the kernel's serial console is initialised.
|
|
This option is only useful porting the kernel to a new machine,
|
|
when the kernel may crash or hang before the serial console is
|
|
initialised. If unsure, say N.
|
|
|
|
On devices that are running SH-IPL and want to keep the port
|
|
initialization consistent while not using the BIOS callbacks,
|
|
select both the EARLY_SCIF_CONSOLE and SH_STANDARD_BIOS, using
|
|
the kernel command line option to toggle back and forth.
|
|
|
|
config STACK_DEBUG
|
|
bool "Check for stack overflows"
|
|
depends on DEBUG_KERNEL && SUPERH32
|
|
help
|
|
This option will cause messages to be printed if free stack space
|
|
drops below a certain limit. Saying Y here will add overhead to
|
|
every function call and will therefore incur a major
|
|
performance hit. Most users should say N.
|
|
|
|
config DEBUG_STACK_USAGE
|
|
bool "Stack utilization instrumentation"
|
|
depends on DEBUG_KERNEL
|
|
help
|
|
Enables the display of the minimum amount of free stack which each
|
|
task has ever had available in the sysrq-T and sysrq-P debug output.
|
|
|
|
This option will slow down process creation somewhat.
|
|
|
|
config 4KSTACKS
|
|
bool "Use 4Kb for kernel stacks instead of 8Kb"
|
|
depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB
|
|
help
|
|
If you say Y here the kernel will use a 4Kb stacksize for the
|
|
kernel stack attached to each process/thread. This facilitates
|
|
running more threads on a system and also reduces the pressure
|
|
on the VM subsystem for higher order allocations. This option
|
|
will also use IRQ stacks to compensate for the reduced stackspace.
|
|
|
|
config IRQSTACKS
|
|
bool "Use separate kernel stacks when processing interrupts"
|
|
depends on DEBUG_KERNEL && SUPERH32 && BROKEN
|
|
help
|
|
If you say Y here the kernel will use separate kernel stacks
|
|
for handling hard and soft interrupts. This can help avoid
|
|
overflowing the process kernel stacks.
|
|
|
|
config DUMP_CODE
|
|
bool "Show disassembly of nearby code in register dumps"
|
|
depends on DEBUG_KERNEL && SUPERH32
|
|
default y if DEBUG_BUGVERBOSE
|
|
default n
|
|
help
|
|
This prints out a code trace of the instructions leading up to
|
|
the faulting instruction as a debugging aid. As this does grow
|
|
the kernel in size a bit, most users will want to say N here.
|
|
|
|
Those looking for more verbose debugging output should say Y.
|
|
|
|
config SH_NO_BSS_INIT
|
|
bool "Avoid zeroing BSS (to speed-up startup on suitable platforms)"
|
|
depends on DEBUG_KERNEL
|
|
default n
|
|
help
|
|
If running in painfully slow environments, such as an RTL
|
|
simulation or from remote memory via SHdebug, where the memory
|
|
can already be gauranteed to ber zeroed on boot, say Y.
|
|
|
|
For all other cases, say N. If this option seems perplexing, or
|
|
you aren't sure, say N.
|
|
|
|
config SH64_SR_WATCH
|
|
bool "Debug: set SR.WATCH to enable hardware watchpoints and trace"
|
|
depends on SUPERH64
|
|
|
|
config MCOUNT
|
|
def_bool y
|
|
depends on SUPERH32
|
|
depends on STACK_DEBUG || FUNCTION_TRACER
|
|
|
|
endmenu
|