mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 17:54:13 +08:00
15e64ef652
Add a lightweight spinlock check which uses only two instructions per spinlock call. It detects if a spinlock has been trashed by some memory corruption and then halts the kernel. It will not detect uninitialized spinlocks, for which CONFIG_DEBUG_SPINLOCK needs to be enabled. This lightweight spinlock check shouldn't influence runtime, so it's safe to enable it by default. The __ARCH_SPIN_LOCK_UNLOCKED_VAL constant has been choosen small enough to be able to be loaded by one LDI assembler statement. Signed-off-by: Helge Deller <deller@gmx.de>
13 lines
433 B
Plaintext
13 lines
433 B
Plaintext
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
config LIGHTWEIGHT_SPINLOCK_CHECK
|
|
bool "Enable lightweight spinlock checks"
|
|
depends on SMP && !DEBUG_SPINLOCK
|
|
default y
|
|
help
|
|
Add checks with low performance impact to the spinlock functions
|
|
to catch memory overwrites at runtime. For more advanced
|
|
spinlock debugging you should choose the DEBUG_SPINLOCK option
|
|
which will detect unitialized spinlocks too.
|
|
If unsure say Y here.
|