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: [PATCH] xen: use iret directly where possible

To: Andi Kleen <ak@xxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH] xen: use iret directly where possible
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Mon, 04 Jun 2007 15:08:10 -0700
Cc: Virtualization Mailing List <virtualization@xxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>
Delivery-date: Mon, 04 Jun 2007 15:06:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200706042346.55049.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: <46646662.9020707@xxxxxxxx> <200706042305.05340.ak@xxxxxxx> <4664841A.8040802@xxxxxxxx> <200706042346.55049.ak@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.10 (X11/20070302)
Andi Kleen wrote:
> Ah I assumed the hypervisor would just check IF in ring 1 too.
> It would certainly make this easier, but then the additional trap
> of setting it would be also somewhat expensive agreed.
>   

Xen doesn't do that because, while it could track sti/cli (expensively),
iret and popf quietly ignore the IF state in ring 1, and so there's lots
of scope for interrupt state getting lost.

> I must say I still hate the patch; it has all the signs of something that
> will be very nasty to maintain later.
>   

Well, the corresponding xen-unstable code has been a bit of a trial to
maintain.  I made this as simple and self-contained as possible (with
very little non-locality) to try and keep it maintainable.

I agree its all a bit subtle, but in its favour:

   1. It's internal to the implementation of the iret pvop, which does
      have a fairly well-defined and stable interface (same as iret
      instruction, essentially)
   2. Comments!
   3. Relatively simple implementation (only one register to deal with
      in the slow-path handler, for example)

The annoying non-local thing is the test in the xen upcall handler, but
that's unavoidable.

    J

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