Skip to contentSkip to conversation

ipipe-noarch: IRQ tracing and lockdep fixes/cleanups

PATCH Superseded Jan Kiszka 1 participant 4 messages Jul 2, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

cover ipipe-noarch: IRQ tracing and lockdep fixes/cleanups

See patches for details.

Jan

Jan Kiszka (2):
ipipe: Restore trace_hardirqs_on_virt_caller
ipipe: lockdep: Remove duplicate context checks

 kernel/locking/lockdep.c        |  6 ------
 kernel/trace/trace_preemptirq.c | 11 +++++++++++
 2 files changed, 11 insertions(+), 6 deletions(-)
Signature · 1 line
2.16.4
author
#1 lore raw

PATCH 1/2 ipipe: Restore trace_hardirqs_on_virt_caller

From: Jan Kiszka <[email protected]>

Lost in d7fc2c06edc9 ("lockdep: ipipe: exclude the head stage from IRQ state tracing") but still needed by x86 at least.

---
 kernel/trace/trace_preemptirq.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
kernel/trace/trace_preemptirq.c +11 -0
index 3c482c02c1d9..19605695a6a2 100644
@@ -66,6 +66,17 @@ __visible void trace_hardirqs_on_caller(unsigned long caller_addr)
 }
 EXPORT_SYMBOL(trace_hardirqs_on_caller);
 
+__visible void trace_hardirqs_on_virt_caller(unsigned long ip)
+{
+	/*
+	 * The IRQ tracing logic only applies to the root domain, and
+	 * must consider the virtual disable flag exclusively when
+	 * leaving an interrupt/fault context.
+	 */
+	if (ipipe_root_p && !irqs_disabled())
+		trace_hardirqs_on_caller(ip);
+}
+
 __visible void trace_hardirqs_on_virt(void)
 {
 	/*
Signature · 1 line
2.16.4
author
#2 lore raw

PATCH 2/2 ipipe: lockdep: Remove duplicate context checks

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

All callers of lockdep_hardirqs_on/off already filter out !ipipe_root_p.

---
 kernel/locking/lockdep.c | 6 ------
 1 file changed, 6 deletions(-)
kernel/locking/lockdep.c +0 -6
index 715fe8a49c2e..a2a8267788c6 100644
@@ -2841,9 +2841,6 @@ static void __trace_hardirqs_on_caller(unsigned long ip)
 
 void lockdep_hardirqs_on(unsigned long ip)
 {
-	if (!ipipe_root_p)
-		return;
-
 	if (unlikely(!debug_locks || current->lockdep_recursion))
 		return;
 
@@ -2890,9 +2887,6 @@ void lockdep_hardirqs_off(unsigned long ip)
 {
 	struct task_struct *curr;
 
-	if (!ipipe_root_p)
-		return;
-
 	curr = current;
 
 	if (unlikely(!debug_locks || current->lockdep_recursion))
Signature · 1 line
2.16.4
author
#3 lore raw

[PATCH 3/2] ipipe: Add missing include for ipipe_root_only

In reply to Jan Kiszka

From: Jan Kiszka <[email protected]>

Breaks in non-debug builds otherwise, e.g.
https://travis-ci.com/xenomai-ci/xenomai/jobs/212725223

---
 include/linux/kernel.h | 1 +
 1 file changed, 1 insertion(+)
include/linux/kernel.h +1 -0
index 50b1e0c878e0..edd37052e585 100644
@@ -14,6 +14,7 @@
 #include <linux/printk.h>
 #include <linux/build_bug.h>
 #include <asm/byteorder.h>
+#include <asm-generic/ipipe.h>
 #include <uapi/linux/kernel.h>
 
 #define USHRT_MAX	((u16)(~0U))
Signature · 1 line
2.16.4