Skip to contentSkip to conversation

Mini-OS return from exception fix

PATCH New Grzegorz Milos 1 participant 1 message Feb 2, 2007 5 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

PATCH 1/1 Mini-OS return from exception fix

This patch fixes ret_from_exception routine. Stack consistency is now preserved.

Keir could you apply? Thanks.

Gregor

Quoted 2 lines

I've modified minios to do dynamic page fault handling rather than setup all the page tables ahead of time (just to improve my understanding) but it's crashing on return and looks like the stack may be wrong. Before I dive in the assembler code, is the code in x86_32.S at page_fault and ret_from_exception expected to work if the fault is fixed up?

extras/mini-os/arch/x86/x86_32.S +4 -5
diff -r 8690e3448971 -r 25619d57eaa5 extras/mini-os/arch/x86/x86_32.S
@@ -69,7 +69,7 @@ CS		= 0x2C
 	popl %ds;	\
 	popl %es;	\
 	addl $4,%esp;	\
-	iret;		\
+	iret;		
 
 ENTRY(divide_error)
 	pushl $0		# no error code
@@ -101,10 +101,9 @@ do_exception:
     jmp ret_from_exception
     
 ret_from_exception:
-        movb CS(%esp),%cl
-	test $2,%cl          # slow return to ring 2 or 3
-	jne  safesti
-        RESTORE_ALL
+    movb CS(%esp),%cl
+    addl $8,%esp
+    RESTORE_ALL
 
 # A note on the "critical region" in our callback handler.
 # We want to avoid stacking callback handlers due to events occurring

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel