[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH for-4.5] EFI: Fix efi_arch_allocate_mmap_buffer() to return new size



On Wed, Oct 22, 2014 at 3:42 AM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
> On Wed, 2014-10-22 at 11:07 +0100, Jan Beulich wrote:
>> >>> On 22.10.14 at 06:18, <roy.franz@xxxxxxxxxx> wrote:
>> > --- a/xen/common/efi/boot.c
>> > +++ b/xen/common/efi/boot.c
>> > @@ -271,6 +271,9 @@ static void __init PrintErrMesg(const CHAR16 *mesg, 
>> > EFI_STATUS ErrCode)
>> >      case EFI_COMPROMISED_DATA:
>> >          mesg = L"Compromised data";
>> >          break;
>> > +    case EFI_BUFFER_TOO_SMALL:
>> > +        mesg = L"Buffer too small";
>> > +        break;
>>
>> I don't really mind this change, but ...
>>
>> > @@ -1038,7 +1041,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE
>> > *SystemTable)
>> >
>> >      efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
>> >                           &efi_mdesc_size, &mdesc_ver);
>> > -    efi_memmap = efi_arch_allocate_mmap_buffer(efi_memmap_size);
>> > +    efi_memmap = efi_arch_allocate_mmap_buffer(&efi_memmap_size);
>> >      if ( !efi_memmap )
>> >          blexit(L"Unable to allocate memory for EFI memory map");
>>
>> ... it would not have helped here, as you don't even get to see the
>> error code here.
>
> This patch came about because I was seeing:
>         Cannot obtain memory map: ErrCode: 0x8000000000000005
> which I suppose is a different path. I don't think the allocation above
> would have ever returned EFI_BUFFER_TOO_SMALL, would it?
>
> Ian.

The error there is generic since for ARM we do an AllocatePool(), and for x86 we
use the string buffer that is allocated before the _start symbol.  We
don't have an
EFI error code to decode at this point - the EFI error code only exists in the
ARM efi_arch_allocate_mmap_buffer() function.

Roy

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.