From: "Jan Beulich" Subject: [PATCH] x86/EFI: improve boot time diagnostics Date: Fri, 06 Jun 2014 07:25:20 +0100 Message-ID: <53917AF0020000780001889A@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part3406FBC0.0__=" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wsnae-00061L-9m for xen-devel@lists.xenproject.org; Fri, 06 Jun 2014 06:25:24 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part3406FBC0.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline To aid analysis of eventual errors, print EFI status codes with error messages where available. Signed-off-by: Jan Beulich --- a/xen/arch/x86/efi/boot.c +++ b/xen/arch/x86/efi/boot.c @@ -344,11 +344,12 @@ static EFI_FILE_HANDLE __init get_parent ret =3D efi_bs->HandleProtocol(loaded_image->DeviceHandle, &fs_protocol, (void **)&fio); if ( EFI_ERROR(ret) ) - blexit(L"Couldn't obtain the File System Protocol Interface");= + PrintErrMesg(L"Couldn't obtain the File System Protocol = Interface", + ret); ret =3D fio->OpenVolume(fio, &dir_handle); } while ( ret =3D=3D EFI_MEDIA_CHANGED ); if ( ret !=3D EFI_SUCCESS ) - blexit(L"OpenVolume failure"); + PrintErrMesg(L"OpenVolume failure", ret); =20 #define buffer ((CHAR16 *)keyhandler_scratch) #define BUFFERSIZE sizeof(keyhandler_scratch) @@ -967,8 +968,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY =20 if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL, (void **)&shim_lock)) && - shim_lock->Verify(kernel.ptr, kernel.size) !=3D EFI_SUCCESS ) - blexit(L"Dom0 kernel image could not be verified."); + (status =3D shim_lock->Verify(kernel.ptr, kernel.size)) !=3D = EFI_SUCCESS ) + PrintErrMesg(L"Dom0 kernel image could not be verified", status); =20 name.s =3D get_value(&cfg, section.s, "ramdisk"); if ( name.s ) @@ -1381,6 +1382,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY =20 status =3D efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key, &efi_mdesc_size, &mdesc_ver); + if ( EFI_ERROR(status) ) + PrintErrMesg(L"Cannot size memory map", status); mbi.mem_upper -=3D efi_memmap_size; mbi.mem_upper &=3D -__alignof__(EFI_MEMORY_DESCRIPTOR); if ( mbi.mem_upper < xen_phys_start ) @@ -1389,7 +1392,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY status =3D efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, = &map_key, &efi_mdesc_size, &mdesc_ver); if ( EFI_ERROR(status) ) - blexit(L"Cannot obtain memory map"); + PrintErrMesg(L"Cannot obtain memory map", status); =20 /* Populate E820 table and check trampoline area availability. */ e =3D e820map - 1; --=__Part3406FBC0.0__= Content-Type: text/plain; name="x86-EFI-boot-diagnostics.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-EFI-boot-diagnostics.patch" x86/EFI: improve boot time diagnostics=0A=0ATo aid analysis of eventual = errors, print EFI status codes with error=0Amessages where available.=0A=0A= Signed-off-by: Jan Beulich =0A=0A--- a/xen/arch/x86/efi/= boot.c=0A+++ b/xen/arch/x86/efi/boot.c=0A@@ -344,11 +344,12 @@ static = EFI_FILE_HANDLE __init get_parent=0A ret =3D efi_bs->HandleProtocol= (loaded_image->DeviceHandle,=0A = &fs_protocol, (void **)&fio);=0A if ( EFI_ERROR(ret) )=0A- = blexit(L"Couldn't obtain the File System Protocol Interface");=0A+ = PrintErrMesg(L"Couldn't obtain the File System Protocol Interface",= =0A+ ret);=0A ret =3D fio->OpenVolume(fio, = &dir_handle);=0A } while ( ret =3D=3D EFI_MEDIA_CHANGED );=0A if ( = ret !=3D EFI_SUCCESS )=0A- blexit(L"OpenVolume failure");=0A+ = PrintErrMesg(L"OpenVolume failure", ret);=0A =0A #define buffer ((CHAR16 = *)keyhandler_scratch)=0A #define BUFFERSIZE sizeof(keyhandler_scratch)=0A@@= -967,8 +968,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY=0A =0A if ( = !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,=0A = (void **)&shim_lock)) &&=0A- shim_lock->Verify(kernel.ptr, = kernel.size) !=3D EFI_SUCCESS )=0A- blexit(L"Dom0 kernel image = could not be verified.");=0A+ (status =3D shim_lock->Verify(kernel.= ptr, kernel.size)) !=3D EFI_SUCCESS )=0A+ PrintErrMesg(L"Dom0 = kernel image could not be verified", status);=0A =0A name.s =3D = get_value(&cfg, section.s, "ramdisk");=0A if ( name.s )=0A@@ -1381,6 = +1382,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY=0A =0A status =3D = efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,=0A = &efi_mdesc_size, &mdesc_ver);=0A+ if ( EFI_ERROR(status= ) )=0A+ PrintErrMesg(L"Cannot size memory map", status);=0A = mbi.mem_upper -=3D efi_memmap_size;=0A mbi.mem_upper &=3D -__alignof__(= EFI_MEMORY_DESCRIPTOR);=0A if ( mbi.mem_upper < xen_phys_start )=0A@@ = -1389,7 +1392,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SY=0A status = =3D efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, &map_key,=0A = &efi_mdesc_size, &mdesc_ver);=0A if ( = EFI_ERROR(status) )=0A- blexit(L"Cannot obtain memory map");=0A+ = PrintErrMesg(L"Cannot obtain memory map", status);=0A =0A /* = Populate E820 table and check trampoline area availability. */=0A e = =3D e820map - 1;=0A --=__Part3406FBC0.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part3406FBC0.0__=--