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: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] A question on how interrupts work
From: "Ronald G. Minnich" <rminnich@xxxxxxxx>
Date: Tue, 14 Dec 2004 16:31:19 -0700 (MST)
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 14 Dec 2004 23:32:42 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
In-reply-to: <E1CeLDh-0000N1-00@xxxxxxxxxxxxxxxxx>
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>
References: <E1CeLDh-0000N1-00@xxxxxxxxxxxxxxxxx>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx

On Tue, 14 Dec 2004, Keir Fraser wrote:

> 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.

You're right, I said it incorrectly, for some reason I switched in my 
Last-1th attempt to figure out what was up with the last one. Oops.

The plan 9 trap handler assumes that there is a hardware restore of INTF, 
which is generally true of modern CPUs. 

So what was happening was that at the end of the Plan 9 trap handler there 
was an splhi for a critical section (two lines or some such) then a 
return. There was no spllo() as they relied on hardware. I just 
realized the easy way to fix this, which is to take my own medicine: 
        x = splhi();
        stuff
        splx(x);

just need to talk to the plan 9 guys about this and fix up their trap code 
if they're willing. 


> 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.

That's what I figured. I was wondering if you all knew the tradeoff of 
adding complexity at the OS trap level vs. just dropping back to 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.

OK. I was assuming this was the reason. So the idea is that the tradeoff 
of NOT doing this:
        0->1->0->3
is worth the complexity of the trap return code which I see in the various 
kernels. Has this tradeoff been measured and is known to be the one we 
want? I'm more curious than anything.

Thanks Keir!

ron


-------------------------------------------------------
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>