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] [PATCH] linux-2.6.18/x86: replace order-based range chec

To: Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] linux-2.6.18/x86: replace order-based range checking of M2P table by linear one
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Mon, 25 Jul 2011 10:33:39 -0400
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 25 Jul 2011 07:34:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E2D9866020000780004F80B@xxxxxxxxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4E2D5C02020000780004F6BB@xxxxxxxxxxxxxxxxxxxx> <20110725141903.GD23212@xxxxxxxxxxxx> <4E2D9866020000780004F80B@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Jul 25, 2011 at 03:23:02PM +0100, Jan Beulich wrote:
> >>> On 25.07.11 at 16:19, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> 
> >>> wrote:
> > On Mon, Jul 25, 2011 at 11:05:22AM +0100, Jan Beulich wrote:
> >> The order-based approach is not only less efficient (requiring a shift
> >> and a compare, typical generated code looking like this
> >> 
> >>    mov     eax, [machine_to_phys_order]
> >>    mov     ecx, eax
> >>    shr     ebx, cl
> >>    test    ebx, ebx
> >>    jnz     ...
> >> 
> >> whereas a direct check requires just a compare, like in
> >> 
> >>    cmp     ebx, [machine_to_phys_nr]
> >>    jae     ...
> >> 
> >> ), but also slightly dangerous in the 32-on-64 case - the element
> >> address calculation can wrap if the next power of two boundary is
> >> sufficiently far away from the actual upper limit of the table, and
> >> hence can result in user space addresses being accessed (with it being
> >> unknown what may actually be mapped there).
> > 
> > You wouldn't have a patch for upstream Linux for this?
> 
> I can try to port this over, but it'll take some time until I can get to
> this (certainly not before returning from the summit).

<nods>Absolutly. Will wait.

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

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