From 7602900abac3078760e1db11d4bcf83f0901159d Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Mon, 2 Mar 2015 16:19:36 +0000 Subject: ArmVirtualizationPkg: PlatformIntelBdsLib: lack of QEMU kernel is no error When the user doesn't pass a kernel with QEMU's "-kernel" switch, the firmware sees a zero-sized kernel blob via the QemuFwCfgItemKernelSize key; there's no way to distinguish "no kernel" from "zero sized kernel". In both cases TryRunningQemuKernel() proceeds as far as gBS->LoadImage(), which then rejects the zero sized synthetic file with EFI_UNSUPPORTED. This is known and works fully as expected; however we should rather catch the much more frequent "no kernel" case earlier, in order to avoid the EFI_D_ERROR message TryRunningQemuKernel: LoadImage(): Unsupported which is arguably meaningless noise for the "no kernel" case. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel Reviewed-by: Leif Lindholm git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16985 6f19259b-4bc3-4df7-8a09-765794883524 --- .../ArmVirtualizationPkg/Library/PlatformIntelBdsLib/QemuKernel.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ArmPlatformPkg') diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformIntelBdsLib/QemuKernel.c b/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformIntelBdsLib/QemuKernel.c index abcac777e..21545f066 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformIntelBdsLib/QemuKernel.c +++ b/ArmPlatformPkg/ArmVirtualizationPkg/Library/PlatformIntelBdsLib/QemuKernel.c @@ -949,6 +949,11 @@ TryRunningQemuKernel ( InitrdBlob = &mKernelBlob[KernelBlobTypeInitrd]; CommandLineBlob = &mKernelBlob[KernelBlobTypeCommandLine]; + if (KernelBlob->Data == NULL) { + Status = EFI_NOT_FOUND; + goto FreeBlobs; + } + // // Create a new handle with a single VenHw() node device path protocol on it, // plus a custom SimpleFileSystem protocol on it. -- cgit v1.2.3