summaryrefslogtreecommitdiffstats
path: root/x86-Fix-irq-off-tracing-for-32-bit.patch
blob: fd65d316f58ba466bf10b3e94bc0d59808c0c88e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From dc2ecf9dd907d38eb1a9a9e955c1fc90249095c5 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 2 Apr 2010 10:51:09 +0200
Subject: [PATCH] x86: Fix irq off tracing for 32 bit

commit 35b5256e0c4f29f334cc85aaf501ecbc8159c51f in tip.

John reported a irq off tracing splat with the following debug info:
irq event stamp: 5988
hardirqs last  enabled at (5987): [<c13e4696>]
_raw_spin_unlock_irqrestore+0x49/0x8f
hardirqs last disabled at (5988): [<c13e4ce3>] call_function_interrupt+0x2f/0x3c
softirqs last  enabled at (0): [<c10470a6>] copy_process+0x3b6/0x15ad
softirqs last disabled at (0): [<(null)>] (null)
8139too Fast Ethernet driver 0.9.28
irq event stamp: 10638
hardirqs last  enabled at (10637): [<c13e4696>]
_raw_spin_unlock_irqrestore+0x49/0x8f
hardirqs last disabled at (10638): [<c13e4feb>] apic_timer_interrupt+0x2f/0x3c
softirqs last  enabled at (0): [<c10470a6>] copy_process+0x3b6/0x15ad
softirqs last disabled at (0): [<(null)>] (null)
irq event stamp: 2914
hardirqs last  enabled at (2913): [<c13e4696>]
_raw_spin_unlock_irqrestore+0x49/0x8f
hardirqs last disabled at (2914): [<c13e4feb>] apic_timer_interrupt+0x2f/0x3c
softirqs last  enabled at (0): [<c10470a6>] copy_process+0x3b6/0x15ad
softirqs last disabled at (0): [<(null)>] (null)

There is a TRACE_IRQ_IRET annotation missing in the preempt code path.

Reported-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 arch/x86/kernel/entry_32.S |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index 57d3849..3dc8593 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -375,15 +375,18 @@ END(ret_from_exception)
 ENTRY(resume_kernel)
 	DISABLE_INTERRUPTS(CLBR_ANY)
 	cmpl $0,TI_preempt_count(%ebp)	# non-zero preempt_count ?
-	jnz restore_nocheck
+	jnz restore_nocheck_trace
 need_resched:
 	movl TI_flags(%ebp), %ecx	# need_resched set ?
 	testb $_TIF_NEED_RESCHED, %cl
-	jz restore_nocheck
+	jz restore_nocheck_trace
 	testl $X86_EFLAGS_IF,PT_EFLAGS(%esp)	# interrupts off (exception path) ?
-	jz restore_nocheck
+	jz restore_nocheck_trace
 	call preempt_schedule_irq
 	jmp need_resched
+restore_nocheck_trace:
+	TRACE_IRQS_IRET
+	jmp restore_nocheck
 END(resume_kernel)
 #endif
 	CFI_ENDPROC
-- 
1.7.0.4