From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by mx.groups.io with SMTP id smtpd.web10.4150.1578460675809385132 for ; Tue, 07 Jan 2020 21:17:55 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=n1 header.b=HXxMu1E7; spf=pass (domain: nvidia.com, ip: 216.228.121.64, mailfrom: ashishsingha@nvidia.com) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 07 Jan 2020 21:17:37 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Tue, 07 Jan 2020 21:17:55 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 07 Jan 2020 21:17:55 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 8 Jan 2020 05:17:54 +0000 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 8 Jan 2020 05:17:54 +0000 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 8 Jan 2020 05:17:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lcTJ2zcHg356gLih9QI4Syq9+tZ4rJ6T8fy2JlygPVtnhnEtFHxfnfImIz7gXRAyQDN+SJ8oRa1PsAV7yXq64Qy5Jzl6g+2GM/ScV++/VKh6XhjWLzHr1cc/RihdcyOQiVHj6V9u6T36B2+3Zln1g8e0aFI95OtmC9FXutFZiYmnmpne7fzeCQk+mCQQIMzKL1TO9Rim/0QuHV8hs3NPf1UgnPyDw+mS0of0faM7AGRE+vtydLDi3u9q/HsKD+WxTEqsURyaW/xBc2UDOD4FUCrcSPk9JBuKll/TpUVbo37u4D9BK3iTODOt8rN57w1awyrEKVJp60Kfs68XHdnn+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uj05+ncPZjNmEvxhtPpb3zQTBeqAVn3HXBFjwO6FG90=; b=hpe6u9IkKSF9Si2ylMjp4USgljpAtavV8AJbhpcdRyUes3RhFYZ2zAwi699h7azFV/kZ0b5p0n2uaGJswkZokrUoeRVnb1QmKb6pJaIKr2RM6lcux5i9w/i1qBJTmPj6NNhHWPKE5uOSJy+IQBn2URuKZ7wJg4mL8lt7z0V+kqxr1a7/DUAii41imra7f7//896QotlL8DqLtay+RrS9xqc4qeTJFTdKUplzYeidA873ubw4O0VwAvNuE9FCAIATYDeSJgK396Ax0hlv+yOd4vn6u6ZNVe6EY5kLV/BQlMQN8YyyGbsdgDEcRgFtZb/Pzac9tKtZcDexwoOSM5GqSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from CY4PR1201MB0134.namprd12.prod.outlook.com (10.172.77.143) by CY4PR1201MB0117.namprd12.prod.outlook.com (10.174.53.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.12; Wed, 8 Jan 2020 05:17:52 +0000 Received: from CY4PR1201MB0134.namprd12.prod.outlook.com ([fe80::d8da:419a:32ed:2bcc]) by CY4PR1201MB0134.namprd12.prod.outlook.com ([fe80::d8da:419a:32ed:2bcc%11]) with mapi id 15.20.2602.016; Wed, 8 Jan 2020 05:17:52 +0000 From: "Ashish Singhal" To: "Wang, Jian J" , "Wu, Hao A" , "devel@edk2.groups.io" CC: "Spottswood, Jason" , "Wang, Sunny (HPS SW)" , "Ni, Ray" , "Gao, Zhichao" , "Kinney, Michael D" , Andrew Fish Subject: Re: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platform Boot Manager Protocol Thread-Topic: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platform Boot Manager Protocol Thread-Index: AQHVugXv6LmlHnBoBkifwoV/hip+BKfItVkAgAAQSACAAwMdV4AK5WMAgAmi1RA= Date: Wed, 8 Jan 2020 05:17:52 +0000 Message-ID: References: <2fa4a9e68aca6e56ba948ba612b75601d33d279f.1577156123.git.ashishsingha@nvidia.com> ,<734D49CCEBEEF84792F5B80ED585239D5C3A9F8F@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C3D05C5@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C3D05C5@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Enabled=True; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SiteId=43083d15-7273-40c1-b7db-39efd9ccc17a; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Owner=ashishsingha@nvidia.com; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_SetDate=2020-01-08T05:17:50.2410203Z; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Name=Unrestricted; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Application=Microsoft Azure Information Protection; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_ActionId=69c7664a-e40b-4343-a461-40e94cd8489d; MSIP_Label_6b558183-044c-4105-8d9c-cea02a2a3d86_Extended_MSFT_Method=Automatic authentication-results: spf=none (sender IP is ) smtp.mailfrom=ashishsingha@nvidia.com; x-originating-ip: [8.46.90.104] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d4313936-087d-40c9-54b1-08d793fa1c79 x-ms-traffictypediagnostic: CY4PR1201MB0117: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:403; x-forefront-prvs: 02760F0D1C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(39860400002)(346002)(376002)(396003)(199004)(189003)(13464003)(5660300002)(66556008)(66476007)(7696005)(33656002)(76116006)(66946007)(186003)(66446008)(64756008)(26005)(86362001)(76236002)(71200400001)(81166006)(52536014)(2906002)(55016002)(30864003)(316002)(110136005)(81156014)(54906003)(53546011)(45080400002)(478600001)(8676002)(4326008)(6506007)(8936002)(9686003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR1201MB0117;H:CY4PR1201MB0134.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CPBUjPV5g9VRk/1/FY3DzQbqi/ji7tczgynvlgPARmip1ErcMBl5+SPVMYpNGlWXPBb87781LAfPugR1USUfRBSCXSVXVfwBsIOs42jpPWbkhqKJsZtS/rsznYpQstnZUUuL/0UdjeYhZMJUw7QkEEVDD65IMmlMrpF8wTcuzlQVLHdmwFD43DcEzS/e7AcRWbHa/yleoYOZDaIkWer2deQQy8uFz5xI+5ypVgbCwDjY9K/brWb6nk1kq/WtEE+624iaXEbFLzoW6Dbv5Fou+xQmZng9kyk4iClPsQuX4aBxdHobtr2HDSv0H/PHBGbCIA8aaDqSs8lfeYiguAqrBsDlrk5DT6Rg0FmVUZI70SEKd+cgHRHlg8vxfTMGTKIeQyEWd/oYcxLNMuDdONAV9ZYScQcNVwMABZvMWhIrdf4urO1vBPQEwsioD1UjMQKIiNF8S0GCouM0A6plUyLDO2Fu1Ya70CaacnL2Y6ZokvvmuS1AcX9/otbztDPl2tnkl1XHi01BEKmn5u2B/0VXQpafGZrgmZHhSUszpKonJn4SM8QRa/hTPDt4Kp8TaFdm x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d4313936-087d-40c9-54b1-08d793fa1c79 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2020 05:17:52.4005 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dy1CDScce3v7hJKjF+FS/02CaVx9/4CyNTGJgljaUrDsoWzF4QNUPpSAhwZTF1fAbAJAG1AknRpM2MFJoZYbfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0117 Return-Path: ashishsingha@nvidia.com X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1578460657; bh=uj05+ncPZjNmEvxhtPpb3zQTBeqAVn3HXBFjwO6FG90=; h=X-PGP-Universal:ARC-Seal:ARC-Message-Signature: ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic: Thread-Index:Date:Message-ID:References:In-Reply-To: Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator:msip_labels: authentication-results:x-originating-ip:x-ms-publictraffictype: x-ms-office365-filtering-correlation-id:x-ms-traffictypediagnostic: x-microsoft-antispam-prvs:x-ms-oob-tlc-oobclassifiers: x-forefront-prvs:x-forefront-antispam-report:received-spf: x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-ms-exchange-transport-forked: MIME-Version:X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg: Content-Language:Content-Type; b=HXxMu1E7phivQ5U75XquguwnZ22rfM9Q6mGK79a2j12JkFRopaQoW0yw2XsJ7ROLG iAE2h7eDqkKRDUmeZCG7GLhQWqG3DNOJLcOMaMtwpY5hULKtgz86d7CaXp2RWEWxt2 31tVy1EifIqvhn/el7mgDdE3XY7UBPUCycJf+VwZNksb73ojgddmS5W0kde8nJ66Mi l8NlaJL1iyOeWr5cHOAkDYSRZJqzSJrw3r8v9JmMPMuPELxmpsUFSZXmLV9d4qOvs+ Mqtzo4AKqzc7LfL6l7oh3Qg69wRhPqengHvOT0sUBWgkZTaVxOhR61MhphRqvnvyxI Kh4+ZU1VysAxw== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR1201MB0134972C9E43E5CD5A3A7E8FBA3E0CY4PR1201MB0134_" --_000_CY4PR1201MB0134972C9E43E5CD5A3A7E8FBA3E0CY4PR1201MB0134_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Hao/Jian, As per Maintainers.txt, I think you guys are the overall maintainers of Md= eModulePkg. Bringing this patch to your attention so that it could be submi= tted. Ray who is the reviewer of BDS changes has already reviewed this patc= h. Thanks Ashish From: Ni, Ray Sent: Wednesday, January 1, 2020 7:05 PM To: devel@edk2.groups.io; Ashish Singhal ; Wang, = Sunny (HPS SW) ; Wang, Jian J ; W= u, Hao A ; Gao, Zhichao ; Kinney= , Michael D ; afish@apple.com Cc: Spottswood, Jason Subject: RE: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platform Boot = Manager Protocol External email: Use caution opening links or attachments Ashish, no follow up is required from your side. MdeModulePkg maintainers will help to push the patches. From: devel@edk2.groups.io > On Behalf Of Ashish Singhal Sent: Thursday, December 26, 2019 11:42 AM To: Ni, Ray >; Wang, Sunny (HPS = SW) >; devel@edk2.groups.io; Wang, Jian J >; Wu, Hao A >; Gao, Zhichao >; Kin= ney, Michael D >; afish@apple.com Cc: Spottswood, Jason > Subject: Re: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platform Boot = Manager Protocol Hi Ray, Following up on this. Are we waiting on more suggestions or clarifications= ? Thanks Ashish Get Outlook for iOS ________________________________ From: Ni, Ray > Sent: Monday, December 23, 2019 10:41:50 PM To: Wang, Sunny (HPS SW) >; de= vel@edk2.groups.io >; Ashish Singhal >; Wang, Jian J >; Wu, Hao A >= ; Gao, Zhichao >; Kinne= y, Michael D = >; afish@apple.com > Cc: Spottswood, Jason > Subject: RE: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platform Boot = Manager Protocol External email: Use caution opening links or attachments Reviewed-by: Ray Ni > > -----Original Message----- > From: Wang, Sunny (HPS SW) > > Sent: Tuesday, December 24, 2019 12:44 PM > To: devel@edk2.groups.io; ashishsingha@nvid= ia.com; Ni, Ray > >; Wang, Jian J >; Wu, Hao A > >; Gao, Zhichao >; Kinney, > Michael D = >; afish@apple.com > Cc: Wang, Sunny (HPS SW) >; = Spottswood, Jason > > > Subject: RE: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platform > Boot Manager Protocol > > Looks good enough to me. Thanks for addressing my comments, Ashish. > Reviewed-by: Sunny Wang > > > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@ed= k2.groups.io] On Behalf Of > Ashish Singhal > Sent: Tuesday, December 24, 2019 10:58 AM > To: devel@edk2.groups.io; ray.ni@intel.com<= mailto:ray.ni@intel.com>; jian.j.wang@intel.com; > hao.a.wu@intel.com; zhichao.gao@intel.com; michael.d.kinney@intel.com; > afish@apple.com > Cc: Ashish Singhal > > Subject: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platform Boot > Manager Protocol > > Add edk2 platform boot manager protocol which would have platform > specific refreshes to the auto enumerated as well as NV boot options for= the > platform. > > Signed-off-by: Ashish Singhal > > --- > .../Include/Protocol/PlatformBootManager.h | 82 > ++++++++++++++++++++++ > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 41 +++++++++-- > .../Library/UefiBootManagerLib/InternalBm.h | 2 + > .../UefiBootManagerLib/UefiBootManagerLib.inf | 2 + > MdeModulePkg/MdeModulePkg.dec | 4 ++ > 5 files changed, 124 insertions(+), 7 deletions(-) create mode 100644 > MdeModulePkg/Include/Protocol/PlatformBootManager.h > > diff --git a/MdeModulePkg/Include/Protocol/PlatformBootManager.h > b/MdeModulePkg/Include/Protocol/PlatformBootManager.h > new file mode 100644 > index 0000000..26b9ce4 > --- /dev/null > +++ b/MdeModulePkg/Include/Protocol/PlatformBootManager.h > @@ -0,0 +1,82 @@ > +/** @file > + > + Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ > +#define __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ > + > +#include > + > +// > +// Platform Boot Manager Protocol GUID value // #define > +EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_GUID \ > + { \ > + 0xaa17add4, 0x756c, 0x460d, { 0x94, 0xb8, 0x43, 0x88, 0xd7, 0xfb,= 0x3e, > 0x59 } \ > + } > + > +// > +// Protocol interface structure > +// > +typedef struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL > +EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL; > + > +// > +// Revision The revision to which the protocol interface adheres. > +// All future revisions must be backwards compatible. > +// If a future version is not back wards compatible it is not = the same > GUID. > +// > +#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION > 0x00000001 > + > +// > +// Function Prototypes > +// > + > +/* > + This function allows platform to refresh all boot options specific to > +the platform. Within > + this function, platform can make modifications to the auto enumerated > +platform boot options > + as well as NV boot options. > + > + @param[in const] BootOptions An array of auto enumerated > platform boot options. > + This array will be freed by = caller upon successful > + exit of this function and ou= tput array would be used. > + > + @param[in const] BootOptionsCount The number of elements in > BootOptions. > + > + @param[out] UpdatedBootOptions An array of boot options tha= t > have been customized > + for the platform on top of i= nput boot options. This > + array would be allocated by > REFRESH_ALL_BOOT_OPTIONS > + and would be freed by caller= after consuming it. > + > + @param[out] UpdatedBootOptionsCount The number of elements in > UpdatedBootOptions. > + > + > + @retval EFI_SUCCESS Platform refresh to input Bo= otOptions and > + BootCount have been done. > + > + @retval EFI_OUT_OF_RESOURCES Memory allocation failed. > + > + @retval EFI_INVALID_PARAMETER Input is not correct. > + > + @retval EFI_UNSUPPORTED Platform specific overrides = are not > supported. > +*/ > +typedef > +EFI_STATUS > +(EFIAPI *PLATFORM_BOOT_MANAGER_REFRESH_ALL_BOOT_OPTIONS) ( > + IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions, > + IN CONST UINTN BootOptionsCount, > + OUT EFI_BOOT_MANAGER_LOAD_OPTION **UpdatedBootOptions, > + OUT UINTN *UpdatedBootOptionsCount > + ); > + > +struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL { > + UINT64 Revision; > + PLATFORM_BOOT_MANAGER_REFRESH_ALL_BOOT_OPTIONS > RefreshAllBootOptions; > +}; > + > +extern EFI_GUID gEdkiiPlatformBootManagerProtocolGuid; > + > +#endif /* __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ */ > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > index 760d764..62c5b2dc 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > @@ -1,6 +1,7 @@ > /** @file > Library functions which relates with booting. > > +Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. > Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.
> (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
> SPDX-License-Identifier: BSD-2-Clause-Patent @@ -2258,12 +2259,15 @@ > EfiBootManagerRefreshAllBootOption ( > VOID > ) > { > - EFI_STATUS Status; > - EFI_BOOT_MANAGER_LOAD_OPTION *NvBootOptions; > - UINTN NvBootOptionCount; > - EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions; > - UINTN BootOptionCount; > - UINTN Index; > + EFI_STATUS Status; > + EFI_BOOT_MANAGER_LOAD_OPTION *NvBootOptions; > + UINTN NvBootOptionCount; > + EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions; > + UINTN BootOptionCount; > + EFI_BOOT_MANAGER_LOAD_OPTION *UpdatedBootOptions; > + UINTN UpdatedBootOptionCount; > + UINTN Index; > + EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL *PlatformBootManager; > > // > // Optionally refresh the legacy boot option @@ -2273,7 +2277,6 @@ > EfiBootManagerRefreshAllBootOption ( > } > > BootOptions =3D BmEnumerateBootOptions (&BootOptionCount); > - NvBootOptions =3D EfiBootManagerGetLoadOptions (&NvBootOptionCount, > LoadOptionTypeBoot); > > // > // Mark the boot option as added by BDS by setting OptionalData to a > special GUID @@ -2284,6 +2287,30 @@ > EfiBootManagerRefreshAllBootOption ( > } > > // > + // Locate Platform Boot Options Protocol // Status =3D > + gBS->LocateProtocol (&gEdkiiPlatformBootManagerProtocolGuid, > + NULL, > + (VOID **)&PlatformBootManager); if > + (!EFI_ERROR (Status)) { > + // > + // If found, call platform specific refresh to all auto enumerated = and NV > + // boot options. > + // > + Status =3D PlatformBootManager->RefreshAllBootOptions ((CONST > EFI_BOOT_MANAGER_LOAD_OPTION *)BootOptions, > + (CONST UINTN)B= ootOptionCount, > + &UpdatedBootOp= tions, > + &UpdatedBootOp= tionCount); > + if (!EFI_ERROR (Status)) { > + EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount); > + BootOptions =3D UpdatedBootOptions; > + BootOptionCount =3D UpdatedBootOptionCount; > + } > + } > + > + NvBootOptions =3D EfiBootManagerGetLoadOptions (&NvBootOptionCount, > + LoadOptionTypeBoot); > + > + // > // Remove invalid EFI boot options from NV > // > for (Index =3D 0; Index < NvBootOptionCount; Index++) { diff --git > a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h > b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h > index 027eb25..ac866ac 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h > +++ b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h > @@ -1,6 +1,7 @@ > /** @file > BDS library definition, include the file and data structure > > +Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. > Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
> (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> SPDX-License-Identifier: BSD-2-Clause-Patent @@ -41,6 +42,7 @@ SPDX- > License-Identifier: BSD-2-Clause-Patent #include > #include #include > +#include > > #include #include > diff --git > a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > index ed6b467..cf59086 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > +++ > b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > @@ -5,6 +5,7 @@ > # manipulation, hotkey registration, UEFI boot, connect/disconnect, co= nsole > # manipulation, driver health checking and etc. > # > +# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. > # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved. # (C) > Copyright 2016 Hewlett Packard Enterprise Development LP
# SPDX- > License-Identifier: BSD-2-Clause-Patent @@ -107,6 +108,7 @@ > gEfiFormBrowser2ProtocolGuid ## SOMETIMES_CONSUMES > gEfiRamDiskProtocolGuid ## SOMETIMES_CONSUMES > gEfiDeferredImageLoadProtocolGuid ## SOMETIMES_CONSUMES > + gEdkiiPlatformBootManagerProtocolGuid ## SOMETIMES_CONSUMES > > [Pcd] > > gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationC > hange ## SOMETIMES_CONSUMES > diff --git a/MdeModulePkg/MdeModulePkg.dec > b/MdeModulePkg/MdeModulePkg.dec index 41b9e70..cc238e9 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -3,6 +3,7 @@ > # It also provides the definitions(including PPIs/PROTOCOLs/GUIDs and > library classes) # and libraries instances, which are used for those mo= dules. > # > +# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. > # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved. # > Copyright (c) 2016, Linaro Ltd. All rights reserved.
# (C) Copyrigh= t 2016 - > 2019 Hewlett Packard Enterprise Development LP
@@ -609,6 +610,9 > @@ > ## Include/Protocol/PeCoffImageEmulator.h > gEdkiiPeCoffImageEmulatorProtocolGuid =3D { 0x96f46153, 0x97a7, 0x479= 3, > { 0xac, 0xc1, 0xfa, 0x19, 0xbf, 0x78, 0xea, 0x97 } } > > + ## Include/Protocol/PlatformBootManager.h > + gEdkiiPlatformBootManagerProtocolGuid =3D { 0xaa17add4, 0x756c, 0x460= d, > + { 0x94, 0xb8, 0x43, 0x88, 0xd7, 0xfb, 0x3e, 0x59 } } > + > # > # [Error.gEfiMdeModulePkgTokenSpaceGuid] > # 0x80000001 | Invalid value provided. > -- > 2.7.4 > > > > ________________________________ This email message is for the sole use of the intended recipient(s) and ma= y contain confidential information. Any unauthorized review, use, disclosu= re or distribution is prohibited. If you are not the intended recipient, p= lease contact the sender by reply email and destroy all copies of the origi= nal message. ________________________________ --_000_CY4PR1201MB0134972C9E43E5CD5A3A7E8FBA3E0CY4PR1201MB0134_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello Hao/Jian,

 

As per Maintainers.txt, I think you guys are the ov= erall maintainers of MdeModulePkg. Bringing this patch to your attention so= that it could be submitted. Ray who is the reviewer of BDS changes has alr= eady reviewed this patch.

 

Thanks

Ashish

 

From: Ni, Ray <ray.ni@intel.com>
Sent: Wednesday, January 1, 2020 7:05 PM
To: devel@edk2.groups.io; Ashish Singhal <ashishsingha@nvidia.co= m>; Wang, Sunny (HPS SW) <sunnywang@hpe.com>; Wang, Jian J <jia= n.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Gao, Zhichao = <zhichao.gao@intel.com>; Kinney, Michael D <michael.d.kinney@intel= .com>; afish@apple.com
Cc: Spottswood, Jason <jason.spottswood@hpe.com>
Subject: RE: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platfor= m Boot Manager Protocol

 

External email: Use caution opening = links or attachments

 

Ashish, no follow up is required from your side.

MdeModulePkg maintainers will help to push the patc= hes.

 

From: devel@edk2.groups.io <deve= l@edk2.groups.io> On Behalf Of Ashish Singhal
Sent: Thursday, December 26, 2019 11:42 AM
To: Ni, Ray <ray.ni@intel.co= m>; Wang, Sunny (HPS SW) <su= nnywang@hpe.com>; devel@edk2.groups.io; Wang, Ji= an J <jian.j.wang@intel.com= >; Wu, Hao A <hao.a.wu@intel.co= m>; Gao, Zhichao <zhicha= o.gao@intel.com>; Kinney, Michael D <micha= el.d.kinney@intel.com>; afish@apple.com
Cc: Spottswood, Jason <jason.spottswood@hpe.com>
Subject: Re: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platfor= m Boot Manager Protocol

 

Hi Ray,

 

Following up on this. Are we waiting on more sugges= tions or clarifications?

 

Thanks

Ashish

 


From: Ni, Ray <ra= y.ni@intel.com>
Sent: Monday, December 23, 2019 10:41:50 PM
To: Wang, Sunny (HPS SW) <s= unnywang@hpe.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Ashish Sin= ghal <ashishsingha@nvidia.com= >; Wang, Jian J <jian.j.= wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Gao, Zhichao <zhichao.ga= o@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>; afish@apple.com <afish@apple.com>
Cc: Spottswood, Jason <jason.spottswood@hpe.com>
Subject: RE: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platfor= m Boot Manager Protocol

 

External email: Use = caution opening links or attachments


Reviewed-by: Ray Ni <ray.ni@intel.c= om>

> -----Original Message-----
> From: Wang, Sunny (HPS SW) <s= unnywang@hpe.com>
> Sent: Tuesday, December 24, 2019 12:44 PM
> To: devel@edk2.groups.io;= ashishsingha@nvidia.com; Ni, Ray
> <ray.ni@intel.com>; Wan= g, Jian J <jian.j.wang@intel.co= m>; Wu, Hao A
> <hao.a.wu@intel.com>;= Gao, Zhichao <zhichao.gao@inte= l.com>; Kinney,
> Michael D <michael.d= .kinney@intel.com>; afish@apple.com
> Cc: Wang, Sunny (HPS SW) <sun= nywang@hpe.com>; Spottswood, Jason
> <jason.spottswood@hpe.= com>
> Subject: RE: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platform<= br> > Boot Manager Protocol
>
> Looks good enough to me. Thanks for addressing my comments, Ashish. > Reviewed-by: Sunny Wang <sunn= ywang@hpe.com>
>
> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io]= On Behalf Of
> Ashish Singhal
> Sent: Tuesday, December 24, 2019 10:58 AM
> To: devel@edk2.groups.io;= ray.ni@intel.com; jian.j.wang= @intel.com;
> hao.a.wu@intel.com; zhichao.gao@intel.com; m= ichael.d.kinney@intel.com;
> afish@apple.com
> Cc: Ashish Singhal <ash= ishsingha@nvidia.com>
> Subject: [edk2-devel] [PATCH v7] MdeModulePkg: Add EDK2 Platform Boot=
> Manager Protocol
>
> Add edk2 platform boot manager protocol which would have platform
> specific refreshes to the auto enumerated as well as NV boot options = for the
> platform.
>
> Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
> ---
>  .../Include/Protocol/PlatformBootManager.h   &nb= sp;     | 82
> ++++++++++++++= ;++++++++
>  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c   | = 41 +++++++++--
>  .../Library/UefiBootManagerLib/InternalBm.h   &n= bsp;    |  2 +
>  .../UefiBootManagerLib/UefiBootManagerLib.inf   =    |  2 +
>  MdeModulePkg/MdeModulePkg.dec     &nbs= p;            &= nbsp;   |  4 ++
>  5 files changed, 124 insertions(+), 7 deletions(-)  cr= eate mode 100644
> MdeModulePkg/Include/Protocol/PlatformBootManager.h
>
> diff --git a/MdeModulePkg/Include/Protocol/PlatformBootManager.h
> b/MdeModulePkg/Include/Protocol/PlatformBootManager.h
> new file mode 100644
> index 0000000..26b9ce4
> --- /dev/null
> +++ b/MdeModulePkg/Include/Protocol/PlatformBootManager.h=
> @@ -0,0 +1,82 @@
> +/** @file
> +
> +  Copyright (c) 2019, NVIDIA CORPORATION. All rights reserv= ed.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef __PLATFORM_BOOT_MANAGER_PROTOCOL_H__
> +#define __PLATFORM_BOOT_MANAGER_PROTOCOL_H__
> +
> +#include <Library/UefiBootManagerLib.h>
> +
> +//
> +// Platform Boot Manager Protocol GUID value // #define
> +EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_GUID \
> +    { \
> +      0xaa17add4, 0x756c, 0x460d, { 0x9= 4, 0xb8, 0x43, 0x88, 0xd7, 0xfb, 0x3e,
> 0x59 } \
> +    }
> +
> +//
> +// Protocol interface structure
> +//
> +typedef struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL
> +EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL;
> +
> +//
> +// Revision The revision to which the protocol interface adheres= .
> +//          All fut= ure revisions must be backwards compatible.
> +//          If a fu= ture version is not back wards compatible it is not the same
> GUID.
> +//
> +#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION
> 0x00000001
> +
> +//
> +// Function Prototypes
> +//
> +
> +/*
> +  This function allows platform to refresh all boot options= specific to
> +the platform. Within
> +  this function, platform can make modifications to the aut= o enumerated
> +platform boot options
> +  as well as NV boot options.
> +
> +  @param[in const] BootOptions     = ;        An array of auto enumerated
> platform boot options.
> +          &nbs= p;            &= nbsp;           &nbs= p;       This array will be freed by caller u= pon successful
> +          &nbs= p;            &= nbsp;           &nbs= p;       exit of this function and output arr= ay would be used.
> +
> +  @param[in const] BootOptionsCount    =     The number of elements in
> BootOptions.
> +
> +  @param[out]      UpdatedBootOpti= ons      An array of boot options that
> have been customized
> +          &nbs= p;            &= nbsp;           &nbs= p;       for the platform on top of input boo= t options. This
> +          &nbs= p;            &= nbsp;           &nbs= p;       array would be allocated by
> REFRESH_ALL_BOOT_OPTIONS
> +          &nbs= p;            &= nbsp;           &nbs= p;       and would be freed by caller after c= onsuming it.
> +
> +  @param[out]      UpdatedBootOpti= onsCount The number of elements in
> UpdatedBootOptions.
> +
> +
> +  @retval EFI_SUCCESS      &n= bsp;            = ;   Platform refresh to input BootOptions and
> +          &nbs= p;            &= nbsp;           &nbs= p;       BootCount have been done.
> +
> +  @retval EFI_OUT_OF_RESOURCES     = ;        Memory allocation failed.
> +
> +  @retval EFI_INVALID_PARAMETER    &nbs= p;       Input is not correct.
> +
> +  @retval EFI_UNSUPPORTED     &nbs= p;            Platfo= rm specific overrides are not
> supported.
> +*/
> +typedef
> +EFI_STATUS
> +(EFIAPI *PLATFORM_BOOT_MANAGER_REFRESH_ALL_BOOT_OPTIONS) (
> +  IN  CONST EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions,=
> +  IN  CONST UINTN      &= nbsp;           &nbs= p;     BootOptionsCount,
> +  OUT       EFI_BOOT_MANAGER_= LOAD_OPTION **UpdatedBootOptions,
> +  OUT       UINTN  =             &nb= sp;         *UpdatedBootOptionsCoun= t
> +  );
> +
> +struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL {
> +  UINT64        &nb= sp;            =             &nb= sp;       Revision;
> +  PLATFORM_BOOT_MANAGER_REFRESH_ALL_BOOT_OPTIONS
> RefreshAllBootOptions;
> +};
> +
> +extern EFI_GUID gEdkiiPlatformBootManagerProtocolGuid;
> +
> +#endif /* __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ */
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index 760d764..62c5b2dc 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > @@ -1,6 +1,7 @@
>  /** @file
>    Library functions which relates with booting.
>
> +Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
>  Copyright (c) 2011 - 2019, Intel Corporation. All rights reserv= ed.<BR>
>  (C) Copyright 2015-2016 Hewlett Packard Enterprise Development = LP<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent @@ -2258,12 +2= 259,15 @@
> EfiBootManagerRefreshAllBootOption (
>    VOID
>    )
>  {
> -  EFI_STATUS        &nb= sp;           Status;
> -  EFI_BOOT_MANAGER_LOAD_OPTION  *NvBootOptions;
> -  UINTN         &n= bsp;            = ;   NvBootOptionCount;
> -  EFI_BOOT_MANAGER_LOAD_OPTION  *BootOptions;
> -  UINTN         &n= bsp;            = ;   BootOptionCount;
> -  UINTN         &n= bsp;            = ;   Index;
> +  EFI_STATUS        = ;            &n= bsp;      Status;
> +  EFI_BOOT_MANAGER_LOAD_OPTION     = ;    *NvBootOptions;
> +  UINTN        &nbs= p;            &= nbsp;          NvBootOptionCou= nt;
> +  EFI_BOOT_MANAGER_LOAD_OPTION     = ;    *BootOptions;
> +  UINTN        &nbs= p;            &= nbsp;          BootOptionCount= ;
> +  EFI_BOOT_MANAGER_LOAD_OPTION     = ;    *UpdatedBootOptions;
> +  UINTN        &nbs= p;            &= nbsp;          UpdatedBootOpti= onCount;
> +  UINTN        &nbs= p;            &= nbsp;          Index;
> +  EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL *PlatformBootManager= ;
>
>    //
>    // Optionally refresh the legacy boot option @@ -22= 73,7 +2277,6 @@
> EfiBootManagerRefreshAllBootOption (
>    }
>
>    BootOptions   =3D BmEnumerateBootOptions = (&BootOptionCount);
> -  NvBootOptions =3D EfiBootManagerGetLoadOptions (&NvBootOp= tionCount,
> LoadOptionTypeBoot);
>
>    //
>    // Mark the boot option as added by BDS by setting = OptionalData to a
> special GUID @@ -2284,6 +2287,30 @@
> EfiBootManagerRefreshAllBootOption (
>    }
>
>    //
> +  // Locate Platform Boot Options Protocol  //  S= tatus =3D
> + gBS->LocateProtocol (&gEdkiiPlatformBootManagerProtocolG= uid,
> +          &nbs= p;            &= nbsp;        NULL,
> +          &nbs= p;            &= nbsp;        (VOID **)&PlatformBootM= anager);  if
> + (!EFI_ERROR (Status)) {
> +    //
> +    // If found, call platform specific refresh t= o all auto enumerated and NV
> +    // boot options.
> +    //
> +    Status =3D PlatformBootManager->RefreshAll= BootOptions ((CONST
> EFI_BOOT_MANAGER_LOAD_OPTION *)BootOptions,
> +          &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;        (CONST UINTN)BootOptionCoun= t,
> +          &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;        &UpdatedBootOptions, > +          &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;        &UpdatedBootOptionCount= );
> +    if (!EFI_ERROR (Status)) {
> +      EfiBootManagerFreeLoadOptions (Bo= otOptions, BootOptionCount);
> +      BootOptions =3D UpdatedBootOption= s;
> +      BootOptionCount =3D UpdatedBootOp= tionCount;
> +    }
> +  }
> +
> +  NvBootOptions =3D EfiBootManagerGetLoadOptions (&NvBo= otOptionCount,
> + LoadOptionTypeBoot);
> +
> +  //
>    // Remove invalid EFI boot options from NV
>    //
>    for (Index =3D 0; Index < NvBootOptionCount; Ind= ex++) { diff --git
> a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
> b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
> index 027eb25..ac866ac 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.h
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/InternalBm.= h
> @@ -1,6 +1,7 @@
>  /** @file
>    BDS library definition, include the file and data s= tructure
>
> +Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
>  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserv= ed.<BR>
>  (C) Copyright 2015 Hewlett Packard Enterprise Development LP<= ;BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent @@ -41,6 +42,7= @@ SPDX-
> License-Identifier: BSD-2-Clause-Patent  #include <Protocol/V= ariableLock.h>
> #include <Protocol/RamDisk.h>  #include <Protocol/Defer= redImageLoad.h>
> +#include <Protocol/PlatformBootManager.h>
>
>  #include <Guid/MemoryTypeInformation.h>  #include &l= t;Guid/FileInfo.h>
> diff --git
> a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> index ed6b467..cf59086 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf<= br> > +++
> b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> @@ -5,6 +5,7 @@
>  #  manipulation, hotkey registration, UEFI boot, connect/d= isconnect, console
> #  manipulation, driver health checking and etc.
>  #
> +#  Copyright (c) 2019, NVIDIA CORPORATION. All rights reser= ved.
>  #  Copyright (c) 2007 - 2018, Intel Corporation. All right= s reserved.<BR>  #  (C)
> Copyright 2016 Hewlett Packard Enterprise Development LP<BR>&nb= sp; #  SPDX-
> License-Identifier: BSD-2-Clause-Patent @@ -107,6 +108,7 @@
>    gEfiFormBrowser2ProtocolGuid    = ;            &n= bsp; ## SOMETIMES_CONSUMES
>    gEfiRamDiskProtocolGuid    &nbs= p;            &= nbsp;     ## SOMETIMES_CONSUMES
>    gEfiDeferredImageLoadProtocolGuid   =           ## SOMETIMES_CONSUME= S
> +  gEdkiiPlatformBootManagerProtocolGuid   &n= bsp;     ## SOMETIMES_CONSUMES
>
>  [Pcd]
>
> gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationC
> hange      ## SOMETIMES_CONSUMES
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec index 41b9e70..cc238e9 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -3,6 +3,7 @@
>  # It also provides the definitions(including PPIs/PROTOCOLs/GUI= Ds and
> library classes)  # and libraries instances, which are used for = those modules.
>  #
> +# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. >  # Copyright (c) 2007 - 2019, Intel Corporation. All rights rese= rved.<BR>  #
> Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>  = # (C) Copyright 2016 -
> 2019 Hewlett Packard Enterprise Development LP<BR> @@ -609,6 &#= 43;610,9
> @@
>    ## Include/Protocol/PeCoffImageEmulator.h
>    gEdkiiPeCoffImageEmulatorProtocolGuid =3D { 0x96f46= 153, 0x97a7, 0x4793,
> { 0xac, 0xc1, 0xfa, 0x19, 0xbf, 0x78, 0xea, 0x97 } }
>
> +  ## Include/Protocol/PlatformBootManager.h
> +  gEdkiiPlatformBootManagerProtocolGuid =3D { 0xaa17add4, 0= x756c, 0x460d,
> + { 0x94, 0xb8, 0x43, 0x88, 0xd7, 0xfb, 0x3e, 0x59 } }
> +
>  #
>  # [Error.gEfiMdeModulePkgTokenSpaceGuid]
>  #   0x80000001 | Invalid value provided.
> --
> 2.7.4
>
>
>
>


This email message is for the sole use of the inten= ded recipient(s) and may contain confidential information.  Any unauth= orized review, use, disclosure or distribution is prohibited.  If you = are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.=


--_000_CY4PR1201MB0134972C9E43E5CD5A3A7E8FBA3E0CY4PR1201MB0134_--