[PATCH 5.10 268/593] lockdep/selftests: Fix selftests vs PROVE_RAW_LOCK_NESTING

From
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date
2021-07-12 06:54:28
Also in
lkml
Reply to
Greg Kroah-Hartman, 2021-07-12
From: Peter Zijlstra <peterz@infradead.org>

[ Upstream commit c0c2c0dad6a06e0c05e9a52d65f932bd54364c97 ]

When PROVE_RAW_LOCK_NESTING=y many of the selftests FAILED because
HARDIRQ context is out-of-bounds for spinlocks. Instead make the
default hardware context the threaded hardirq context, which preserves
the old locking rules.

The wait-type specific locking selftests will have a non-threaded
HARDIRQ variant.

Fixes: de8f5e4f2dc1 ("lockdep: Introduce wait-type checks")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Joerg Roedel <redacted>
Link: https://lore.kernel.org/r/20210617190313.322096283@infradead.org (local)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 lib/locking-selftest.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/lib/locking-selftest.c b/lib/locking-selftest.c
index a899b3f0e2e5..76c52b0b76d3 100644
--- a/lib/locking-selftest.c
+++ b/lib/locking-selftest.c
@@ -186,6 +186,7 @@ static void init_shared_classes(void)
 #define HARDIRQ_ENTER()				\
 	local_irq_disable();			\
 	__irq_enter();				\
+	lockdep_hardirq_threaded();		\
 	WARN_ON(!in_irq());
 
 #define HARDIRQ_EXIT()				\
-- 
2.30.2


Thread (615 messages) 615 messages, 10 authors, last reply 2021-07-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help