Received: from list by lists.gnu.org with archive (Exim 4.71) id 1YShoU-0007DC-95 for mharc-grub-devel@gnu.org; Tue, 03 Mar 2015 03:04:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YShoO-0007Cl-Ve for grub-devel@gnu.org; Tue, 03 Mar 2015 03:04:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YShoK-0002fD-SL for grub-devel@gnu.org; Tue, 03 Mar 2015 03:04:16 -0500 Received: from mail.emea.novell.com ([130.57.118.101]:55947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YShoK-0002f1-JW for grub-devel@gnu.org; Tue, 03 Mar 2015 03:04:12 -0500 Received: from EMEA1-MTA by mail.emea.novell.com with Novell_GroupWise; Tue, 03 Mar 2015 08:04:11 +0000 Message-Id: <54F5790902000078000657AD@mail.emea.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.0.1 Date: Tue, 03 Mar 2015 08:04:09 +0000 From: "Jan Beulich" To: "Roy Franz" Subject: Re: [PATCH 17/18] x86/efi: create new early memory allocator 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> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 130.57.118.101 Cc: Juergen Gross , grub-devel@gnu.org, keir , Ian Campbell , Stefano Stabellini , Andrew Cooper , Daniel Kiper , 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 08:04:21 -0000 >>> 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 -=3D *map_size; >>> - mbi.mem_upper &=3D -__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). >=20 > 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. Jan