From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.19679.1653571768726006787 for ; Thu, 26 May 2022 06:29:29 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=CAfnhXvs; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653571768; x=1685107768; h=from:to:subject:date:message-id:references:in-reply-to: mime-version; bh=FYBBGq3IJv+2JTHaJG/EkmbVKsQqARLRKbqJJP+Oi9U=; b=CAfnhXvscMmYS9PM/u5Y+e1hYcYGx9G0OuZWh3UZT2Y+t6CPtjDP9k7K WTB0AyJhn18aw0Lvkg+LZSwoYTBSRGf8RnFQ61IaNm/VeBXuZTpS61Jwz Gh+mUkBDe2Vd76PIOIa08JC7zWoX+UvDdEYQQrHkmzS8yfNdLiwucbgl/ NJZNgXdw8BvdV2/fir12sJBlQTNHJist6sGytqHKFU1gFNciRg+/GUhTz 5H073V8ELtMHdGUk03zyw5NDcmpl43NjJaAsc8CeDZ6RBxzQo5VNKUESO X39sDSNn9VJe97EUBaWlhdnPSJHnyoLFDuffUtwHBnoDaOXt6QVAfEaoy A==; X-IronPort-AV: E=McAfee;i="6400,9594,10358"; a="337202689" X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208,217";a="337202689" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2022 06:29:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208,217";a="527409982" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga003.jf.intel.com with ESMTP; 26 May 2022 06:29:26 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 26 May 2022 06:29:26 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 26 May 2022 06:29:25 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 26 May 2022 06:29:25 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.171) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 26 May 2022 06:29:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ksbwazGL2ffcLeetmswY3vs8X8vp6bk3KJFC5O/O6ryEAJ+q9S9TvAjMJdg1i52ToyC5RwHeLzSyJeDb2Exmq5ZzWkvzyppqYZeS0pHfvkKD+OumM0PJ3yh/uEGD9gm5nCBfZRbLxy1VC6LRqcOZ96wphqclCMjMBBgBHSaPMzyu6dKzc8Hlcqz+xTCxOkQ/Wy468H1JuyB+4i6brRa88TfXWeaDrUDLmEdRKAXWOLhd4MRF7UDPgqU6WvOnk75PYPXKcDu3BWLjutfZJ+Xk5pnL547kH3ZJabpgM/GNnAbEzdsYi5ODVyvuJ+XPYbcnfrIbnQOVibN38i3fGZ8UGQ== 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=HiTVuEdCiJJGihVjKDN0fHYhISUgfdesYckG0LHXXR4=; b=M/ye2zvraFdwY4PFy3eSQyoJZglqVexQKYEg1WomhZLfjW35fTltbVGX2vocyBzpt07rAty+KIDOQqLlLqLCJlRljUEzSU8tetNWKhKdUVFR/YKeLFjjUg902DUlVMUO7AACeWyRVy+UFJ5+7gZEgUPuj/Z4gc73sOkOzoNdMMTqQnRZJZEQtL6vrbpN6IA/hnpoxPvngEkDZ8H06yb8u2DbuUPJKFRBa45soNzbD9S7pmqVHn623D7Zvp3ir74mLUW27QBoSfJVF7ckQkNLpP27USmPecAwDpmn3t19GXwW/8ZZzjSouXIkj3S061YkZXS6uc7nyWr+BBkELYDQUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MWHPR11MB1631.namprd11.prod.outlook.com (2603:10b6:301:10::10) by BN7PR11MB2769.namprd11.prod.outlook.com (2603:10b6:406:b3::33) 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:29:18 +0000 Received: from MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::901a:95d1:76f8:d69d]) by MWHPR11MB1631.namprd11.prod.outlook.com ([fe80::901a:95d1:76f8:d69d%11]) with mapi id 15.20.5273.023; Thu, 26 May 2022 13:29:18 +0000 From: "Ni, Ray" To: Ashish Singhal , "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: AQHYaXkDxvzjqgDaOUGA+N4I7Cw7660jHPRwgAAg1YCADfJfsIAAAqOAgAADDNA= Date: Thu, 26 May 2022 13:29:17 +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=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1c985027-7ebb-4b58-97ed-08da3f1bbbfd x-ms-traffictypediagnostic: BN7PR11MB2769:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr 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: qRj63ofcMyXIeWC2NydGCTi7yyHuRHwtMvilRzpSmSeiHkyg2aKpelv9Nx5oA0PCXZifCBW7np/Wwrjf6vro23zoCC3a5HN6WJJdTT2D8Y71Os6VusO0JxuVem6t5zMHgYnn1AelqcwlXp4EIOtVZH/vHLXJVIAlRJL6JQtmmWjVLSXXWu1qt8GuzP95AsHnVQOD5jLVDC+X3iLhKM6T7sYSHM6IIIYZbdMo1CwOVpC9WbTjk57WBUENRD+eHQI4dvVzgqhPVnAuwqEqsSXladevMuUUJ8Abd6B329BJSRa8auPqnuTsnQkWcqAbQ1EDs0eKMHq4FHMlJj9HFHnmowch3JsuzX2B2AMkjZOYOm91rw1EbGQt4DDV1YjECQmPNDgytfSMhto0cY5FceAhCatK9nohDs/lCs466YFnz+jexvBQACq60I4eW5yT4Za7qRq0bXkUfTIOdx2lebqFs78lW2eiak5sNig8TvjiE4JaV3d1N5YmmsVCmsdGtiLHAuc3W8dfJ1cCWsmBaaf9m/X1sBHLKjTXDjoRtocPVahXL+eCRBKial0pXMjZNVyQSXASVxIMrMIkqzXkBSxSi8jVdtuo6TpeP3Dtje9e07Vf+Jd6bFHCwmB4HDJ7u+LlPbHQ1WiPrpeI4uoh83d0bLgiS7EkfGpVTCHVEn/RJtBVYZh7nbrEgKaULcP9onb7UlRzexqSl/vTbv/aMIl3Z8iR6dSQdXRRisvc4Df4Q1HbOCmEkaW0n6b20PqdaS39cBifaCZl7L+DmDzOl/e++Z/CJSBfJJHs/guzPnlmRQ6B1vFEUEAC2tifOQW1iBtytBP3VQoB5MbFai3Jy9WATw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1631.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(66446008)(66556008)(66476007)(64756008)(66946007)(86362001)(76116006)(186003)(82960400001)(38070700005)(5660300002)(55016003)(166002)(2906002)(8936002)(38100700002)(122000001)(52536014)(83380400001)(26005)(966005)(7696005)(8676002)(9686003)(6636002)(508600001)(6506007)(71200400001)(33656002)(53546011)(110136005)(316002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dit9bq1DjUs2tsTBnEM54ocEram2q0zO10PCccFwt73S5dXYTfKlj2dhC1E5?= =?us-ascii?Q?dtmrqlnTRBv1hORj/W45yBIzH3L2xvZ7KjhQeTYQaNwWrcdQrRYTeaIAIwLB?= =?us-ascii?Q?aIhKdPAHE9fa0dilMKe0FT8nJdYBgztYd3b2p1Uy2r47E8NV58xqppn4wBz8?= =?us-ascii?Q?uzJR0O8DiQvI6Z6Dbt5ABsmQg58g3rEGNOGG6YX6P/xn8zchhHlEPwo9iE2u?= =?us-ascii?Q?Ij15Va1XUeMoz3+QQrpTaiBT/euIlc/K1g1aPxSaNZPkYTDyPmhULuIGRHMz?= =?us-ascii?Q?1HPH8/mt6nCr1m2oTLW/fxjjoNDqI1JbZVu2dWLsH59wcq31SCoaD3O+QqgO?= =?us-ascii?Q?Z7EeRnTcnZrhGsdNjel4PF21UsSV/SDjW4oc/PYyXlS43oiaC5v9CYoHJ52J?= =?us-ascii?Q?ai9t0/TSChMADeSUQJrVagdN0cOUnBfdu01ZyysGW9jnUUbuuQApPawrUjwf?= =?us-ascii?Q?2kJ9FldStU7GvYeD+eJWAez9RnBJ/v4wrK7zpehfcajGvD3brPqNTH6WQkkF?= =?us-ascii?Q?0MN89epB3kc+qflbtMkmRGmahqzWJ49l2lFLQr/S7H3FfecJds7eCzZu+PxB?= =?us-ascii?Q?Xwwqe1yUqa4XK9eghZGA2vqAhDLKZRYiiSkCFV8iEqF8oqHDtzGxrv++OCi+?= =?us-ascii?Q?EWAU9FFBl57Q7xeGrJTLejj1DzmV/5+1E7kn8XyZTH3vJC+8LIuGPj0UEaki?= =?us-ascii?Q?w6yh2nlJYp9AL96oE29g4TbgTGYttfNSKxOrGwuS2Iu+/s53MrVlq0dhay5O?= =?us-ascii?Q?YqzXFZYx3vXg/8xTi1W7btO89PIgyr0ULaYbkxjgt/xb6tjxY4SBYG+4W4nm?= =?us-ascii?Q?Wt78qEonG0wsp+F2Uezkh/3NnH8h/g4B7dAvNmHINv6Ds1ju8iZ7gS42c+x+?= =?us-ascii?Q?gAlbhmAbVsfQiwBe5t05dOijWK24d+Jb51ytjErr+fj7JwmsvNe6B0rP5ZMr?= =?us-ascii?Q?0FDkmafts14SLq51PTz/cdbB6BYVklktbuU0q69xBk9VJ8+2u1DYv9H8G/e6?= =?us-ascii?Q?4iEfDHfDrXxjvhyN7ENFb7UOVk3mdhrSnhZHjBYRT+0h4H9mxjvw/XS9MLhb?= =?us-ascii?Q?yAY+5BCLS6yJ75NNMI5K1ZdrjiohcxPPGfYwJVwSS5a0M3oOlucexuEZjzyO?= =?us-ascii?Q?1wRifHJgBcUn3k4Vxp46GBQraUopPRKBBtA4+gusDEmk1TwUN0Foysf5EWkV?= =?us-ascii?Q?G1gV+F2olg6hsZCKxkv/U6Avq6qI5tHgSjKWcNtJ6YfyUl2KrTe7InwZg7WZ?= =?us-ascii?Q?rI1dIBbzOvjL2r5tHPi/7iVT3Yg74EZEJGlgAJfoessF6Yb8hPLH1u2kvG0E?= =?us-ascii?Q?c17wei/sKsJllKH5AcdyxOH1MSqJDZ/MZzI5794Vf2h2LrEj7Gc2M32Qj0vN?= =?us-ascii?Q?HRghFA0l5Ew2kZtJ1gCdbAjPX+VmPfDJ8GRGriHPWzlVQy557m5gok8oNAT/?= =?us-ascii?Q?k1y8QNvZuLY8Le4pWwOA2h3MyK741xJRh9FwaYc0dikTlGQxdvBIlU3KuyXW?= =?us-ascii?Q?Fk8lellgIsfxWmbE9NUzx5I/kA2/gjBygLurzDaDM+KlL7MvsLOaxsLpNWd3?= =?us-ascii?Q?Os6nywfCYQ15WzgLVs/PlCYqXDNZZGiXTHX2bs+tt8AuwUV4NP0WxVaEVTxF?= =?us-ascii?Q?kXGkif1Gf9kHaKp9VDLkFK4UzfjTQ0f3vc4urM9iaYfcYsR6Oyv/k51iSOdi?= =?us-ascii?Q?n7h7TyKO5MQTCW3eWVJL4lUzBD3AgHXfWAKEnXc0TmMkzeJULt/MJX0Pqk1D?= =?us-ascii?Q?wsYDChJRcw=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1631.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c985027-7ebb-4b58-97ed-08da3f1bbbfd X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2022 13:29:17.6816 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6dGnrUJNpOyCoHfRQxavgPvoJI2JZKgk/FVH3DwwaNkoGEXFAiG1cB5vbkwT/Xg+f5w1s+E2bDaOaXMxmnSVKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2769 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MWHPR11MB1631337761011927054887218CD99MWHPR11MB1631namp_" --_000_MWHPR11MB1631337761011927054887218CD99MWHPR11MB1631namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes. UefiBootManagerLib is a fundamental BDS library. Please change the cal= ler. From: Ashish Singhal Sent: Thursday, May 26, 2022 9:17 PM 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 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't like PCD. It's like a out-of-band control of library API. 2. The PCD doesn't take care of all scenarios. Someone may like to put n= ew 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_MWHPR11MB1631337761011927054887218CD99MWHPR11MB1631namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Yes. UefiBootManagerLib is a fundamental BDS library= . Please change the caller.

 

