From: Ian Campbell Subject: Re: [PATCH V4 03/15] create arch functions to get and process EFI memory map. Date: Fri, 12 Sep 2014 10:45:44 +0100 Message-ID: <1410515144.567.25.camel@kazak.uk.xensource.com> References: <1410310325-4509-1-git-send-email-roy.franz@linaro.org> <1410310325-4509-4-git-send-email-roy.franz@linaro.org> <5411C99E0200007800033F2A@mail.emea.novell.com> <5412B7D602000078000344E2@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5412B7D602000078000344E2@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: keir , tim , xen-devel , Roy Franz , Stefano Stabellini , Fu Wei List-Id: xen-devel@lists.xenproject.org On Fri, 2014-09-12 at 08:07 +0100, Jan Beulich wrote: > >>> On 11.09.14 at 19:40, wrote: > > On Thu, Sep 11, 2014 at 7:11 AM, Jan Beulich wrote: > >>>>> On 10.09.14 at 02:51, wrote: > >>> @@ -1171,67 +1169,12 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) > >>> } > >>> } > >>> > >>> - efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key, > >>> - &efi_mdesc_size, &mdesc_ver); > >>> - mbi.mem_upper -= efi_memmap_size; > >>> - mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR); > >>> - if ( mbi.mem_upper < xen_phys_start ) > >>> - blexit(L"Out of static memory"); > >>> - efi_memmap = (void *)(long)mbi.mem_upper; > >>> - status = efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, &map_key, > >>> - &efi_mdesc_size, &mdesc_ver); > >>> - if ( EFI_ERROR(status) ) > >>> - PrintErrMesg(L"Cannot obtain memory map", status); > >>> + efi_arch_get_memory_map(&mmap_size, &mmap, &mmap_key, > >>> + &mmap_desc_size, &mmap_desc_ver); > >> > >> The only arch-specific bit here is where to put the map. > > Yes, but the ARM method of allocating the space can make the map > > bigger. So something which ARM does can make the result of efi_bs->GetMemoryMap longer? Or are we talking about the bootinfo.mem array? > I can re-arrange > > this so that only the memory allocation is in the arch code, but I > > think the current implementation > > is also reasonable. > > Hmm, yes, if ARM has no way of avoiding the growth of the map > during allocation (which at a first glance seems suspicious to me), > then yes. Is there a problem allocating a few more entries than the > map's current size, so the possible growth can be accommodated? > > Jan >