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] A question on how interrupts work

To: "Ronald G. Minnich" <rminnich@xxxxxxxx>
Subject: Re: [Xen-devel] A question on how interrupts work
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Tue, 14 Dec 2004 22:32:36 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 14 Dec 2004 22:34:04 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
In-reply-to: Your message of "Tue, 14 Dec 2004 15:21:02 MST." <Pine.LNX.4.58.0412141503090.23019@xxxxxxxxxx>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
> I am wondering because I just fixed a bug in Plan 9 that boiled 
> down to adding an spllo() to the plan 9 trap handler, since Xen sets the 
> mask on page fault and does not clear it when the OS returns.

This isn't true. Xen only sets the mask when it delivers an
event-channel notification. It doesn't set the mask for page faults
unless you specified a "virtual interrupt gate" instead of a "virtual
trap gate" during the set_trap_table() hypercall -- that is, for
exception vector 14 you must have set bit 2 of the flag byte of the
trap_info_t struct.

> Why doesn't Xen do the equivalent of this:
>       x = splhi();
>       trap_to_os();
>       splx(x);
> instead of what is does now, which is pretty much this:
>       splhi();
>       trap_to_os();
>       /* OS restores IF */
> 
> There's an awful lot of complexity in the trap handler in the OS to deal 
> with the problem of the OS setting spllo() before doing the iret, since as 
> soon as the OS sets spllo() it can take an interrupt -- while in the 
> interrupt handler. 

It avoids the need to reenter Xen to do tail work. Instead the OS does
it (with some added complexity, not on the fast path) and avoids
reentering ring 0.

Thus, in the extremely common case, an interrupt will cause ring
transitions 3->0->1->3, instead of 3->0->1->0->3.

For people who don't care about the extra cost, we could provide a
"virtual IRET" hypercall which would "atomically" reenable events and
IRET. 

 -- Keir


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

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