From: Ashish Singhal <ashishsingha@nvidia.= com>
Sent: Thursday, May 26, 2022 9:17 PM
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

 

I under= stand that. What do you suggest then? Using EfiBootManagerSortLoadOpti= onVariable() is an option only if we update all code paths where we refresh= the boot options.


From: Ni, Ray <ray= .ni@intel.com>
Sent: Thursday, May 26, 2022 7:15 AM
To: Ashish Singhal <as= hishsingha@nvidia.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Wang, Jian = J <jian.j.wang@intel.com>= ;; Gao, Liming <gaoliming@by= osoft.com.cn>; Gao, Zhichao <zhichao.gao@inte= l.com>
Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: C= onfigurable New Boot Options

 

External email: Use caution opening l= inks or attachments

 

  1. I don’t like PCD. It’s like a out-of-band control of lib= rary API.
  2. The PCD doesn’t take care of all scen= arios. Someone may like to put new options just before the last one.

 

From: Ashish Singhal <ashishsingha@nvidia.com>
Sent: Wednesday, May 18, 2022 12:09 AM
To: Ni, Ray <ray.ni@intel.com= >; devel@edk2.groups.io; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Gao, Zhichao <= ;zhichao.gao@intel.com>
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 wel= l to make this call? If we do not do that, the applications would not refle= ct the sorted boot order automatically.

 =

Consid= ering this, the change I have is pretty small and takes care of all scenari= os. Please let me know what you think.

 =

Thanks=

Ashish=


From: Ni, Ray <ra= y.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_MWHPR11MB1631337761011927054887218CD99MWHPR11MB1631namp_--