From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.71]) by mx.groups.io with SMTP id smtpd.web12.19486.1653571017395399487 for ; Thu, 26 May 2022 06:16:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=sbRZznUz; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.92.71, mailfrom: ashishsingha@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ksFd0/w8FmEzIIPx393WCrsJ2ESLyRT/BmZbWVvMoPQxg6BVfFkhQw17XIyZ9VcB93djXlADEYa5fQskm9vT17v2m23s6dFQ+3oE4pew2NmZCYkUsc0bAgIWZ7s+1N38lH3GKdl7x1qqbsDH8evI6pMjzu28FEKEn3oD5DRAHT8+7tJ3RBSi37+LKIdcnLSeJJbCs6kPza1t+oKEbOGLCfJwHhhXue09dmsffhVDp7JXu1Y8Rd/Jfh+4GZe7v+OLXqhxv/T6niIrzZUAlkgsKaPyIt8328y3wf9DI7JCc8K0JDx6sRz4czGplq8Ix9N5u3Sam0542Tfh5bF4q4VX/A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=D/OUJXUzbBc6vMtnM26yzT9seRGHDDS/qzMp5cB4DPw=; b=P7VAOxZnc0hGx1GnqhEg7qYxeh70swrPKMabPT+UcnVKX4FaWm/D+DMm0DYn5zwf72+/+98qZg8pvCrPkrelDoIEzN1YCSzay5fNK6OzFT2ZHQ3VjAu46nxVhTxaJltKYJsN0JZxoupBWDiu9KTibfYOR9OoukDye/c/Ua/g/XnV5mFF5EkgN1Uof4H3qNIKtweWi8Ha2+gwWcD1bmXqrfwKWKm8ddKu9r8lKo8xejw9XU2mPfu4+tJxDwuv8UnTNy2FNLT5VRNYaC9b3ON4pqO+0AD7xpggaKtEYBqzC6WhPglQ8qRl5moTHBJ3UMzgb1w0iXOPNvoYny+gAWhPVA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D/OUJXUzbBc6vMtnM26yzT9seRGHDDS/qzMp5cB4DPw=; b=sbRZznUziA3aWfZXOtbpq1GnA4kCGcOyxlphsbMbtnCZWgESWn2cJ3eS/+29LBSaeO9kKhIwjN3KwVeriUFxrP7/QNMuYBSG/k8U4M22E7iXWN7ZC5n3xhvy/Qu3BMlP9GVZI9uqR60Ut7UhY+iGSIVMSqAh8/57Kk+xUmiCPpJdSHW7H96Vji+7JiPL0lSJpYictK/fUSmk+PCtKGdeFnnK8Zdioa1I4E5CAPGopGDgGlwsxUllYRaYQg0EmIIkUlM+V8gJUtK7BrVqx1ZlJF95aqupkrMkwWkjNdK4UnGdIQSIVpVmGBg84RjPQzzWJwD4RrdVXv9N8P5/eXQ3rA== Received: from BY5PR12MB5544.namprd12.prod.outlook.com (2603:10b6:a03:1d9::22) by DM6PR12MB4402.namprd12.prod.outlook.com (2603:10b6:5:2a5::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Thu, 26 May 2022 13:16:55 +0000 Received: from BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::922:fa59:c7e3:128c]) by BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::922:fa59:c7e3:128c%6]) with mapi id 15.20.5293.013; Thu, 26 May 2022 13:16:55 +0000 From: "Ashish Singhal" To: "Ni, Ray" , "devel@edk2.groups.io" , "Wang, Jian J" , "Gao, Liming" , "Gao, Zhichao" Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: Configurable New Boot Options Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: Configurable New Boot Options Thread-Index: AQHYafgPpePrY4hUf0iD9fuE2dd8wa0jPGbtgA305oCAAABDIQ== Date: Thu, 26 May 2022 13:16:55 +0000 Message-ID: References: <3fe4f5fff1141c3576ccf81b5993992c2bee81bb.1652741915.git.ashishsingha@nvidia.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 591c42f1-2794-4af0-ac5f-08da3f1a0182 x-ms-traffictypediagnostic: DM6PR12MB4402:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: CSNzS7+5v6tFPMEqeScQG71Hz5rwoF0torM2VmqAZ3pcVsx4AmApeEbrp6U3jpW8uUN1jZCVRsXJ1HTxJ6usq0EvP1f1sQcdtE2cIKmI7z2626koVR9DXSdxRtjUKHZ8dIZPfp26El6BAKIFk14tTqWRPxH7IPwmD8yLWbcj0FN65fD4CiS2wGgCG3lIwjOapOh8JevQkVphnUFYJJyOI56Qk5kBA05dqRDhtoNhzjiZjYlr6tGfw0E1IA4VmAAEIF5srlP/gjQsim1ZnJp2MP/WTphkTuVGEFOdWDtDM3R15SuV2PvprpO7POr6W3iUPGCcPRXoPn/dOMA5hIBUZCaUvLsSgiHsZ/e8mOCJJhbUOHMfWLsDMmcutW9DUydpySHsuFV9OkDBC8+udgXRghqqzUOlx7L3tnqYHExr040X0UVJipt25rwmYXLVFAFJfQUMJX0BhO/rO+Q+HCVRZ0+DOHLsRhQJEGNHAku81+FcylGwj7hzxsTrwRqRn8nIFbp23tA0h3J9B9BJFS1TqN6VonZVG1BmXtwdSKSitdPiV6lqj3Iapane704475XxTkh0nhU+VWixQhlLfs9rK6cXPz+qOG3aDvEwjFEm9OQEc3ornAGLDWKBzlLpae35l2C6gnEgYaJiOfGVZ5r3N6O10ID8Dgk6eO4gi1tsZvzKa7XYf3EDsZ2YLt11DUYj4umizx2+1p36+qTZDggdn+hq5R6rbOb/vcqRMk3+8ZRIfegtv9XjfU07NcNJyiCyQkgOGtvsw9azzhnBJjh1sBdezeAgnDwrMfclaQGc5ZY= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB5544.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(508600001)(83380400001)(966005)(316002)(53546011)(9686003)(86362001)(26005)(71200400001)(186003)(19627405001)(33656002)(52536014)(76116006)(8676002)(64756008)(66476007)(66946007)(66556008)(66446008)(91956017)(122000001)(110136005)(8936002)(2906002)(38070700005)(38100700002)(7696005)(6506007)(19627235002)(5660300002)(55016003)(166002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?D2YWxs5Ts5VMBnqTS3u/WCZQznJds+MfWrfquixsYW4hA1k5N4fvu9t2?= =?Windows-1252?Q?AZiQ0dmGVnRWZqPklSwnRJvNdcb6cCmY0j9XihAXfqoVxNLwNRoOXQ9w?= =?Windows-1252?Q?tki/xVerRo4+73AKmdzQ7lpqi2bhhZghMDd27rU7fgDkNrxrVRH8cfIk?= =?Windows-1252?Q?tryXkJ+b4sGrcVTaITqUvjicAQstYV1EmtmhYImfKUCWjvBZUS0roBEF?= =?Windows-1252?Q?rFKZhTE/WnpHgqy7syy6OkYb67sGKrQUqBlQtvg1hrqFf1D4nIgJu95j?= =?Windows-1252?Q?BHl5eJT1tznf36HUnLFiTYzskpvLUKIRJvcKdAX+4um1dl6bIQn2Ry4K?= =?Windows-1252?Q?ADd0yh1Dj+jKYTtPGuVJrqW0eK8L8RrULihnj97fj0ngm3J4rTOjYhgA?= =?Windows-1252?Q?ISCU1GqbYAaLnJIrvn8DRvRjp18gTrkO5M1kmnLJOpueNNMLZDc/HmXO?= =?Windows-1252?Q?nJWnX2HBv0AI5XicTUxoJKrL53ngkX/GETiWuoQX1jqUBZxj4U3Q2jQe?= =?Windows-1252?Q?w/yaE+xVEs5y0UJ2bu3hkD/O6r1nx1thvWnGeglyeTjMJZDjMkMcpgXO?= =?Windows-1252?Q?FtrNviKAbtk3PyVsc3U8dFQ4tXe/4iEsbKTDsEVyPI3Y/jJ99/lpi4oW?= =?Windows-1252?Q?9cYBRTkh92R6HGsMJa0337UpylwD9F316ZkFf+DIUYTV/4hbMdLHKBtX?= =?Windows-1252?Q?vd6TCC1GXPvqRb20cltkSLDBPm/pMXbxkoxZ7EEOwYKD8P8mBvV7Q8fb?= =?Windows-1252?Q?hfGoES82QQKoqcGJgxlf/PBGX9p8X/vv0WzGI1Oz7cQ01hlNI/Xidz4x?= =?Windows-1252?Q?UgJOjOmp9mKjCID/yXOeK8/Reg95dHKEZ6fmCXo6dt+Tr7sRXTSxPLfZ?= =?Windows-1252?Q?dWooePZmSg3E9nuwdiG9AFXMwf8VII0dSqYLalQ55932ep2/96aOlgmI?= =?Windows-1252?Q?HlwAjcdR8FyHKqPrL3tfXBnOU7x3JfZ670GK3Fv+VpQ1quF88BdGFAdX?= =?Windows-1252?Q?MiylN35IJ26Vt7yKNCZCISvvdZfhHHNaYW4U4uMOcJg/WJeQaxG0QUTv?= =?Windows-1252?Q?UTdFnMLP+NTB91pCVaB/xnSQawY4QVSjpuP0TqtODuneRlT+2Fpzh0WU?= =?Windows-1252?Q?PqkFmNzEXjL86lQw664CgA84PY9nZfqgkIBTrRUsFgtFSVvmOYjBG7xj?= =?Windows-1252?Q?LeGRf+KMZAKwsC13n0sF20ix468iuGJDCArB+9fQZXCZBZHdqfz8gr1V?= =?Windows-1252?Q?GZ09YwOae7mx9ScnY1kA3+H7Ub6yBkCWraq+m3UOZxXbWIqLzlJzKgZL?= =?Windows-1252?Q?aoi4aCHuUaXvh7TRaNn1BEp1OfsrlpK8xnfvpTQcBQQEUfxWypshCpiU?= =?Windows-1252?Q?ozJcAsE1qiDLmWUBMoStlvq4jKDtg5yT7hhxBVu214CfKlzWLhdrHSFE?= =?Windows-1252?Q?18QqyzO/SgX8Yz3nkgILq2BacoaDA4sqkqaFOwt3PsE2TlGSwdMFvWnl?= =?Windows-1252?Q?bBBabzoxr/Md5+c33FpxAvuodwM5D++9xop3xUC9TBlgu0etXMpRBmmY?= =?Windows-1252?Q?oX6YGXF2qR0o1J0vs/Z7eSvdsMRl8qpzCsKs7jBHEX2JNZ87QIWsmq3t?= =?Windows-1252?Q?YpiukmsISWt0Yz6y4V9ZjCqJ7+EsdENxPPAxcaGQNEnaWRJy+gcvP0XH?= =?Windows-1252?Q?ZHGGK3mzpCFei2rbfMDrZQydKwh2p0FekAWeSQvjyTc9bXoPYBqYezo6?= =?Windows-1252?Q?0DBwsjID7kCQtI0Co6NOqfRmtbuDKJrTLLsBCfGQ+y3LwduK93jWl+Pv?= =?Windows-1252?Q?Cu7vZW+RdBoGBBUa+Ms0VwwN9cxPeP93iCLkOyIrHezkmI42MKhd+LTM?= =?Windows-1252?Q?cQ3JIWqQ7y8L6dWEpCAvNDhFtIbieMPDGxQ=3D?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB5544.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 591c42f1-2794-4af0-ac5f-08da3f1a0182 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2022 13:16:55.3074 (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: +Q+LjoaOHUEilv8ZMe28nt57dNLuDwwPfiiYxsrh0xitMHSw6vWxSTEy1jF2BeXAd7opb3rCKzzEL/FuG2oiAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4402 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR12MB5544108F7A75BC828CDE106FBAD99BY5PR12MB5544namp_" --_000_BY5PR12MB5544108F7A75BC828CDE106FBAD99BY5PR12MB5544namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I understand that. What do you suggest then? Using EfiBootManagerSortLoadOp= tionVariable() is an option only if we update all code paths where we refre= sh the boot options. ________________________________ From: Ni, Ray Sent: Thursday, May 26, 2022 7:15 AM To: Ashish Singhal ; devel@edk2.groups.io ; Wang, Jian J ; Gao, Liming ; Gao, Zhichao Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: Configur= able New Boot Options External email: Use caution opening links or attachments 1. I don=92t like PCD. It=92s like a out-of-band control of library API. 2. The PCD doesn=92t take care of all scenarios. Someone may like to put= new options just before the last one. From: Ashish Singhal Sent: Wednesday, May 18, 2022 12:09 AM To: Ni, Ray ; devel@edk2.groups.io; Wang, Jian J ; Gao, Liming ; Gao, Zhichao Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: Configur= able New Boot Options Ray, Won't that mean changing UEFI UI and boot maintenance manager applications = as well to make this call? If we do not do that, the applications would not= reflect the sorted boot order automatically. Considering this, the change I have is pretty small and takes care of all s= cenarios. Please let me know what you think. Thanks Ashish ________________________________ From: Ni, Ray > Sent: Tuesday, May 17, 2022 8:11 AM To: devel@edk2.groups.io >; Ashish Singhal >; Wang, Jian J >; Gao, Liming >; Gao, Zhichao > Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: Configur= able New Boot Options External email: Use caution opening links or attachments Please use the EfiBootManagerSortLoadOptionVariable() to sort the boot opti= ons from PlatformBootManagerLib. > -----Original Message----- > From: devel@edk2.groups.io > On Behalf Of Ashish Singhal via groups.i= o > Sent: Tuesday, May 17, 2022 7:02 AM > To: devel@edk2.groups.io; Wang, Jian J >; Gao, Liming >; Gao, Zhichao > >; Ni, Ray > > Cc: Ashish Singhal > > Subject: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: Configurab= le New Boot Options > > Add a new PCD to be able to configure whether newly detected boot options > are to be added at the beginning of the current boot options list or at > the end. > > Signed-off-by: Ashish Singhal > > --- > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 6 +++++- > .../Library/UefiBootManagerLib/UefiBootManagerLib.inf | 1 + > MdeModulePkg/MdeModulePkg.dec | 5 +++++ > MdeModulePkg/MdeModulePkg.uni | 4 ++++ > 4 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModule= Pkg/Library/UefiBootManagerLib/BmBoot.c > index 962892d38f..8a46100c2a 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > @@ -2435,7 +2435,11 @@ EfiBootManagerRefreshAllBootOption ( > // > for (Index =3D 0; Index < BootOptionCount; Index++) { > if (EfiBootManagerFindLoadOption (&BootOptions[Index], NvBootOptions= , NvBootOptionCount) =3D=3D -1) { > - EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], (UINTN)-= 1); > + if (PcdGetBool (PcdNewBootOptionAtStart)) { > + EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], 0); > + } else { > + EfiBootManagerAddLoadOptionVariable (&BootOptions[Index], (UINTN= )-1); > + } > // > // Try best to add the boot options so continue upon failure. > // > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.i= nf > b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > index fe05d5f1cc..46f41a7c63 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > +++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > @@ -119,3 +119,4 @@ > gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile = ## CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm = ## SOMETIMES_CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount = ## CONSUMES > + gEfiMdeModulePkgTokenSpaceGuid.PcdNewBootOptionAtStart = ## CONSUMES > diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.de= c > index cf79292ec8..9d696f117b 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -2146,6 +2146,11 @@ > # @Prompt GHCB Pool Size > gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize|0|UINT64|0x00030008 > > + ## This dynamic PCD holds the flag to tell UEFI boot manager whether t= o add newly detected devices at > + # the end, or at the start of the boot option. > + # @Prompt Add new devices in boot options at start > + gEfiMdeModulePkgTokenSpaceGuid.PcdNewBootOptionAtStart|FALSE|BOOLEAN|0= x00030009 > + > [PcdsDynamicEx] > ## This dynamic PCD enables the default variable setting. > # Its value is the default store ID value. The default value is zero = as Standard default. > diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.un= i > index b070f15ff2..8e68db1c25 100644 > --- a/MdeModulePkg/MdeModulePkg.uni > +++ b/MdeModulePkg/MdeModulePkg.uni > @@ -1325,6 +1325,10 @@ > > #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbBase_HELP #language en= -US "Used with SEV-ES support to identify > an address range that is not to be encrypted." > > +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNewBootOptionAtStart_PROMP= T #language en-US "Add new devices in > boot options at start" > + > +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNewBootOptionAtStart_HELP = #language en-US "Used by UEFI boot > manager to decide whether to place newly detcted devices at start of the = list or end." > + > #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbSize_PROMPT #language = en-US "Guest-Hypervisor Communication > Block (GHCB) Pool Base Size" > > #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbSize_HELP #language en= -US "Used with SEV-ES support to identify the > size of the address range that is not to be encrypted." > -- > 2.17.1 > > > >=20 > --_000_BY5PR12MB5544108F7A75BC828CDE106FBAD99BY5PR12MB5544namp_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable
I understand that. What do you suggest then? Using Efi= BootManagerSortLoadOptionVariable() is an option only if we update all code= paths where we refresh the boot options.

From: Ni, Ray <ray.ni@in= tel.com>
Sent: Thursday, May 26, 2022 7:15 AM
To: Ashish Singhal <ashishsingha@nvidia.com>; devel@edk2.group= s.io <devel@edk2.groups.io>; Wang, Jian J <jian.j.wang@intel.com&g= t;; Gao, Liming <gaoliming@byosoft.com.cn>; Gao, Zhichao <zhichao.= gao@intel.com>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: C= onfigurable New Boot Options
 
External email: Us= e caution opening links or attachments

  1. I don=92t like P= CD. It=92s like a out-of-band control of library API.
  2. The PCD doesn=92t take care of al= l scenarios. Someone may like to put new options just before the last one.<= /li>

 

From: Ashish Singhal <ashishsingha@nvidi= a.com>
Sent: Wednesday, May 18, 2022 12:09 AM
To: Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io; Wang, Ji= an J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.c= n>; Gao, Zhichao <zhichao.gao@intel.com>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: C= onfigurable New Boot Options

 

Ray,=

&nbs= p;

Won'= t that mean changing UEFI UI and boot maintenance manager applications as w= ell to make this call? If we do not do that, the applications would not ref= lect the sorted boot order automatically.

&nbs= p;

Cons= idering this, the change I have is pretty small and takes care of all scena= rios. Please let me know what you think.

&nbs= p;

Than= ks

Ashi= sh


From: Ni, Ray <r= ay.ni@intel.com>
Sent: Tuesday, May 17, 2022 8:11 AM
To: devel@edk2.groups.io= <devel@edk2.groups.io>; = Ashish Singhal <ashishsingha@= nvidia.com>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byos= oft.com.cn>; Gao, Zhichao <zhichao.gao@intel.com>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: C= onfigurable New Boot Options

 

External email: Use= caution opening links or attachments


Please use the EfiBootManagerSortLoadOptionVariable() to sort the boot opti= ons from PlatformBootManagerLib.


> -----Original Message-----
> From: devel@edk2.groups.io= <devel@edk2.groups.io> O= n Behalf Of Ashish Singhal via groups.io
> Sent: Tuesday, May 17, 2022 7:02 AM
> To: devel@edk2.groups.io; = Wang, Jian J <jian.j.wang@intel= .com>; Gao, Liming <g= aoliming@byosoft.com.cn>; Gao, Zhichao
> <zhichao.gao@intel.com= >; Ni, Ray <ray.ni@intel.com&= gt;
> Cc: Ashish Singhal <ashi= shsingha@nvidia.com>
> Subject: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: Configu= rable New Boot Options
>
> Add a new PCD to be able to configure whether newly detected boot opti= ons
> are to be added at the beginning of the current boot options list or a= t
> the end.
>
> Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
> ---
>  MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c  &nbs= p;         | 6 +++++-
>  .../Library/UefiBootManagerLib/UefiBootManagerLib.inf  = ;     | 1 +
>  MdeModulePkg/MdeModulePkg.dec      = ;            &n= bsp;            | 5 = +++++
>  MdeModulePkg/MdeModulePkg.uni      = ;            &n= bsp;            | 4 = ++++
>  4 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeMod= ulePkg/Library/UefiBootManagerLib/BmBoot.c
> index 962892d38f..8a46100c2a 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -2435,7 +2435,11 @@ EfiBootManagerRefreshAllBootOption (
>    //
>    for (Index =3D 0; Index < BootOptionCount; Index+= +) {
>      if (EfiBootManagerFindLoadOption (&B= ootOptions[Index], NvBootOptions, NvBootOptionCount) =3D=3D -1) {
> -      EfiBootManagerAddLoadOptionVariable (&= amp;BootOptions[Index], (UINTN)-1);
> +      if (PcdGetBool (PcdNewBootOptionAtStar= t)) {
> +        EfiBootManagerAddLoadOptio= nVariable (&BootOptions[Index], 0);
> +      } else {
> +        EfiBootManagerAddLoadOptio= nVariable (&BootOptions[Index], (UINTN)-1);
> +      }
>        //
>        // Try best to add the boot = options so continue upon failure.
>        //
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLi= b.inf
> b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
> index fe05d5f1cc..46f41a7c63 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > +++ b/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > @@ -119,3 +119,4 @@
>    gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFil= e            &n= bsp;        ## CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfig= ureForm           &n= bsp;   ## SOMETIMES_CONSUMES
>    gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount&nbs= p;            &= nbsp;            ## = CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdNewBootOptionAtStart &n= bsp;            = ;      ## CONSUMES
> diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg= .dec
> index cf79292ec8..9d696f117b 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -2146,6 +2146,11 @@
>    # @Prompt GHCB Pool Size
>    gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize|0|UINT64|= 0x00030008
>
> +  ## This dynamic PCD holds the flag to tell UEFI boot manager w= hether to add newly detected devices at
> +  #  the end, or at the start of the boot option.
> +  # @Prompt Add new devices in boot options at start
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdNewBootOptionAtStart|FALSE|B= OOLEAN|0x00030009
> +
>  [PcdsDynamicEx]
>    ## This dynamic PCD enables the default variable set= ting.
>    #  Its value is the default store ID value. The= default value is zero as Standard default.
> diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg= .uni
> index b070f15ff2..8e68db1c25 100644
> --- a/MdeModulePkg/MdeModulePkg.uni
> +++ b/MdeModulePkg/MdeModulePkg.uni
> @@ -1325,6 +1325,10 @@
>
>  #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbBase_HELP #lan= guage en-US "Used with SEV-ES support to identify
> an address range that is not to be encrypted."
>
> +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNewBootOptionAtStart_PR= OMPT #language en-US "Add new devices in
> boot options at start"
> +
> +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNewBootOptionAtStart_HE= LP #language en-US "Used by UEFI boot
> manager to decide whether to place newly detcted devices at start of t= he list or end."
> +
>  #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbSize_PROMPT #l= anguage en-US "Guest-Hypervisor Communication
> Block (GHCB) Pool Base Size"
>
>  #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbSize_HELP #lan= guage en-US "Used with SEV-ES support to identify the
> size of the address range that is not to be encrypted."
> --
> 2.17.1
>
>
>
>
>

--_000_BY5PR12MB5544108F7A75BC828CDE106FBAD99BY5PR12MB5544namp_--