From nobody Fri May 3 08:22:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89783+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1652742134028487.89754056216464; Mon, 16 May 2022 16:02:14 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id M1tKYY1788612x1StHSbYGIh; Mon, 16 May 2022 16:02:13 -0700 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.53]) by mx.groups.io with SMTP id smtpd.web09.600.1652742132596301000 for ; Mon, 16 May 2022 16:02:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MkAy3cfEsVBDTlNeFMUyDwcsDOUO8fF0Dt4ZIOg4HLUo//e+h2kjGj8NmDdomaL+NirtetZL4bHT5MQs1LddPlgKwra9w0tGQEgKaGGwEOJHeSgiGA8W8ybD/hw12OJabMxvd4xuJC0Jqp7MLe4a/65Phe/H/9t/3sahvpwNGvWctV1qI3CrZLsChEXMWV+1re49Z0oMQVi+FgGlR9mMLpaggj9Dp6yhOg5C1at4TcQdC3dvP4Qh0HyTwp/tcdQTpFxwhTXvaF7AozkQcgj83HvgZb+pmee186BvjUnoyjBOFs5eLY3HDLQiKHgpiIVuYws1EfZokDZK9C8J9pITfA== 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=5pLu832FBDjk1dN6bSVynnW0Y2acn7f4Gshb0FUeJEU=; b=CZ3gjMz9oMz3KFwzt9JGcXXLs30XmMDQfWw1pC9+g+7VXb2o/GkMn3ksh5XK/tlsqatVZmwhDHATzG5bR7H56MPoQZOMw6o1gXqTpMxYwBwKWPS0ZBWhXJ9JxComMVpb/EExpXget56pq1McA0b/EKZ0GOWyMbcQbEFvLBkVugnPcPs+pRcNxN4jQ+xB3ZtlfyBgs4crXEHrKlwsVScYLeL04QPnapiMf66isPx0SdX3OQgljBR9aounqj9Zcp6TGQRclBSVyudvPTjGuJdEEA+TL2Gmad6uwzlxPt4FRiTtFwFMw/G3bXkUSDvcRtuArZGzoL3ATuZx21iUfgn/Wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none X-Received: from BN9PR03CA0758.namprd03.prod.outlook.com (2603:10b6:408:13a::13) by BYAPR12MB3045.namprd12.prod.outlook.com (2603:10b6:a03:ac::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.14; Mon, 16 May 2022 23:02:09 +0000 X-Received: from BN8NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13a:cafe::3b) by BN9PR03CA0758.outlook.office365.com (2603:10b6:408:13a::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13 via Frontend Transport; Mon, 16 May 2022 23:02:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89783+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; X-Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT008.mail.protection.outlook.com (10.13.177.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5250.13 via Frontend Transport; Mon, 16 May 2022 23:02:08 +0000 X-Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Mon, 16 May 2022 23:02:04 +0000 X-Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 16 May 2022 16:02:03 -0700 X-Received: from ashishsingha-lnx.nvidia.com (10.127.8.10) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server id 15.2.986.22 via Frontend Transport; Mon, 16 May 2022 16:02:02 -0700 From: "Ashish Singhal via groups.io" To: , , , , CC: Ashish Singhal Subject: [edk2-devel] [PATCH] MdeModulePkg/UefiBootManagerLib: Configurable New Boot Options Date: Mon, 16 May 2022 17:01:59 -0600 Message-ID: <3fe4f5fff1141c3576ccf81b5993992c2bee81bb.1652741915.git.ashishsingha@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a0d9a8e7-ae8d-4de8-a155-08da37901aaf X-MS-TrafficTypeDiagnostic: BYAPR12MB3045:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: Ddh53F2IjJRV1srtQZ4V6Ie4SFXuIBynPR20761qskO57dW+EHJmg29nR07odCx6Y4y4qKMKwCFnv+t1WXK55c6faASJgOQ3DZpvBQSPsiFMIuvqITTCs0ajqtJqqRllRszBqVV0sg+R+03vtuB8eTeBgVBd00U+IRqomFpEoqsb0kSNGYE9iMSeQyeTZ9dqj5AlJJG5EHktyoPwnsDMWSADMPUuZoZZznDcrSH65NDe+BGBhwCM+Ju+ck5XudvmJ7JGx+o8OVyPT63lQKk+Fx9IJ2ho+Pyw1GbhTShJJahBWT8mVsh/tLVMJaM062LV+QorA9CRiaK3AarKgwMdjKAEdrUEAJA3ThOHlXiC/eNCn632FxOxtEKOqlHKawbU+vmhTADnbFlt4RbdN46XkK4mkCK9sUm9z4TxiQZTYNErCUTkqUYqx+NAHuTg0iz6tdECCcVnGxaQFJfX2HGGW2AcSqYMnJUJuzCDXozZB194QGIN7+eoeIEbIv+1vPlkWe8eIYwMJV2cV9PXSeJf5tPiuHFbhtEfnCBgXqrd7HCmf1Bl9AznahqogRa4qD940csQGo9CA+hx4+IVJd4sd6BwbPr8PAAkzOm8wCTvKgfhob++a4xHX7YxHqa1KlRbpTiO2j2Sqzh0KpGDN2ryBC4lnfEjqO1Rw7fsY7eSLzSa2UB6ZaUiLVIGQ9AZJ5BBoU5DaasKWiztAN1++fp/tQ== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2022 23:02:08.7163 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0d9a8e7-ae8d-4de8-a155-08da37901aaf X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.234];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3045 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ashishsingha@nvidia.com X-Gm-Message-State: ccW1qoBzeoPeevB4RpSLS3XEx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1652742133; bh=TTaY284EM+5CcnHis8X+TVBcUCLQA+ypknJ7kXBN0Hk=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=MJF6E/sA5G/9w+NWmh7sh1Vx56B1ZP5Q1huDHyKFQ3lCQreoXC7nHtv4bzWHEwZLdAA GHMKqy3KAmdCchn2oDf7MdnGJCKUa2T9/UuxDQ89H3vTikm5yokvyoyMNfyJrTjP2HWCJ m2Wlbk2P4vSwBrc41MNngax/9Yrm1wBpoJ0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1652742135352100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/MdeModulePk= g/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.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.PcdBootManagerMenuFile = ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdDriverHealthConfigureForm = ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount = ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdNewBootOptionAtStart = ## 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 =20 + ## This dynamic PCD holds the flag to tell UEFI boot manager whether 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|BOOLEAN|0x0= 0030009 + [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.uni index b070f15ff2..8e68db1c25 100644 --- a/MdeModulePkg/MdeModulePkg.uni +++ b/MdeModulePkg/MdeModulePkg.uni @@ -1325,6 +1325,10 @@ =20 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbBase_HELP #language en-U= S "Used with SEV-ES support to identify an address range that is not to be = encrypted." =20 +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNewBootOptionAtStart_PROMPT = #language en-US "Add new devices in boot options at start" + +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdNewBootOptionAtStart_HELP #l= anguage en-US "Used by UEFI boot manager to decide whether to place newly d= etcted devices at start of the list or end." + #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbSize_PROMPT #language en= -US "Guest-Hypervisor Communication Block (GHCB) Pool Base Size" =20 #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbSize_HELP #language en-U= S "Used with SEV-ES support to identify the size of the address range that = is not to be encrypted." --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89783): https://edk2.groups.io/g/devel/message/89783 Mute This Topic: https://groups.io/mt/91152684/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-