|
@@ -84,7 +84,7 @@
|
|
#define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF
|
|
#define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF
|
|
#else
|
|
#else
|
|
#define preempt_stop(clobbers)
|
|
#define preempt_stop(clobbers)
|
|
-#define resume_kernel restore_nocheck
|
|
|
|
|
|
+#define resume_kernel restore_all
|
|
#endif
|
|
#endif
|
|
|
|
|
|
.macro TRACE_IRQS_IRET
|
|
.macro TRACE_IRQS_IRET
|
|
@@ -372,7 +372,7 @@ END(ret_from_exception)
|
|
ENTRY(resume_kernel)
|
|
ENTRY(resume_kernel)
|
|
DISABLE_INTERRUPTS(CLBR_ANY)
|
|
DISABLE_INTERRUPTS(CLBR_ANY)
|
|
cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ?
|
|
cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ?
|
|
- jnz restore_nocheck
|
|
|
|
|
|
+ jnz restore_all
|
|
need_resched:
|
|
need_resched:
|
|
movl TI_flags(%ebp), %ecx # need_resched set ?
|
|
movl TI_flags(%ebp), %ecx # need_resched set ?
|
|
testb $_TIF_NEED_RESCHED, %cl
|
|
testb $_TIF_NEED_RESCHED, %cl
|
|
@@ -540,6 +540,8 @@ syscall_exit:
|
|
jne syscall_exit_work
|
|
jne syscall_exit_work
|
|
|
|
|
|
restore_all:
|
|
restore_all:
|
|
|
|
+ TRACE_IRQS_IRET
|
|
|
|
+restore_all_notrace:
|
|
movl PT_EFLAGS(%esp), %eax # mix EFLAGS, SS and CS
|
|
movl PT_EFLAGS(%esp), %eax # mix EFLAGS, SS and CS
|
|
# Warning: PT_OLDSS(%esp) contains the wrong/random values if we
|
|
# Warning: PT_OLDSS(%esp) contains the wrong/random values if we
|
|
# are returning to the kernel.
|
|
# are returning to the kernel.
|
|
@@ -551,8 +553,6 @@ restore_all:
|
|
CFI_REMEMBER_STATE
|
|
CFI_REMEMBER_STATE
|
|
je ldt_ss # returning to user-space with LDT SS
|
|
je ldt_ss # returning to user-space with LDT SS
|
|
restore_nocheck:
|
|
restore_nocheck:
|
|
- TRACE_IRQS_IRET
|
|
|
|
-restore_nocheck_notrace:
|
|
|
|
RESTORE_REGS 4 # skip orig_eax/error_code
|
|
RESTORE_REGS 4 # skip orig_eax/error_code
|
|
CFI_ADJUST_CFA_OFFSET -4
|
|
CFI_ADJUST_CFA_OFFSET -4
|
|
irq_return:
|
|
irq_return:
|
|
@@ -601,8 +601,10 @@ ldt_ss:
|
|
CFI_ADJUST_CFA_OFFSET 4
|
|
CFI_ADJUST_CFA_OFFSET 4
|
|
pushl %eax
|
|
pushl %eax
|
|
CFI_ADJUST_CFA_OFFSET 4
|
|
CFI_ADJUST_CFA_OFFSET 4
|
|
|
|
+ /* Disable interrupts, but do not irqtrace this section: we
|
|
|
|
+ * will soon execute iret and the tracer was already set to
|
|
|
|
+ * the irqstate after the iret */
|
|
DISABLE_INTERRUPTS(CLBR_EAX)
|
|
DISABLE_INTERRUPTS(CLBR_EAX)
|
|
- TRACE_IRQS_OFF
|
|
|
|
lss (%esp), %esp
|
|
lss (%esp), %esp
|
|
CFI_ADJUST_CFA_OFFSET -8
|
|
CFI_ADJUST_CFA_OFFSET -8
|
|
jmp restore_nocheck
|
|
jmp restore_nocheck
|
|
@@ -1329,7 +1331,7 @@ nmi_stack_correct:
|
|
xorl %edx,%edx # zero error code
|
|
xorl %edx,%edx # zero error code
|
|
movl %esp,%eax # pt_regs pointer
|
|
movl %esp,%eax # pt_regs pointer
|
|
call do_nmi
|
|
call do_nmi
|
|
- jmp restore_nocheck_notrace
|
|
|
|
|
|
+ jmp restore_all_notrace
|
|
CFI_ENDPROC
|
|
CFI_ENDPROC
|
|
|
|
|
|
nmi_stack_fixup:
|
|
nmi_stack_fixup:
|