HAX FOR CI: Enable cross-release
diff mbox series

Message ID 20181122163526.16873-1-daniel.vetter@ffwll.ch
State New
Headers show
Series
  • HAX FOR CI: Enable cross-release
Related show

Commit Message

Daniel Vetter Nov. 22, 2018, 4:35 p.m. UTC
Only way to convince our CI to enable stuff that's new and defaulting
to off. Obviously not for merging.

v2: Also enable fullstack backtraces.

v3: Try to chase this elusive stack trace corruption CI is seeing.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 kernel/locking/lockdep.c | 13 +++++++++++++
 lib/Kconfig.debug        |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index e74add63f317..d8937d05acc4 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4841,8 +4841,15 @@  static void add_xhlock(struct held_lock *hlock)
 	xhlock->trace.entries = xhlock->trace_entries;
 
 	if (crossrelease_fullstack) {
+		int i;
+
 		xhlock->trace.skip = 3;
 		save_stack_trace(&xhlock->trace);
+
+		for (i = 0; i < trace->nr_entries; i++) {
+			if (trace->entries[i] == 0x6b6b6b6b6b6b6b6bUL)
+				print_lockdep_off("BUG: list poison in add_xlock!");
+		}
 	} else {
 		xhlock->trace.nr_entries = 1;
 		xhlock->trace.entries[0] = hlock->acquire_ip;
@@ -4950,12 +4957,18 @@  static int copy_trace(struct stack_trace *trace)
 	unsigned long *buf = stack_trace + nr_stack_trace_entries;
 	unsigned int max_nr = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries;
 	unsigned int nr = min(max_nr, trace->nr_entries);
+	int i;
 
 	trace->nr_entries = nr;
 	memcpy(buf, trace->entries, nr * sizeof(trace->entries[0]));
 	trace->entries = buf;
 	nr_stack_trace_entries += nr;
 
+	for (i = 0; i < trace->nr_entries; i++) {
+		if (trace->entries[i] == 0x6b6b6b6b6b6b6b6bUL)
+			print_lockdep_off("BUG: list poison in copy_trace!");
+	}
+
 	if (nr_stack_trace_entries >= MAX_STACK_TRACE_ENTRIES-1) {
 		if (!debug_locks_off_graph_unlock())
 			return 0;
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 6074fa3463ac..8e1c30e3face 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1095,6 +1095,7 @@  config LOCKDEP_CROSSRELEASE
 	bool "Enable cross-release checking"
 	depends on PROVE_LOCKING
 	select LOCKDEP_COMPLETIONS
+	default y
 	help
 	 This makes lockdep work for crosslock which is a lock allowed to
 	 be released in a different context from the acquisition context.
@@ -1208,7 +1209,7 @@  config LOCKDEP_COMPLETIONS
 config BOOTPARAM_LOCKDEP_CROSSRELEASE_FULLSTACK
 	bool "Enable the boot parameter, crossrelease_fullstack"
 	depends on LOCKDEP_CROSSRELEASE
-	default n
+	default y
 	help
 	 The lockdep "cross-release" feature needs to record stack traces
 	 (of calling functions) for all acquisitions, for eventual later