From nobody Sat May 18 07:08:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+76901+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76901+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1624417497; cv=none; d=zohomail.com; s=zohoarc; b=BqrkrA+gmJrnZcUjRNtbfn2BdqTbn4kl+vc4cT7hv/My//ZBrpA4YcPIxIV1/Npsu59Ln1+7hEmg52SAPLh8behSNCxBweW9S5QEzoPeXNNmfto/HXdJRmjGklx3UYqAz4rnjP7Q8FYGLjciPLBoOl091tkxV2t/fF1EbAny/ts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624417497; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=kvawg2/Np9k+wYFLuAYE1c0X0hw5bFciTDnSWghKULQ=; b=jR1MH+9HJMljfUbJIVgdqvn/CxKiquci9zoCkKgtUdsXT+LVq4q19c2p/INXv124mNLeXZZZoL97xPcBl9UNv7JrLlpJuYfTggaqsO38hS0xeJDU8PuTnSXaJDUlmNs58UiDDpbKkaw5yDlFl0FGmFku939kL+eIFGOPU+O5VSg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76901+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1624417497992167.91831940774614; Tue, 22 Jun 2021 20:04:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id oDDuYY1788612xgle4oev0be; Tue, 22 Jun 2021 20:04:57 -0700 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web11.2551.1624417487963061830 for ; Tue, 22 Jun 2021 20:04:52 -0700 IronPort-SDR: 2FoP4hnukNww7ao3nC0CoSWGa3490VaqxoIiiEZggJ42sWcNOqij3xGCxVxLPVpMdqsUgRkyY3 J5t+nGOJTFDw== X-IronPort-AV: E=McAfee;i="6200,9189,10023"; a="204176843" X-IronPort-AV: E=Sophos;i="5.83,293,1616482800"; d="scan'208";a="204176843" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 20:04:52 -0700 IronPort-SDR: 1AioDxQDXpz5XB0TXKsgTdBOyXaJkh9HhsKqqoBb8gQYaKYr8hXx89CKqu2rBTUhkv2EoKZaXt FWCIgxYXbQnA== X-IronPort-AV: E=Sophos;i="5.83,293,1616482800"; d="scan'208";a="556824015" X-Received: from duntan-mobl.ccr.corp.intel.com ([10.238.1.156]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 20:04:50 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Maurice Ma , Guo Dong , Benjamin You , DunTan Subject: [edk2-devel] [Patch V2 1/2] UefiPayloadPkg: Add new structure for BootManagerMenuFile HOB Date: Wed, 23 Jun 2021 11:04:23 +0800 Message-Id: <20210623030424.2096-2-dun.tan@intel.com> In-Reply-To: <20210623030424.2096-1-dun.tan@intel.com> References: <20210623030424.2096-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dun.tan@intel.com X-Gm-Message-State: QtyRq6KpEEUEL7evq5QEKu40x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1624417497; bh=9BVts6gsb+dhh4eE41aXPAyV/TTfqtfB6pF2/15GrzQ=; h=Cc:Date:From:Reply-To:Subject:To; b=rvyQ0jnoBy2JEj5fI8VvhQka4V9IXAXYHV1FwHz3eY/OU/SeZ4LNQgCuev4HGByH80N pnzfESOmHxZxOaBv4+pkMS68FtEXO9MqNVg6QcKAIcuyEyYHNfZa6iK4Ka1JZur4L7XQo C4ossBwuLkp7b3HkbEkYHAVifuttgv/kAiU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add new structure for BootManagerMenuFile HOB in UefiPayloadPkg Cc: Maurice Ma Cc: Guo Dong Cc: Benjamin You Signed-off-by: DunTan Reviewed-by: Guo Dong --- UefiPayloadPkg/Include/Guid/BootManagerMenu.h | 27 +++++++++++++++++++++++= ++++ UefiPayloadPkg/UefiPayloadPkg.dec | 3 +++ 2 files changed, 30 insertions(+) diff --git a/UefiPayloadPkg/Include/Guid/BootManagerMenu.h b/UefiPayloadPkg= /Include/Guid/BootManagerMenu.h new file mode 100644 index 0000000000..d17cdf3084 --- /dev/null +++ b/UefiPayloadPkg/Include/Guid/BootManagerMenu.h @@ -0,0 +1,27 @@ +/** @file + Define the structure for the Boot Manager Menu File. + +Copyright (c) 2021, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU_H_ +#define UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU_H_ + +#include +#include + +#pragma pack (1) + +typedef struct { + UNIVERSAL_PAYLOAD_GENERIC_HEADER Header; + GUID FileName; +} UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU; + +#pragma pack() + +#define UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU_REVISION 1 + +extern GUID gEdkiiBootManagerMenuFileGuid; +#endif diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayload= Pkg.dec index 105e1f5a1c..d2b2dbeb25 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dec +++ b/UefiPayloadPkg/UefiPayloadPkg.dec @@ -29,6 +29,9 @@ # gBmpImageGuid =3D { 0x878AC2CC, 0x5343, 0x46F2= , { 0xB5, 0x63, 0x51, 0xF8, 0x9D, 0xAF, 0x56, 0xBA } } =20 + ##include/Guid/BootManagerMenu.h + gEdkiiBootManagerMenuFileGuid =3D { 0xdf939333, 0x42fc, 0x4b2a, { 0xa5, = 0x9e, 0xbb, 0xae, 0x82, 0x81, 0xfe, 0xef }} + gUefiSystemTableInfoGuid =3D {0x16c8a6d0, 0xfe8a, 0x4082, {0xa2, 0x8, 0x= cf, 0x89, 0xc4, 0x29, 0x4, 0x33}} gUefiAcpiBoardInfoGuid =3D {0xad3d31b, 0xb3d8, 0x4506, {0xae, 0x71, 0x= 2e, 0xf1, 0x10, 0x6, 0xd9, 0xf}} gUefiSerialPortInfoGuid =3D { 0x6c6872fe, 0x56a9, 0x4403, { 0xbb, 0x98,= 0x95, 0x8d, 0x62, 0xde, 0x87, 0xf1 } } --=20 2.31.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#76901): https://edk2.groups.io/g/devel/message/76901 Mute This Topic: https://groups.io/mt/83730327/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 18 07:08:55 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+76902+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76902+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1624417502; cv=none; d=zohomail.com; s=zohoarc; b=CJqps+7gOCAoQQL3oTqFjOvbYmOMwmeE41we9uNcr706MPcRz115vQ2iKxGu+Elmy/xXdPPDMqi3KyE31zuVHzYoBHRHRUL3j5qfwaQVZSE38FQkqges3FyTfiHyqoj51ZL++UNHb8qPPwKe8jrNbh8vsxeufg8PSHFKtSyIeuM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624417502; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=BuLfwJvg4IE+SNoLJpM1ZDzR8ly0nugIhBb1e9vQFB4=; b=g1VVFkVJyvkNe3veAqX4XTbqc9XBL71YBRMmA4Yj7us1ZzQNGQc/EE30eYEBtmMuQUCjsu1diipVr/B6LSeLpvIQME4n6+YGxXC3LWMC6OeB8jGbWWIaDHTIXU9ck12wANq81TQAFYBG9VhGlF341ckAd0ZZiRTj0nRPBp0lU9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+76902+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1624417502700199.582058170329; Tue, 22 Jun 2021 20:05:02 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cuWUYY1788612xndaLXQl5DH; Tue, 22 Jun 2021 20:05:02 -0700 X-Received: from mga11.intel.com (mga11.intel.com []) by mx.groups.io with SMTP id smtpd.web11.2551.1624417487963061830 for ; Tue, 22 Jun 2021 20:04:57 -0700 IronPort-SDR: Omga5NMWG1rHoa5t/IDXZTRinTAwLYioz2iqAh2bn7mKroTUo7zs5seD7/MAcXaDTCfB7cRul6 asZ0kuSh6Nuw== X-IronPort-AV: E=McAfee;i="6200,9189,10023"; a="204176865" X-IronPort-AV: E=Sophos;i="5.83,293,1616482800"; d="scan'208";a="204176865" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 20:04:56 -0700 IronPort-SDR: Y6Fn4Fk7WOGG/eqAJxUgLv+4enx0G6JPiXEE0dxRnZVUpyr+FkKYWCR5xDq8V/jq9HEFMqf66d KsoRGyOHZn4g== X-IronPort-AV: E=Sophos;i="5.83,293,1616482800"; d="scan'208";a="556824023" X-Received: from duntan-mobl.ccr.corp.intel.com ([10.238.1.156]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 20:04:54 -0700 From: "duntan" To: devel@edk2.groups.io Cc: Maurice Ma , Guo Dong , Benjamin You , DunTan Subject: [edk2-devel] [Patch V2 2/2] UefiPayloadPkg: consume the BootManagerMenuFile HOB Date: Wed, 23 Jun 2021 11:04:24 +0800 Message-Id: <20210623030424.2096-3-dun.tan@intel.com> In-Reply-To: <20210623030424.2096-1-dun.tan@intel.com> References: <20210623030424.2096-1-dun.tan@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dun.tan@intel.com X-Gm-Message-State: A1l4OMPcdogBshXBFz4xqZH6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1624417502; bh=oHq2f5pHbF4kz4sYKvQ5svwjneabi6xkK57+EFnnsxc=; h=Cc:Date:From:Reply-To:Subject:To; b=s4znSny/OLmDpRnGnn9xQ9jfc20MA78pfabjSzBsnlocV/zwLeX8IUOGmWgZD07KDQr jfz1bGQswSCZZ1TQKQqdyk09YM/f5L3Xh8QMLzequHm8k6VPmOTAxybecApBS7Jcne0cL vtd3g3uKKr+nxzD+zUhLNJAM8iQNKfMbhMc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Consume the BootManagerMenuFile HOB in PlatformBootManagerLib This Lib is in UefiPayloadPkg Cc: Maurice Ma Cc: Guo Dong Cc: Benjamin You Signed-off-by: DunTan Reviewed-by: Guo Dong --- UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c |= 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |= 5 ++++- UefiPayloadPkg/UefiPayloadPkg.dsc |= 2 +- 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana= ger.c b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c index fce48d26a1..c4d317fa9e 100644 --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager.c @@ -10,6 +10,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include "PlatformBootManager.h" #include "PlatformConsole.h" #include +#include +#include =20 UNIVERSAL_PAYLOAD_PLATFORM_BOOT_MANAGER_OVERRIDE_PROTOCOL *mUniversalPayl= oadPlatformBootManagerOverrideInstance =3D NULL; =20 @@ -286,3 +288,53 @@ PlatformBootManagerUnableToBoot ( return; } =20 +/** + Get/update PcdBootManagerMenuFile from GUID HOB which will be assigned i= n bootloader. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval other Some error occurs. + +**/ +EFI_STATUS +EFIAPI +PlatformBootManagerLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable +) +{ + EFI_STATUS Status; + UINTN Size; + VOID *GuidHob; + UNIVERSAL_PAYLOAD_GENERIC_HEADER *GenericHeader; + UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU *BootManagerMenuFile; + + GuidHob =3D GetFirstGuidHob (&gEdkiiBootManagerMenuFileGuid); + + if (GuidHob =3D=3D NULL) { + // + // If the HOB is not create, the default value of PcdBootManagerMenuFi= le will be used. + // + return EFI_SUCCESS; + } + + GenericHeader =3D (UNIVERSAL_PAYLOAD_GENERIC_HEADER *) GET_GUID_HOB_DATA= (GuidHob); + if ((sizeof (UNIVERSAL_PAYLOAD_GENERIC_HEADER) > GET_GUID_HOB_DATA_SIZE = (GuidHob)) || (GenericHeader->Length > GET_GUID_HOB_DATA_SIZE (GuidHob))) { + return EFI_NOT_FOUND; + } + if (GenericHeader->Revision =3D=3D UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU_R= EVISION) { + BootManagerMenuFile =3D (UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU *) GET_GU= ID_HOB_DATA (GuidHob); + if (BootManagerMenuFile->Header.Length < UNIVERSAL_PAYLOAD_SIZEOF_THRO= UGH_FIELD (UNIVERSAL_PAYLOAD_BOOT_MANAGER_MENU, FileName)) { + return EFI_NOT_FOUND; + } + Size =3D sizeof (BootManagerMenuFile->FileName); + Status =3D PcdSetPtrS (PcdBootManagerMenuFile, &Size, &BootManagerMenu= File->FileName); + ASSERT_EFI_ERROR (Status); + } else { + return EFI_NOT_FOUND; + } + + return EFI_SUCCESS; +} diff --git a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana= gerLib.inf b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootMana= gerLib.inf index 600a535282..9c4a9da943 100644 --- a/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.= inf +++ b/UefiPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.= inf @@ -13,7 +13,7 @@ MODULE_TYPE =3D DXE_DRIVER VERSION_STRING =3D 1.0 LIBRARY_CLASS =3D PlatformBootManagerLib|DXE_DRIVER - + CONSTRUCTOR =3D PlatformBootManagerLibConstructor =20 # # The following information is for reference only and not required by the = build tools. @@ -46,9 +46,11 @@ HiiLib PrintLib PlatformHookLib + HobLib =20 [Guids] gEfiEndOfDxeEventGroupGuid + gEdkiiBootManagerMenuFileGuid =20 [Protocols] gEfiGenericMemTestProtocolGuid ## CONSUMES @@ -70,3 +72,4 @@ gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits + gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index 21b360256b..e46b867d30 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -289,7 +289,6 @@ !endif gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable|TRUE - gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c= , 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0= x31 } =20 =20 !if $(SOURCE_DEBUG_ENABLE) @@ -297,6 +296,7 @@ !endif =20 [PcdsPatchableInModule.common] + gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c= , 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0= x31 } gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F !if $(SOURCE_DEBUG_ENABLE) --=20 2.31.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#76902): https://edk2.groups.io/g/devel/message/76902 Mute This Topic: https://groups.io/mt/83730328/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-