From: "Jan Beulich" Subject: Re: [PATCH V4 03/15] create arch functions to get and process EFI memory map. Date: Thu, 11 Sep 2014 15:11:10 +0100 Message-ID: <5411C99E0200007800033F2A@mail.emea.novell.com> References: <1410310325-4509-1-git-send-email-roy.franz@linaro.org> <1410310325-4509-4-git-send-email-roy.franz@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1410310325-4509-4-git-send-email-roy.franz@linaro.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roy Franz Cc: keir@xen.org, ian.campbell@citrix.com, tim@xen.org, xen-devel@lists.xen.org, stefano.stabellini@citrix.com, fu.wei@linaro.org List-Id: xen-devel@lists.xenproject.org >>> On 10.09.14 at 02:51, wrote: > --- a/xen/common/efi/boot.c > +++ b/xen/common/efi/boot.c > @@ -56,8 +56,6 @@ static EFI_HANDLE __initdata efi_ih; > static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut; > static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdErr; > > -static UINT32 __initdata mdesc_ver; Is this correct for the USE_SET_VIRTUAL_ADDRESS_MAP case? > @@ -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. > --- a/xen/include/asm-x86/efi-boot.h > +++ b/xen/include/asm-x86/efi-boot.h > @@ -449,3 +449,89 @@ static void __init place_string(u32 *addr, const char *s) > } > *addr = (long)alloc; > } > + > +static void __init efi_arch_process_memory_map(EFI_SYSTEM_TABLE *SystemTable, > + void *map, > + UINTN map_size, > + UINTN desc_size, > + UINT32 desc_ver) > +{ > + struct e820entry *e; > + int i; This was "unsigned int" originally, and should remain so. Please avoid type changes, or spell them out in the description if you find ones which indeed need adjustment. > +static void __init efi_arch_get_memory_map(UINTN *map_size, > + void **map, > + UINTN *map_key, UINTN *desc_size, > + UINT32 *desc_ver) > +{ > + EFI_STATUS status; Blank line after declarations please. Jan