Skip to contentSkip to conversation

Build fixes for liblockdep

PATCH In review Ben Hutchings 2 participants 5 messages Aug 28, 2018 – Aug 29, 2018

lore
Share & tools
lore
#0 lore raw

cover Build fixes for liblockdep

In addition to the patch I recently sent for lockdep itself, the following fixes are also needed to make liblockdep build.

Ben.

Bastian Blank (1):
liblockdep: Stub NMI watchdog reset

Ben Hutchings (1):
liblockdep: Stub task_struct::state

 tools/include/linux/lockdep.h |  4 ++++
 tools/include/linux/nmi.h     | 12 ++++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 tools/include/linux/nmi.h
#1 lore raw

PATCH 1/2 liblockdep: Stub NMI watchdog reset

From: Bastian Blank <[email protected]>

lockdep.c now includes <linux/nmi.h> and requires touch_nmi_watchdog(), so provide those for liblockdep.

Fixes 88f1c87de11a ("locking/lockdep: Avoid triggering hardlockup from ...")
[bwh: Write a longer description]
---
 tools/include/linux/nmi.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 tools/include/linux/nmi.h
tools/include/linux/nmi.h new file +12 -0
new file mode 100644
index 000000000000..81ffb39343cc
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *  linux/include/linux/nmi.h
+ */
+#ifndef LINUX_NMI_H
+#define LINUX_NMI_H
+
+static inline void touch_nmi_watchdog(void)
+{
+}
+
+#endif
#2 lore raw

PATCH 2/2 liblockdep: Stub task_struct::state

In reply to Ben Hutchings

lockdep_print_held_locks() now checks task_struct::state. Define it so that all tasks are assumed to be running, since we have no reasonble way to tell in user-space.

Fixes 8cc05c71ba5f ("locking/lockdep: Move sanity check to inside ...")
---
 tools/include/linux/lockdep.h | 4 ++++
 1 file changed, 4 insertions(+)
tools/include/linux/lockdep.h +4 -0
index 6b0c36a58fcb..8e84609afb04 100644
@@ -31,12 +31,16 @@ struct task_struct {
 	gfp_t lockdep_reclaim_gfp;
 	int pid;
 	char comm[17];
+	long state;
 };
 
 extern struct task_struct *__curr(void);
 
 #define current (__curr())
 
+/* lockdep checks task_struct::state == TASK_RUNNING */
+#define TASK_RUNNING 0
+
 static inline int debug_locks_off(void)
 {
 	return 1;
#3 lore raw
In reply to Ben Hutchings

Also, please update your address in MAINTAINERS.

Ben.

Quoted 16 lines · Ben Hutchings

In addition to the patch I recently sent for lockdep itself, the following fixes are also needed to make liblockdep build.

Ben.

Bastian Blank (1):
liblockdep: Stub NMI watchdog reset

Ben Hutchings (1):
liblockdep: Stub task_struct::state

 tools/include/linux/lockdep.h |  4 ++++
 tools/include/linux/nmi.h     | 12 ++++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 tools/include/linux/nmi.h
Signature · 3 lines
Ben Hutchings
For every complex problem
there is a solution that is simple, neat, and wrong.
#4 lore raw
In reply to Ben Hutchings
Quoted 2 lines · Ben Hutchings

In addition to the patch I recently sent for lockdep itself, the following fixes are also needed to make liblockdep build.

Thanks Ben. I've already sent patches similar to this as well as a MAINTAINERS update a few weeks ago to Ingo, but he didn't merge it in yet (https://lkml.org/lkml/2018/8/13/480). Let me follow up with him.