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

Re: [Xen-devel] Re: [RFC PATCH 11/35] Add support for Xen to entry.S.

To: Andi Kleen <ak@xxxxxxx>
Subject: Re: [Xen-devel] Re: [RFC PATCH 11/35] Add support for Xen to entry.S.
From: Zachary Amsden <zach@xxxxxxxxxx>
Date: Wed, 22 Mar 2006 09:24:49 -0800
Cc: Chris Wright <chrisw@xxxxxxxxxxxx>, virtualization@xxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Ian Pratt <ian.pratt@xxxxxxxxxxxxx>
Delivery-date: Wed, 22 Mar 2006 17:26:08 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <200603221455.48365.ak@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: <20060322063040.960068000@xxxxxxxxxxxxxxxxxx> <20060322063749.275209000@xxxxxxxxxxxxxxxxxx> <200603221455.48365.ak@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5 (X11/20051201)
Andi Kleen wrote:
+       jnz restore_all_enable_events   #     != 0 => reenable event delivery
+#endif
        RESTORE_REGS
        addl $4, %esp
 1:     iret
 .section .fixup,"ax"
 iret_exc:
-       sti
+#ifndef CONFIG_XEN
+       ENABLE_INTERRUPTS
+#endif
        pushl $0                        # no error code
        pushl $do_iret_error
        jmp error_code
@@ -269,6 +317,7 @@ iret_exc:
        .long 1b,iret_exc
 .previous
+#ifndef CONFIG_XEN
 ldt_ss:

So are you sure that problem this ugly piece of code tries to work around
isn't in Xen kernels too? Or do you just not care? If yes add a comment.

This code would otherwise be broken. ENABLE_INTERRUPTS in Xen requires access to the data segment, and the data segment is not available at this point. Plus, it corrupts the %esi register. Hint - use %ebp.

The LDT SS code is broken as well because the iret onto a 16-bit stack is a pretty crippling blow to transparency in this code. Then, you don't have data or even stack segments that are reliable for calling out to hypervisor assist code. We never really fixed this code either in our implementation, although we did consider several approaches. Leaving it out does break userspace applications.

Zach

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>