From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web09.19585.1653570911507487797 for ; Thu, 26 May 2022 06:15:13 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=jhaeSjuc; spf=pass (domain: intel.com, ip: 134.134.136.65, 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=1653570911; x=1685106911; h=from:to:subject:date:message-id:references:in-reply-to: mime-version; bh=O14rg6Wo2QAqLbSjC3GG7HTAfFyKili+4QJSQUOI2ug=; b=jhaeSjuceLVbII0Vcn0+58KFyBw2JTYcQe/0D48pT1Hu3cwE4Et99/aY 0bO/KHmroeGC3REu89frCyYKKn0peolNaXR93CobchmvPwDjIhcgPpCgi CIAWviA17waKh3oo9ziqyrI9fHnbPai5Q1Wz+XyG3FzKu6UhS0dmR9jSt 75FsWhBTM2FlSUNfohaelXUruCxzRoLXnN2X2Kee7MR/XQGnP+AHt+kjr 5kNHQXCZXvETZLqI8CX5KWx0f05ZGwYaIYtuv+zKGa0PzrKwbgyRdNG/M RwB+pbwDjp5KplYoyCXVjnY3WYFu9oQFF+mNXPHX0uIPmh/yMTYO8Q44M w==; X-IronPort-AV: E=McAfee;i="6400,9594,10358"; a="274155209" X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208,217";a="274155209" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2022 06:15:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,252,1647327600"; d="scan'208,217";a="603062137" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga008.jf.intel.com with ESMTP; 26 May 2022 06:15:10 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) 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; Thu, 26 May 2022 06:15:09 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) 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:15:09 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) 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:15:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RhcTFgAmoaIEhLXVYni1Ov515R06eFiR2SVdgYoNmYjyDmDekumpL/m07UNdydvvn3wJjuYd0BLbvQwAU295gD8e0iagspk1ktQWQBK0ToNPpxGno1dY0zrC+vQHx30GIEyL1SNSg16Vi5mO8o5m1PIAE6iJdvuSjYDS5nmC69NJXwg1oDRz4Avow9wKYjjMrTPa5V+zDocghOS8qzq7opkPy6ZIRlWTVV863tMGLfq1mpY5C9DztC41nCDPK3dggkWSPb4/FzrRzVNG9VtvnCzmj/Q7C5oauavikpG3ekzZBxVPUoDHZ4ATJvGhbG7xjiTkOTg+xXbFu2vAFDoJXQ== 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=VfapdttIZkGwFNPqOvDF0JFmffY6jvUrjVH5wSiwtd8=; b=J2EA+UnMNRSIFRJZcvwwkEC8s2Mr+0Jncw0NJhn0daOSrnravITIo/d3MEwdMXyw3uv2hU/V4j/L3o0YwztGEJYOGU3mGPzYQ9uXDlwapK+Y2ysp9VnO8CUNQmZgXDsmBfd0dFLpZrqo6ZuwJUGl7G5Sk8OnBVdFLoGVJV55g9ObzDXVRSf0BJUQCTBZ3W8AU8zsm7GnY3I5Lb9ozXWYPpvo/ewwfLgEhpDRJrp7KmfthWkC0O3PiUWsx04n98qNAvOZb5hTAEBpjZ9xOe4lFQQvDerYwlwfOFc+gWX61I7+gDQmdIEq/ixsYb1EI6qtEKB5WR8iqXeHKsO9vQfT4A== 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 MW3PR11MB4697.namprd11.prod.outlook.com (2603:10b6:303:2c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.16; Thu, 26 May 2022 13:15:07 +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:15:07 +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+N4I7Cw7660jHPRwgAAg1YCADfJfsA== Date: Thu, 26 May 2022 13:15:07 +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: dlp-version: 11.6.200.16 dlp-reaction: no-action dlp-product: dlpe-windows 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: bc858535-3742-43b1-ea2d-08da3f19c13a x-ms-traffictypediagnostic: MW3PR11MB4697: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: 8E7JDdIOqtQMHCwwIKHDKmCra58J3XiOwRgzvY4cSIh4tR1ulQG4STPNL5vZs4dt+eW8sbFETy0kKHkhyzBDT3yilrVkAm4O5fxRCx/kHGmRw8ykTiezdvGp/jLMCDuDZ9w6J5ZB97UYMOEniXE0EPcTbH5MdA0e1+i3gEOPH10Z4zZjaCk6FqKJrMrPUnlyzpcr5aUoyx9GR5IjhA2Y43O4wewVKakEj8bGq136XAIt+zmkzP6IPBRfsWcoKhXUMlDX6oldQh9PTl+7npeoLqNUGIBA6ZZYk1sGlJko73irNRmWRyry2r0zKf3QykUrUd0Ty4ja2o5Y/BDOhOPpX4am6QMHZF9yjve8iHbU4zKu3uftfuqM6Du4MflQ8rOCVxISezYJVRueFfjLRGAquhH3enFKds0rBfvtQeRKL5uFxbjIMgSySJAPdxGxYJqpZsHc7rH5xNsK17Kyc0VLIN8gWwmHSmD6sK43G9+7/3ItrXA78cEvjMDOm4JjNNJOaXTT7+U/t27P0ID7IMpr5lr5CZPntQYs/EX/GodpoByG9inT9e9RV9wAKqMzzZWTzSVsEorDtDVxYVNHqLy7mxKd7Qo23pbgxDVoaAJ3D2LpITRMfIX0ruttOmtarTD7qg1RsEfHNB1K/ksoxdGTRNawROLIFOmA0HTsu+WFgdn7exnyfcVFn6ez/fpoPWyDoXAaQibYJkQxdcasFyZrFslPNoPF1ZfiXW28wCNa+/yDPsSbfGuotcBb6bSGf/OVwkVkQjCxMc5yME4/rUsNch2o4YbiMnIhrVjfF0fgcXNNDTeMEWc6E2u5qaf7NoSK6t809lzQkrxrlQ5/Aajk+A== 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)(76116006)(66556008)(8676002)(166002)(82960400001)(7696005)(66446008)(86362001)(66946007)(26005)(64756008)(71200400001)(6506007)(9686003)(53546011)(122000001)(33656002)(66476007)(316002)(508600001)(38100700002)(966005)(55016003)(8936002)(110136005)(2906002)(186003)(52536014)(6636002)(38070700005)(5660300002)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ctVlvVdS6u5iaw0cQo5DxuzS7uGHtFb+uExhoMZULRrqTvHU02Q9jnHiUj1K?= =?us-ascii?Q?RQ0zkiQOBU8hIifelOBJiDEQzesYiT9UxoHFJQ5Ez+SC3c2fmD6+LuG6xwzk?= =?us-ascii?Q?TIvqWtmOBarms7ePBReUvCtrtf0d8pb5uVRwBes6xs15xxYox3ttRVVlBhvV?= =?us-ascii?Q?c9Bh84AsQ2s14rDiZM9wGals/7gmKW8Rpxmdcpor745IZ2Si1OKiZsnpDUgx?= =?us-ascii?Q?nkysib9ptdo/7v7ze6M6S2B/L4XZEPeJN6CGWRnK92ZInOTvCgSrkPLgs2Ct?= =?us-ascii?Q?7+iYUD4jllI9Xrzo7clvgRPaladnz5A+d4PFhL3joRsOkb8IvUvgwrJAfK+s?= =?us-ascii?Q?1nCvSs6euQiyOQe8f7DWPXf7N1wO23fib1C31dl/fqarn4xeuzMNWoD/0vt5?= =?us-ascii?Q?GUvqzJK5ASvTrXgbNTlLDbxMe9cBWiCDWoEkPh31y32r+d/cv8XuNq/pdzs4?= =?us-ascii?Q?M9R8sLdPmlVG542gFgQU6zc2OfbcQgn6BlUTLg0G0TQJH8S0sZ41DlQLa8wG?= =?us-ascii?Q?1ypDF1783kyZm3QXfC4q33JLBOKc2B270Ee3p8ptkUN3NoKz7MTCsmPLCuCF?= =?us-ascii?Q?OmWEbQz6TCeMGEIkdcmmQuHylxvwtUZ29CWAMCNQ5UVDod6oU214pnHi8ce0?= =?us-ascii?Q?gBAIK7hjBIyFGzCf4Kw2ZbFasy+v0+3/HD+Tvv4zYJtYBMyTa0jRpwg+wVIy?= =?us-ascii?Q?A/G9MiOcukD9OjXWxnJqcp0+692+6jd54niIyQVyJ6qONxHYM5To1Gze7CQM?= =?us-ascii?Q?U5jG/1qkueVd1YRiB7nt/OZP3zXAdg0cxaxyDaYxitdg55s84Xj9Bk1hmo2c?= =?us-ascii?Q?wkCNoZ+/plnKiyIyaMxVZPribTq3+CcOlCXjjSd8XBfakI65QSyzoycgbtfU?= =?us-ascii?Q?N/jBHWW31JQdYG2mbNnK/PDXKpK18dSw+C3cMaWunXDVSycAL5TjzQHv0rgo?= =?us-ascii?Q?Q54H5aE/8opZqIe0jP+NdUCFc2AEvH7+ddfSwicv/EBznXZswgl/CBYhAL5z?= =?us-ascii?Q?N8LR4OTfeWX0s7BkuNqEhyvYKRtioA7E85VkuaMDHmCUwlV1ubDDVeSgdhAg?= =?us-ascii?Q?FUKllgU0nucH2ZWO2LmGHQdYkyvRu/3jgOkK/WWCtr+Y5Qnspd7/cA6H6W+k?= =?us-ascii?Q?Yfj2m2x1ftEdrP/9FUWIjaZfWhpO9OcBDRVDkQ00HHsoQ6GNhupHR0nsUL3p?= =?us-ascii?Q?soTWgP07uqj662mydnJ7u3llJcLSKH1Oj9ZvfCHKFWxPC7DZUDcy2dtAoG1d?= =?us-ascii?Q?f9PfVWro6EOkw/fnydZdyB9jdUvQMMHzQTQ59bdRY+CRg6deEbkzn6Npa18m?= =?us-ascii?Q?2Fjp5JVGe3sxfIXhadmOarTeE0mndzpdiDAbFGjde6T/y20mN9jkOJQhaGh+?= =?us-ascii?Q?2Dr0aqfpWhHJ25K1nrxMtd/X6K71XcgWitgPxTnwCPQfPAehJPQtHfuEYAla?= =?us-ascii?Q?9HUK3Y5OYb7S3aS/gukN2Fvbvm8j0wwdWfyAtomN3I6a2eyiIZy8kvFdo8F9?= =?us-ascii?Q?FXTtIZpItetE1xfqWDf51vf2T9NIkkiPAJqX3MfxR57r8+mnGp3auqr/+BRZ?= =?us-ascii?Q?gJtDCZJPZbojTy8ae8CaYYQPNxyVOj+8nIkiKdaC4uCLw3AXyZRJPzJ7JVnZ?= =?us-ascii?Q?1bQuJVEQ6XNSt/7TGwHsJ5KXanV98kf6ek8o+hnNlmaZpMWx6O9R7Pe7sv1W?= =?us-ascii?Q?UQEXNLES9dTbEfmWzYoFCLNvgbVpci2ohW/dzMtOdNeYxRJyos5YaQofuyah?= =?us-ascii?Q?1bYgzqbLww=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: bc858535-3742-43b1-ea2d-08da3f19c13a X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2022 13:15:07.4317 (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: zAFcHnEuvkBGdKgTR3fRIreMsrs6LsftKaoXi/b3nB7x+Sk59fMr4ZhoEqhVXH7wma0NOBVVbOIMKaD8mImbFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4697 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_MWHPR11MB1631122A46D0B826C29DC5A98CD99MWHPR11MB1631namp_" --_000_MWHPR11MB1631122A46D0B826C29DC5A98CD99MWHPR11MB1631namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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_MWHPR11MB1631122A46D0B826C29DC5A98CD99MWHPR11MB1631namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
  1. I don’t like PCD. It’s like a out-of-band control of libr= ary API.
  2. The PCD doesn’t take care of all scenar= ios. 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, 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,

&n= bsp;

Won't t= hat 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 reflec= t the sorted boot order automatically.

&n= bsp;

Conside= ring this, the change I have is pretty small and takes care of all scenario= s. Please let me know what you think.

&n= bsp;

Thanks<= o:p>

Ashish<= o:p>


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 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 c= aution 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_MWHPR11MB1631122A46D0B826C29DC5A98CD99MWHPR11MB1631namp_--