We must not do any kernel exit work when we originally didn't come from

userland. E.g. preparing a signal handler would terribly go wrong, since
we don't have a userland iframe. This fixes bug #2562 and maybe also
#2522.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26810 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-08-04 21:53:10 +00:00
parent 962a6c67e9
commit 3f075fe6b5
+10 -2
View File
@@ -299,10 +299,18 @@ int_bottom_user:
movl IFRAME_vector(%ebp), %eax
call *gInterruptHandlerTable(, %eax, 4)
// Don't do any kernel exit work, if we actually came from the kernel (but
// were already/still prepared for userland), since the iframe in this case
// will be a kernel iframe and e.g. trying to set up a signal stack will not
// be a very healthy endeavor.
cmp $USER_CODE_SEG, IFRAME_cs(%ebp)
jne 1f
testl $(THREAD_FLAGS_DEBUGGER_INSTALLED | THREAD_FLAGS_SIGNALS_PENDING \
| THREAD_FLAGS_DEBUG_THREAD | THREAD_FLAGS_BREAKPOINTS_DEFINED) \
, THREAD_flags(%edi)
jnz kernel_exit_work
1:
cli // disable interrupts
@@ -630,14 +638,14 @@ FUNCTION(x86_vm86_return):
cli
movl %esi, %esp
addl $VM86_IFRAME_sizeof, %esp
// save old iframe
popl %eax // old kernel stack top
popl %edi
movl $(VM86_IFRAME_sizeof >> 2), %ecx
cld
rep movsl
// adjust kernel_stack_top and tss.esp0
movl %dr3, %edi
movl %eax, THREAD_kernel_stack_top(%edi)