WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Mini-OS return from exception fix

To: Mick.Jordan@xxxxxxx, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Mini-OS return from exception fix
From: Grzegorz Milos <gm281@xxxxxxxxx>
Date: Fri, 02 Feb 2007 10:56:14 +0000
Delivery-date: Fri, 02 Feb 2007 02:56:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45C22150.90402@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <45BE2C6E.8060806@xxxxxxx> <45BE3F9F.3030602@xxxxxxxxx> <45BE5128.9050807@xxxxxxx> <45C2100C.60007@xxxxxxxxx> <45C22150.90402@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5 (X11/20051025)
This patch fixes ret_from_exception routine. Stack consistency is now preserved.

Signed-off-by: Grzegorz Milos <gm281@xxxxxxxxx>

Keir could you apply? Thanks.

Gregor

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?


diff -r 8690e3448971 -r 25619d57eaa5 extras/mini-os/arch/x86/x86_32.S
--- a/extras/mini-os/arch/x86/x86_32.S  Wed Jan 17 15:09:50 2007 +0000
+++ b/extras/mini-os/arch/x86/x86_32.S  Fri Feb 02 10:50:20 2007 +0000
@@ -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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Mini-OS return from exception fix, Grzegorz Milos <=