diff options
author | Helge Deller <deller@gmx.de> | 2023-05-22 15:11:16 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2023-05-24 14:23:07 +0200 |
commit | 15e64ef6520ea8702998db05b87fa5c3d3d40710 (patch) | |
tree | b7f67430b55167a2aeae50fd95fd4d4c50e2d2f8 /arch/parisc/Kconfig.debug | |
parent | b6405f0829d7b1dd926ba3ca5f691cab835abfaa (diff) |
parisc: Add lightweight spinlock checks
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>
Diffstat (limited to 'arch/parisc/Kconfig.debug')
-rw-r--r-- | arch/parisc/Kconfig.debug | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/parisc/Kconfig.debug b/arch/parisc/Kconfig.debug index f66554cd5c45..3a059cb5e112 100644 --- a/arch/parisc/Kconfig.debug +++ b/arch/parisc/Kconfig.debug @@ -1 +1,12 @@ # 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. |