From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.79]) by mx.groups.io with SMTP id smtpd.web11.9369.1652975453042820055 for ; Thu, 19 May 2022 08:50:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=lfjUt2EQ; 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.220.79, mailfrom: ashishsingha@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bkXr2ghAFgYjsDLB/72q2oRXspuKWqBXAQv2+cgFu5MIuUT03XDX5dnd0akH+ACZYeyC9VFdz3KrCDDt0v0akP8Oue5oxxxWCvnYr4wpOfGHm5D4dZ+fec4JzpCgj4Ih5BVrr6ldR2yZMM1tXjSC7skfkwJ05hX8D+MGw50bi2xmfOk5ZRVvZmUs99smUtqUNUTuMoDhEELrTRmiCN+rEiqk11MMEsxbn+rJIu6tlPjaU23OewfRGiJKLieA42w65AQ+ntyb1PmxqBUo61xQ44pjFaHwqQO02Cjw57ekkG5A6pYbapDJKriNfKC9gEigik2LrZcSIUNoZW5ef6sdoA== 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=hoFk6AkIkiNwMIx9OpCKpHaE8t5RxEecRK0Qj//lyaw=; b=lqu/kK3UZ6UEtk8AP/UvZUlJvWgXd18s8i0r9iXRQtmzwXbzJCKU9NBcMghuhfwOka7hz3nhA2NixKj29da1qMQLiztH3GCq0ezCAMqaLJoz7CDHwbnQJjzTaBp3RExYTcFfVVTnEmrOHQDyf+VwDeCXqQ1qKvwruEub6TTx5xkLXELJGmoJc4WScXkGTX65LZPeLydFEst8R+P4IJyZ2kwOM0stsQkMEaJJaIr7bLIaoC3a4UkHMjRzhVMxav205hILo0pKkHM3oHOtoL4XeB9jznH0FNxCrhrZSMsCD36rKCLaU2zJ9AW6zXMF1Hef8Yy6XIqZ6O5FhUJ9m6sNjA== 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=hoFk6AkIkiNwMIx9OpCKpHaE8t5RxEecRK0Qj//lyaw=; b=lfjUt2EQru1MOJOPIspTjIM3luHVHPwj2C6cyaQESR4Hn9gKn3bTiCbnXDPFop44hUSTOfpuY0Xs3zej2uu9Yq5Wxq7xx6rr9CCubJvMeCrd9rUYVSk1f8OU99fldmtX4Pwie0pYzZZfHs4hOf9NZDA7EXha/6dOtYuT5hp6+UbZSwz7PnXXWHklmMOIgqXA7MqLAnYUXhpNuqGDBhAg9waYZC9prU/V5NdE2gTCQxAXg5SudJAEGyYBneVlFnnlaaVXxaDe9EeRCEl8CdKw2IQ6ozAykg80FRXgI9+349nVY+xyoQRtzWU97OkL7V/bc/GKB6EL+GDzyvUHQJMa8w== Received: from BY5PR12MB5544.namprd12.prod.outlook.com (2603:10b6:a03:1d9::22) by MN2PR12MB4357.namprd12.prod.outlook.com (2603:10b6:208:262::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.15; Thu, 19 May 2022 15:50:49 +0000 Received: from BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::a1ca:addf:80ba:e6c3]) by BY5PR12MB5544.namprd12.prod.outlook.com ([fe80::a1ca:addf:80ba:e6c3%7]) with mapi id 15.20.5273.016; Thu, 19 May 2022 15:50:49 +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: AQHYafgPpePrY4hUf0iD9fuE2dd8wa0jPGbtgAMgAG8= Date: Thu, 19 May 2022 15:50:49 +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: 805d3657-57cf-47b9-f6ab-08da39af58c0 x-ms-traffictypediagnostic: MN2PR12MB4357: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: qaSTN1XUdgV0pVrrVhwYGrH0D+lv39W76tij8y6FjMErAdzZP3+TJJ7gDIdYf2sUTt1SJ5Jhi2D5Eq4Ye+V+OqwH6vyaUec5/NVUN3Sy8YRdThL2ri3yMRrqcv/z5zhLZ2mY2zxS4AhnLDatbmHsxAKnjHWlT0u4vaXQ32Z9gGhIvXsvP12cEr6d8xN/n0lSLWKReGAUQaYH8TL04FwEZzfj2APKJ2E2d41PHekcwwjr/FddSaEZay7zwa46tVG1QSzu1O7q776LJAXSsnTr0KTEDC4xLXXU2dyDeL0T6eHrx0hRmN/TUU5K1H565ToxQ/pJCL8vinU4Ou5INqc84jRKGT2utw2APmfknPzibSg+cuJ8E/MYApaG4OVJ+X3USc3YG4qg69tohrOrceClWYtYIaU/OVfTtZI9WqJCtzPycRG6MNkTL//QhrpcJExcyuBcf1iFqpIjwQV9K5FvZbCbHl2ZJgNZITI2sgeMEMFK4e0xkimFE1Jp2hkH0uLoLqslCQTjNKjiZbenzX1F+km93cEZR5CweRrY8+i5nSa45yBM6bj872eCV9yvek5ifQp7UjJ9YeTMNhTRADM6MD0o9EDyfNVpE8FwBSJTkhi//YEkN6TizyXhwmMjKMrbgtYUyevJevwqgieAZYTKmxAvveDa8h5k7AGrmYK63qjFK0Dn86IpRrzA9i4Jja0cr/qz9bVH+qAbe3ySBU0ADRj6DOfGQO97LYw5ZLkVSkVh9Z4oywT3UMDMklve/H0CE8B+H9IPtbogJnBexNXw1XgEZAiydPQTVE+ASseAmDo= 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)(8676002)(66556008)(9686003)(8936002)(64756008)(166002)(66446008)(66476007)(122000001)(52536014)(5660300002)(86362001)(38100700002)(38070700005)(2906002)(110136005)(66946007)(186003)(7696005)(316002)(508600001)(26005)(6506007)(71200400001)(966005)(53546011)(19627405001)(33656002)(91956017)(76116006)(83380400001)(55016003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5bdnO8+FvknMpwex9RKF9zbFsFVAGTvruPORNIn4OBA+ykdABYPTulU7oUgG?= =?us-ascii?Q?Qf8CHN/dxWqkZf6kXc+UH2bLzyq7X5IRYeToLkoDMDVp0kp4NzIGXRQB11VV?= =?us-ascii?Q?exBkVb+CtB3H+Dzvhj7qX1eupVrTqlk/SHzxkJghfJfiow7YTuAXwOfqYoMR?= =?us-ascii?Q?qUOaoqy5gzu44UYrjKpO8MKwg5khNH96EgYLLabGJqBkvuwBysnVCxn+b/7C?= =?us-ascii?Q?HS3F63i3bdqatC8KbW7IEYr+F4zvsc1DpngjGG5alUsxiqiqtwpGhDUBaAXa?= =?us-ascii?Q?3PtDL6j1e1N72goa4tea6ljIVcgjwVM3Kb3vALPToQegy7ND7MXT49cyjpIN?= =?us-ascii?Q?Nhh7vwtTIq8b9/BUZsYqPaimvbVr9oICaG1EM5sFe16NaTN8Bq0ajxSqlOrf?= =?us-ascii?Q?IwVkqMLIL2E6GOMxtmYxypmJrUDNOaLZZaG1NySZfVs+MEvRmmjcbQ0MpHo0?= =?us-ascii?Q?JzbjOpqnS1+4Cwipcs0ZkwjN6BnXgqYULjm4EV6R1owcxoXgavm2KGnQNLa0?= =?us-ascii?Q?YHKF8RIDg+8yAE/DVz8KT3TFfr6wILock2+dOhwXaHPkODOkEOhQZB0qaUQB?= =?us-ascii?Q?Zw2To7OGM7RE43mSulbjKjiUlwED9hGU8eibrc0W5qgvmj+ZmzFwaJ+roCkR?= =?us-ascii?Q?KkEwCJEiVC7XkfDbPecRmKV9OFv8g02jz010MhcpK43laLcv4g3DVHIuF4sS?= =?us-ascii?Q?LsUexTtnvXl/xCCv1uUvEX+WTTjEohToePLYWLEIhuAV2FWtqp7y7diCyrIW?= =?us-ascii?Q?jsp1KEXwj3sq5vCap1MVBDB8xGAv+LrAWncFyYumedxeH+KgOY131YERJxi2?= =?us-ascii?Q?ktYVpRuPrVflqo1MW3l95UVg+Y7ViIkkBdC4JQHj+BMYnH8r9VcSy9kEQ53v?= =?us-ascii?Q?1P1PKBfzZfJq8ufRGHP1iD62FSSbI6qL7Ju7qoJy7tGqu2rf2m8JVQf2Gxrx?= =?us-ascii?Q?Ltz61R4LffJ5V899Ar5o8okPRDkXGewjoKLAHrXqDet9eh0aGlXVa6Vri51l?= =?us-ascii?Q?KJYzXtXDePFRpOe4ii+NdZtuEPeL5FemuGnioqSJe5/bO5ybwmSe6bkKgC0G?= =?us-ascii?Q?gAjBToeRJ9irwIZ48gwEZP59eNKLAIMseTz0L8s1CVGGd4uYrz4UVPdEPeyi?= =?us-ascii?Q?KWD+Zaz34C1ura4B0BCTywVEsEHp6bejNJ69DWDrBfBRp0oZkZIu1Ulr2ZWc?= =?us-ascii?Q?Dm7l4L7nJCi5+9ESf+Jhy+YHIe+/fJVTEplFy/MPLP6fa9kFp3H+vHSTZUF2?= =?us-ascii?Q?Dy81x1IuYzUXwIJ/GY+i6eBrfKiBLfRVeFtONOObs1nCwKYM27PcbA3p2Uv4?= =?us-ascii?Q?XeXWxu0jGKioa12cUWR7fePE5JG7YUI21M5KG47rybXIcPFfe8I0fvIxbIBh?= =?us-ascii?Q?20GOvyTfSDhDm5cePqMDCY0MwZgPRks2OgkxkAcS/JdoOWL/kUltEIhyry6V?= =?us-ascii?Q?LyB9PMCrjctfMWxm8roWUt5wHwBdW3aafHD7kLA6o5cUUbNPUYQt85152Zed?= =?us-ascii?Q?7LoarUNWtzr0oKTOQ9ZA08DBnwpgwNzCmTMjmZaS5jKRIyIRtDuo911n/Cp7?= =?us-ascii?Q?LvTPy46Lr5tNhdXfisHdoXd2T3msKt01ESoSZ84DYtg9K/uuOZFlCRHozkm5?= =?us-ascii?Q?j5vG+AP99k6QcX3ZU01aqKGe8cUzreoA7+yf3tRE6HKeE0bbFV43FZOsT+/n?= =?us-ascii?Q?yeg+WHKt7rNQmjr0ahHxDupufGCLhi/4cD5bntea83wF0rCMqLXZS68fHOxR?= =?us-ascii?Q?APnbBq+byg=3D=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: 805d3657-57cf-47b9-f6ab-08da39af58c0 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 May 2022 15:50:49.7134 (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: /BqJ/5qBqQcmkvhg9QUoOPWkqA4lU0oVEyBrlQ8ZSW/WkB8QEAsPWOEQUp0E3x+WGQqe1sBmNIOUCBA/R55ovQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4357 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BY5PR12MB5544634F97C94FC71661C631BAD09BY5PR12MB5544namp_" --_000_BY5PR12MB5544634F97C94FC71661C631BAD09BY5PR12MB5544namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ray, Any update on this? Thanks Ashish ________________________________ From: Ashish Singhal Sent: Tuesday, May 17, 2022 10:08 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 Sin= ghal via groups.io > Sent: Tuesday, May 17, 2022 7:02 AM > To: devel@edk2.groups.io; Wang, Jian J ; Gao, Limi= ng ; 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_BY5PR12MB5544634F97C94FC71661C631BAD09BY5PR12MB5544namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Ray,

Any update on this?

Thanks
Ashish

From: Ashish Singhal <as= hishsingha@nvidia.com>
Sent: Tuesday, May 17, 2022 10:08 AM
To: Ni, Ray <ray.ni@intel.com>; devel@edk2.groups.io <devel= @edk2.groups.io>; Wang, Jian J <jian.j.wang@intel.com>; Gao, Limin= g <gaoliming@byosoft.com.cn>; Gao, Zhichao <zhichao.gao@intel.com&= gt;
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: C= onfigurable 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 <ray.ni@= intel.com>
Sent: Tuesday, May 17, 2022 8:11 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>; Ashish Singha= l <ashishsingha@nvidia.com>; 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: Use caution opening links or att= achments


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


> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of A= shish 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 <gaoliming@byosoft.com.cn>; Gao, Zhichao
> <zhichao.gao@intel.com>; Ni, Ray <ray.ni@intel.com>
> Cc: Ashish Singhal <ashishsingha@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_BY5PR12MB5544634F97C94FC71661C631BAD09BY5PR12MB5544namp_--