|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH for-4.22] EFI: Fix boot from a device without a file system
When netbooting a unified Xen kernel image (via GRUB chainloader),
the resulting loaded_image->DeviceHandle does not support
SIMPLE_FILE_SYSTEM_PROTOCOL.
Instead of crashing via noreturn PrintErrMesg(), print a message
via PrintStr() and return NULL from get_parent_handle().
Signed-off-by: Szymon Acedański <accek@xxxxxxxxxxxxxxxxxxxxxx>
---
Tested on Intel Lunar Lake laptop via PXE-loaded GRUB chainloading
the unified image including Xen built from upstream staging. Without
the patch the boot aborts with:
Couldn't obtain the File System Protocol Interface: ErrCode:
0x8000000000000003
(EFI_UNSUPPORTED, per UEFI spec Appendix D). With the patch, dom0
reaches login.
xen/common/efi/boot.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 9ea2183c0b..a6c3c371c6 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -471,6 +471,15 @@ static EFI_FILE_HANDLE __init get_parent_handle(const
EFI_LOADED_IMAGE *loaded_i
/* Get the file system interface. */
ret = efi_bs->HandleProtocol(loaded_image->DeviceHandle,
&fs_protocol, (void **)&fio);
+ if ( ret == EFI_UNSUPPORTED )
+ {
+ /*
+ * The image could come from a device without a file system,
+ * for example it could be a netbooted unified Xen kernel image.
+ */
+ PrintStr(L"File System Protocol not supported on boot device\r\n");
+ return NULL;
+ }
if ( EFI_ERROR(ret) )
PrintErrMesg(L"Couldn't obtain the File System Protocol Interface",
ret);
--
2.53.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |