Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YSjKC-0007ww-CM for mharc-grub-devel@gnu.org; Tue, 03 Mar 2015 04:41:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSjK9-0007sO-5b for grub-devel@gnu.org; Tue, 03 Mar 2015 04:41:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSjK4-0006Ii-1O for grub-devel@gnu.org; Tue, 03 Mar 2015 04:41:09 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:29213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSjK3-0006IV-RR for grub-devel@gnu.org; Tue, 03 Mar 2015 04:41:03 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t239eucH012012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Mar 2015 09:40:57 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id t239etn8015005 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 3 Mar 2015 09:40:55 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t239etap013325; Tue, 3 Mar 2015 09:40:55 GMT Received: from olila.local.net-space.pl (/10.175.236.198) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 03 Mar 2015 01:40:49 -0800 Date: Tue, 3 Mar 2015 10:39:37 +0100 From: Daniel Kiper To: Jan Beulich Subject: Re: [PATCH 17/18] x86/efi: create new early memory allocator Message-ID: <20150303093937.GA27971@olila.local.net-space.pl> References: <1422640462-28103-1-git-send-email-daniel.kiper@oracle.com> <1422640462-28103-18-git-send-email-daniel.kiper@oracle.com> <54F4AAB502000078000654ED@mail.emea.novell.com> <54F5790902000078000657AD@mail.emea.novell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54F5790902000078000657AD@mail.emea.novell.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 Cc: Juergen Gross , grub-devel@gnu.org, keir , Ian Campbell , Stefano Stabellini , Andrew Cooper , Roy Franz , ning.sun@intel.com, david.vrabel@citrix.com, Vladimir Serbinenko , xen-devel , qiaowei.ren@intel.com, richard.l.maliszewski@intel.com, gang.wei@intel.com, Fu Wei X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Mar 2015 09:41:10 -0000 On Tue, Mar 03, 2015 at 08:04:09AM +0000, Jan Beulich wrote: > >>> On 02.03.15 at 21:25, wrote: > > On Mon, Mar 2, 2015 at 9:23 AM, Jan Beulich wrote: > >>>>> On 30.01.15 at 18:54, wrote: > >>> @@ -192,12 +218,7 @@ static void __init > >>> efi_arch_process_memory_map(EFI_SYSTEM_TABLE *SystemTable, > >>> > >>> static void *__init efi_arch_allocate_mmap_buffer(UINTN *map_size) > >>> { > >>> - place_string(&mbi.mem_upper, NULL); > >>> - mbi.mem_upper -= *map_size; > >>> - mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR); > >>> - if ( mbi.mem_upper < xen_phys_start ) > >>> - return NULL; > >>> - return (void *)(long)mbi.mem_upper; > >>> + return __malloc(*map_size); > >>> } > >> > >> Which then even suggests that _if_ we go this route, this could be > >> shared with ARM (and hence become common code again). > > > > We could do the same thing on ARM. For ARM, 2 allocations are done: 1 > > for the FDT, and > > this one for the EFI memory map. Both of these are currently > > allocated with EFI allocation > > functions, so don't have fixed size limits. If we go with the fixed > > size pool, I don't think that 64k > > will be enough for the ARM case, as FDTs can be 20-50k in size. > > The 64k size here is to be debated anyway I think. We currently have > about 1Mb in the x86 variant, and I'd much rather see the pool be > this size initially, properly taking care of releasing to the allocator any > unused portions of it. Thanks for your comments guys. I will reply for all of them probably next week. Now I am busy with bugs in GRUB2. Please stay tuned. Daniel