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] domain builder: Fix sp_extents allocation

To: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] domain builder: Fix sp_extents allocation
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Thu, 31 Jul 2008 12:39:04 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 31 Jul 2008 04:39:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20080731112921.GF4678@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcjzAgicRuLL+l71Ed2L3gAX8io7RQ==
Thread-topic: [Xen-devel] [PATCH] domain builder: Fix sp_extents allocation
User-agent: Microsoft-Entourage/11.4.0.080122
On 31/7/08 12:29, "Samuel Thibault" <samuel.thibault@xxxxxxxxxxxxx> wrote:

> Keir Fraser, le Thu 31 Jul 2008 12:19:18 +0100, a écrit :
>> Doesn't this turn the array allocation into a dynamic allocation? I feel a
>> bit dubious about that.
> 
>>>          {
>>>              long done;
>>> -            xen_pfn_t sp_extents[2048 >> SUPERPAGE_PFN_SHIFT];
>>> +            xen_pfn_t sp_extents[count >> SUPERPAGE_PFN_SHIFT];
>>>              struct xen_memory_reservation sp_req = {
> 
> Err, I'd think that it just turns a
> 
> sub (2048>>SUPERPAGE_PFN_SHIFT) * sizeof(xen_pfn_t), %esp
> 
> into a
> 
> mov count, %eax
> shr SUPERPAGE_PFN_SHIFT - log2(sizeof(xen_pfn_t)), %eax
> sub %eax, %esp

Yes, good point!

 -- Keir



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

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