Fix OsLoader handling of non-container images and remove PcdContainerBootEnabled (#1843)

* OsLoader: set default status to EFI_UNSUPPORTED when parsing a boot image

This was set to EFI_SUCCESS which resulted in ParseBootImages() returning
EFI_SUCCESS even if the boot image was not a container or a component.

Thus, the boot would continue and fail at a later stage due to the
LoadedImage structure not being populated correctly.

Setting it to EFI_UNSUPPORTED will result in ParseBootImages() returning
EFI_UNSUPPORTED if a non-supported boot image is provided and OsLoader
will attempt to boot the next entry in the boot options list.

Signed-off-by: Atharva Lele <atharva.lele@intel.com>

* Remove PcdContainerBootEnabled PCD

SBL requires boot images to be packaged as a container or a component

Signed-off-by: Atharva Lele <atharva.lele@intel.com>

---------

Signed-off-by: Atharva Lele <atharva.lele@intel.com>
This commit is contained in:
Atharva Lele 2023-03-10 14:14:13 -08:00 committed by GitHub
parent c993c5faec
commit 1c807e51fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 8 deletions

View File

@ -315,7 +315,6 @@
gPlatformCommonLibTokenSpaceGuid.PcdVerifiedBootEnabled | FALSE | BOOLEAN | 0x20000210
gPlatformCommonLibTokenSpaceGuid.PcdMeasuredBootEnabled | FALSE | BOOLEAN | 0x20000211
gPlatformCommonLibTokenSpaceGuid.PcdSourceDebugEnabled | FALSE | BOOLEAN | 0x20000212
gPlatformCommonLibTokenSpaceGuid.PcdContainerBootEnabled | FALSE | BOOLEAN | 0x20000213
gPlatformCommonLibTokenSpaceGuid.PcdEmmcHs400SupportEnabled | TRUE | BOOLEAN | 0x20000214
# This PCD will force to initialize SerialPort regardless of its initialized state
gPlatformCommonLibTokenSpaceGuid.PcdForceToInitSerialPort | FALSE | BOOLEAN | 0x20000216

View File

@ -332,7 +332,6 @@
gPayloadTokenSpaceGuid.PcdGrubBootCfgEnabled | $(ENABLE_GRUB_CONFIG)
gPlatformModuleTokenSpaceGuid.PcdSmbiosEnabled | $(ENABLE_SMBIOS)
gPlatformModuleTokenSpaceGuid.PcdLinuxPayloadEnabled | $(ENABLE_LINUX_PAYLOAD)
gPlatformCommonLibTokenSpaceGuid.PcdContainerBootEnabled| $(ENABLE_CONTAINER_BOOT)
gPayloadTokenSpaceGuid.PcdCsmeUpdateEnabled | $(ENABLE_CSME_UPDATE)
gPlatformModuleTokenSpaceGuid.PcdLegacyEfSegmentEnabled | $(ENABLE_LEGACY_EF_SEG)
gPlatformCommonLibTokenSpaceGuid.PcdEmmcHs400SupportEnabled | $(ENABLE_EMMC_HS400)

View File

@ -168,7 +168,6 @@ class BaseBoard(object):
self.ENABLE_GRUB_CONFIG = 0
self.ENABLE_SMBIOS = 0
self.ENABLE_LINUX_PAYLOAD = 0
self.ENABLE_CONTAINER_BOOT = 1
self.ENABLE_CSME_UPDATE = 0
self.ENABLE_EMMC_HS400 = 1
self.ENABLE_DMA_PROTECTION = 0

View File

@ -978,7 +978,7 @@ ParseBootImages (
EFI_STATUS Status;
UINT8 Type;
Status = EFI_SUCCESS;
Status = EFI_UNSUPPORTED;
for (Type = 0; Type < LoadImageTypeMax; Type++) {
if (Type == LoadImageTypeMisc) {
continue;
@ -991,11 +991,11 @@ ParseBootImages (
DEBUG ((DEBUG_INFO, "ParseBootImage ImageType-%d\n", Type));
if ((LoadedImage->Flags & LOADED_IMAGE_CONTAINER) != 0) {
if (FeaturePcdGet (PcdContainerBootEnabled)) {
Status = ParseContainerImage (OsBootOption, LoadedImage);
}
Status = ParseContainerImage (OsBootOption, LoadedImage);
} else if ((LoadedImage->Flags & LOADED_IMAGE_COMPONENT) != 0) {
Status = ParseComponentImage (OsBootOption, LoadedImage);
} else if ((LoadedImage->Flags & LOADED_IMAGE_LINUX) != 0) {
Status = EFI_SUCCESS;
}
if (EFI_ERROR (Status)) {

View File

@ -112,7 +112,6 @@
gPlatformCommonLibTokenSpaceGuid.PcdFrameBufferMaxConsoleWidth
gPlatformCommonLibTokenSpaceGuid.PcdFrameBufferMaxConsoleHeight
gPayloadTokenSpaceGuid.PcdGrubBootCfgEnabled
gPlatformCommonLibTokenSpaceGuid.PcdContainerBootEnabled
gPlatformCommonLibTokenSpaceGuid.PcdMeasuredBootHashMask
gPayloadTokenSpaceGuid.PcdRtcmRsvdSize