Skip to content

Commit

Permalink
[PATCH] lockdep: irqtrace subsystem, x86_64 support
Browse files Browse the repository at this point in the history
Add irqflags-tracing support to x86_64.

[akpm@osdl.org: build fix]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Jul 3, 2006
1 parent c8558fc commit 2601e64
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 91 deletions.
4 changes: 4 additions & 0 deletions arch/x86_64/Kconfig.debug
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
menu "Kernel hacking"

config TRACE_IRQFLAGS_SUPPORT
bool
default y

source "lib/Kconfig.debug"

config DEBUG_RODATA
Expand Down
19 changes: 18 additions & 1 deletion arch/x86_64/ia32/ia32entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <asm/thread_info.h>
#include <asm/segment.h>
#include <asm/vsyscall32.h>
#include <asm/irqflags.h>
#include <linux/linkage.h>

#define IA32_NR_syscalls ((ia32_syscall_end - ia32_sys_call_table)/8)
Expand Down Expand Up @@ -75,6 +76,10 @@ ENTRY(ia32_sysenter_target)
swapgs
movq %gs:pda_kernelstack, %rsp
addq $(PDA_STACKOFFSET),%rsp
/*
* No need to follow this irqs on/off section: the syscall
* disabled irqs, here we enable it straight after entry:
*/
sti
movl %ebp,%ebp /* zero extension */
pushq $__USER32_DS
Expand Down Expand Up @@ -118,6 +123,7 @@ sysenter_do_call:
movq %rax,RAX-ARGOFFSET(%rsp)
GET_THREAD_INFO(%r10)
cli
TRACE_IRQS_OFF
testl $_TIF_ALLWORK_MASK,threadinfo_flags(%r10)
jnz int_ret_from_sys_call
andl $~TS_COMPAT,threadinfo_status(%r10)
Expand All @@ -132,6 +138,7 @@ sysenter_do_call:
CFI_REGISTER rsp,rcx
movl $VSYSCALL32_SYSEXIT,%edx /* User %eip */
CFI_REGISTER rip,rdx
TRACE_IRQS_ON
swapgs
sti /* sti only takes effect after the next instruction */
/* sysexit */
Expand Down Expand Up @@ -186,6 +193,10 @@ ENTRY(ia32_cstar_target)
movl %esp,%r8d
CFI_REGISTER rsp,r8
movq %gs:pda_kernelstack,%rsp
/*
* No need to follow this irqs on/off section: the syscall
* disabled irqs and here we enable it straight after entry:
*/
sti
SAVE_ARGS 8,1,1
movl %eax,%eax /* zero extension */
Expand Down Expand Up @@ -220,6 +231,7 @@ cstar_do_call:
movq %rax,RAX-ARGOFFSET(%rsp)
GET_THREAD_INFO(%r10)
cli
TRACE_IRQS_OFF
testl $_TIF_ALLWORK_MASK,threadinfo_flags(%r10)
jnz int_ret_from_sys_call
andl $~TS_COMPAT,threadinfo_status(%r10)
Expand All @@ -228,6 +240,7 @@ cstar_do_call:
CFI_REGISTER rip,rcx
movl EFLAGS-ARGOFFSET(%rsp),%r11d
/*CFI_REGISTER rflags,r11*/
TRACE_IRQS_ON
movl RSP-ARGOFFSET(%rsp),%esp
CFI_RESTORE rsp
swapgs
Expand Down Expand Up @@ -286,7 +299,11 @@ ENTRY(ia32_syscall)
/*CFI_REL_OFFSET rflags,EFLAGS-RIP*/
/*CFI_REL_OFFSET cs,CS-RIP*/
CFI_REL_OFFSET rip,RIP-RIP
swapgs
swapgs
/*
* No need to follow this irqs on/off section: the syscall
* disabled irqs and here we enable it straight after entry:
*/
sti
movl %eax,%eax
pushq %rax
Expand Down
Loading

0 comments on commit 2601e64

Please sign in to comment.