If we take a fault while interrupts are disabled (for example of a vmalloc area) then irqflags-tracing mistakenly assumed that the iretq would re-enable interrupts. Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton --- arch/x86_64/kernel/entry.S | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff -puN arch/x86_64/kernel/entry.S~lock-validator-x86_64-irqflags-trace-entrys-fix arch/x86_64/kernel/entry.S --- devel/arch/x86_64/kernel/entry.S~lock-validator-x86_64-irqflags-trace-entrys-fix 2006-06-01 02:57:43.000000000 -0700 +++ devel-akpm/arch/x86_64/kernel/entry.S 2006-06-01 02:57:43.000000000 -0700 @@ -50,6 +50,15 @@ #define retint_kernel retint_restore_args #endif +.macro TRACE_IRQS_IRETQ +#ifdef CONFIG_TRACE_IRQFLAGS + bt $9,EFLAGS-ARGOFFSET(%rsp) /* interrupts off? */ + jnc 1f + TRACE_IRQS_ON +1: +#endif +.endm + /* * C code is not supposed to know about undefined top of stack. Every time * a C function with an pt_regs argument is called from the SYSCALL based @@ -541,19 +550,19 @@ retint_check: jnz retint_careful retint_swapgs: /* - * The iretq will re-enable interrupts: + * The iretq could re-enable interrupts: */ cli - TRACE_IRQS_ON + TRACE_IRQS_IRETQ swapgs jmp restore_args retint_restore_args: cli /* - * The iretq will re-enable interrupts: + * The iretq could re-enable interrupts: */ - TRACE_IRQS_ON + TRACE_IRQS_IRETQ restore_args: RESTORE_ARGS 0,8,0 iret_label: _