--- linux-2.4.19/arch/i386/kernel/entry.S.orig Sat Aug 3 02:39:42 2002 +++ linux-2.4.19/arch/i386/kernel/entry.S Thu Nov 14 13:52:24 2002 @@ -63,7 +63,9 @@ OLDSS = 0x38 CF_MASK = 0x00000001 +TF_MASK = 0x00000100 IF_MASK = 0x00000200 +DF_MASK = 0x00000400 NT_MASK = 0x00004000 VM_MASK = 0x00020000 @@ -139,7 +141,10 @@ movl EIP(%esp),%eax # due to call gates, this is eflags, not eip.. movl CS(%esp),%edx # this is eip.. movl EFLAGS(%esp),%ecx # and this is cs.. + andl $~(NT_MASK|TF_MASK|DF_MASK), %eax # Clear NT since we are doing an iret movl %eax,EFLAGS(%esp) # + pushl %eax + popfl movl %edx,EIP(%esp) # Now we move them to their "normal" places movl %ecx,CS(%esp) # movl %esp,%ebx @@ -160,7 +165,10 @@ movl EIP(%esp),%eax # due to call gates, this is eflags, not eip.. movl CS(%esp),%edx # this is eip.. movl EFLAGS(%esp),%ecx # and this is cs.. + andl $~(NT_MASK|TF_MASK|DF_MASK), %eax # Clear NT since we are doing an iret movl %eax,EFLAGS(%esp) # + pushl %eax + popfl movl %edx,EIP(%esp) # Now we move them to their "normal" places movl %ecx,CS(%esp) # movl %esp,%ebx @@ -264,6 +272,9 @@ pushl $ SYMBOL_NAME(do_divide_error) ALIGN error_code: + pushfl + andl $~(NT_MASK|TF_MASK|DF_MASK), (%esp) # NT must be clear, do a cld for free + popfl pushl %ds pushl %eax xorl %eax,%eax @@ -274,7 +285,6 @@ decl %eax # eax = -1 pushl %ecx pushl %ebx - cld movl %es,%ecx movl ORIG_EAX(%esp), %esi # get the error code movl ES(%esp), %edi # get the function address --- linux-2.4.19/arch/i386/kernel/traps.c.orig Sat Aug 3 02:39:42 2002 +++ linux-2.4.19/arch/i386/kernel/traps.c Thu Nov 14 13:53:14 2002 @@ -575,7 +575,7 @@ return; clear_TF: - regs->eflags &= ~TF_MASK; + regs->eflags &= ~(TF_MASK|NT_MASK); return; }