From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: Re: [PATCH] domain builder: Fix sp_extents allocation Date: Thu, 31 Jul 2008 12:29:21 +0100 Message-ID: <20080731112921.GF4678@implementation.uk.xensource.com> References: <20080731111250.GE4678@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Keir Fraser, le Thu 31 Jul 2008 12:19:18 +0100, a =E9crit : > Doesn't this turn the array allocation into a dynamic allocation? I fee= l 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 =3D { 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 Samuel