From: Ingo Molnar this fixes the irqflags-tracing bug reported (and relentlessly debugged) by Michal Piotrowski: if we took a fault while interrupts were disabled (for example of a vmalloc area) then irqflags-tracing mistakenly assumed that the iret would re-enable interrupts. Signed-off-by: Ingo Molnar Signed-off-by: Arjan van de Ven Cc: Michal Piotrowski Signed-off-by: Andrew Morton --- arch/i386/kernel/entry.S | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff -puN arch/i386/kernel/entry.S~lock-validator-irqtrace-entrys-fix arch/i386/kernel/entry.S --- devel/arch/i386/kernel/entry.S~lock-validator-irqtrace-entrys-fix 2006-06-09 15:18:37.000000000 -0700 +++ devel-akpm/arch/i386/kernel/entry.S 2006-06-09 15:18:37.000000000 -0700 @@ -84,6 +84,15 @@ VM_MASK = 0x00020000 #define resume_kernel restore_nocheck #endif +.macro TRACE_IRQS_IRET +#ifdef CONFIG_TRACE_IRQFLAGS + testl $IF_MASK,EFLAGS(%esp) # interrupts off? + jz 1f + TRACE_IRQS_ON +1: +#endif +.endm + #ifdef CONFIG_VM86 #define resume_userspace_sig check_userspace #else @@ -364,7 +373,7 @@ restore_all: CFI_REMEMBER_STATE je ldt_ss # returning to user-space with LDT SS restore_nocheck: - TRACE_IRQS_ON + TRACE_IRQS_IRET restore_nocheck_notrace: RESTORE_REGS addl $4, %esp @@ -404,7 +413,7 @@ ldt_ss: * and a switch16 pointer on top of the current frame. */ call setup_x86_bogus_stack CFI_ADJUST_CFA_OFFSET -8 # frame has moved - TRACE_IRQS_ON + TRACE_IRQS_IRET RESTORE_REGS lss 20+4(%esp), %esp # switch to 16bit stack 1: iret _