Skip to content

Commit 536e8b9

Browse files
paulmckrcufbq
authored andcommitted
srcu: Add FORCE_NEED_SRCU_NMI_SAFE Kconfig for testing
The srcu_read_lock_nmisafe() and srcu_read_unlock_nmisafe() functions map to __srcu_read_lock() and __srcu_read_unlock() on systems like x86 that have NMI-safe this_cpu_inc() operations. This makes the underlying __srcu_read_lock_nmisafe() and __srcu_read_unlock_nmisafe() functions difficult to test on (for example) x86 systems, allowing bugs to creep in. This commit therefore creates a FORCE_NEED_SRCU_NMI_SAFE Kconfig that forces those underlying functions to be used even on systems where they are not needed, thus providing better testing coverage. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent 38b43ec commit 536e8b9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

kernel/rcu/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ config TREE_SRCU
6565
help
6666
This option selects the full-fledged version of SRCU.
6767

68+
config FORCE_NEED_SRCU_NMI_SAFE
69+
bool "Force selection of NEED_SRCU_NMI_SAFE"
70+
depends on !TINY_SRCU
71+
select NEED_SRCU_NMI_SAFE
72+
default n
73+
help
74+
This option forces selection of the NEED_SRCU_NMI_SAFE
75+
Kconfig option, allowing testing of srcu_read_lock_nmisafe()
76+
and srcu_read_unlock_nmisafe() on architectures (like x86)
77+
that select the ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option.
78+
6879
config NEED_SRCU_NMI_SAFE
6980
def_bool HAVE_NMI && !ARCH_HAS_NMI_SAFE_THIS_CPU_OPS && !TINY_SRCU
7081

0 commit comments

Comments
 (0)