From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.94]) by mx.groups.io with SMTP id smtpd.web10.52046.1681148098241195013 for ; Mon, 10 Apr 2023 10:34:58 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="no key for verify" header.i=@amperemail.onmicrosoft.com header.s=selector1-amperemail-onmicrosoft-com header.b=P2ME062l; spf=pass (domain: os.amperecomputing.com, ip: 40.107.237.94, mailfrom: tinhnguyen@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iytWL08yEK1mkwkY7JTg8dRvWpBpWE3NgBwQTZD73B7PH89BltB0HjV1oo+pGm3GldKZiP/qKniDS2uA2B9nLj+NgbK4xMNS/ne5ib6AMaDyx9kdiEfZ3QL4psDnzH8kqE3V8U+bge9WPLLYG02YTTAc+S+j49pVZTw55/VvlF4oIYxSpfL/CvSr++PzD2Sn57MHOt6vxxNMxOesksEBQ6aeeWgrySEroQ7XqIPnV4BBBxctr23J/2k9SaGNAHkWrq2kiCXmG9z9MvZ8Jud0xaFkRWWEiEmEPQ5bn9AcMQ7S7usMa7NDJFrGuDYajg5yrD3atGL7/J+G83r6SJb0hA== 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=F/HYnXJWbJL9emrsC2NxZQEzOctkalFgskuJrnA+kF4=; b=dOSDXsnQK1jxUiAU92JmT6Q1UyxQwk4xhPPgaoHwM0x4CRbkP6SWw6g/hvkrjg1rc1373SVWouQEwUxe4sC1wrTyGdGQzYjcAPjh0Po03ydEBG4vN/lI4l2Fa7A0yn2YQXyssrm25w8yPUTkSQBI5tWD02JHchyXFVVktOqAvkQek/U5mvF5rNkobtq4/FA8CP45s81gqQV31CLmFG/WDVdu4M6hCGOpIIEHvy52kaPn32WlbDDp08Fj3Hed8I2zNRRonRQvond476MYuFZ9b0JsnPb+yz+JedI+vXDpSyOHb9ZPsFyfEB7ZXmAZpPRGb6ZffQOFau+Ncku0n1qfcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=amperemail.onmicrosoft.com; dkim=pass header.d=amperemail.onmicrosoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amperemail.onmicrosoft.com; s=selector1-amperemail-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F/HYnXJWbJL9emrsC2NxZQEzOctkalFgskuJrnA+kF4=; b=P2ME062lNRvIY0ChlvDkcjisZftUaBjdPX0e2Z92Jq2R3I1TaDxzPdP9shVvWHsMhWSyJE/62QjSreZwoMQMIXsIFJ/v8WECMBkrImHUypAEoFefxvTIlSgcD7kKH2ItVhzPgeG9iDOZmc1nmaf7Hu5G4c202SwXMRI53PyRzZ4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amperemail.onmicrosoft.com; Received: from DM5PR0102MB3336.prod.exchangelabs.com (2603:10b6:4:9f::11) by BN8PR01MB5394.prod.exchangelabs.com (2603:10b6:408:b8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.20; Mon, 10 Apr 2023 17:34:55 +0000 Received: from DM5PR0102MB3336.prod.exchangelabs.com ([fe80::812c:e04f:eb2d:c1e]) by DM5PR0102MB3336.prod.exchangelabs.com ([fe80::812c:e04f:eb2d:c1e%6]) with mapi id 15.20.6298.021; Mon, 10 Apr 2023 17:34:55 +0000 Message-ID: Date: Tue, 11 Apr 2023 00:34:45 +0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [edk2-devel] [edk2][PATCH v2 1/1] MdeModulePkg: Add EDKII Platform Boot Manager Protocol v2 To: devel@edk2.groups.io, tinhnguyen@os.amperecomputing.com CC: patches@amperecomputing.com, nhi@os.amperecomputing.com, chuong@os.amperecomputing.com, minhnguyen@os.amperecomputing.com, jian.j.wang@intel.com, gaoliming@byosoft.com.cn, zhichao.gao@intel.com, ray.ni@intel.com, rebecca@bsdio.com References: <17534AB488BFDAF9.3977@groups.io> From: "Tinh Nguyen" In-Reply-To: <17534AB488BFDAF9.3977@groups.io> X-ClientProxiedBy: SI2PR02CA0050.apcprd02.prod.outlook.com (2603:1096:4:196::11) To DM5PR0102MB3336.prod.exchangelabs.com (2603:10b6:4:9f::11) Return-Path: tinhnguyen@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR0102MB3336:EE_|BN8PR01MB5394:EE_ X-MS-Office365-Filtering-Correlation-Id: 2134a9b0-593d-4c3a-522e-08db39e9e5ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HmO2ym05MDzgVliymj/a8DZkrl68J8++SUwEx3ceFdxk9r63raATvK6abHKM/ztnP7ZYRjbTFXkjgmTq/ULo77UTXErkcr+UkWqLNffQq323rCihan7aujMTb+wE8kkmet11VwRVGs/gNbCqCiV6M8PpY9/B7nf3Or13ZndAiqGx0UQ9+HqOs/pMsW50IvMLbJoYhGC25s0CggsVfMdNWggfFEpWjpuVfkQJb5VXP6ubB4G0IQprwPfP/JRGTDImyrN82yE1Kse8v11rRKprbPHiLliKJchFN5iWQnnNFby9tEY3t5DYWF+D5TT1LYYmpNxmGEeRS94jqBvjdv1PGKNw0iNBjEQzg2rZ+IvFIp7x6wf6BP/aUGJhJA/SZX1iVZRMUGDLkOJU1qLXpkbyS3KN1v2emVLWX8NXijCBIEGMu5HEFpQpil/CrBCWi64QA8Gq+tDXmtJHpeh2E0E4FU0dEWDJ6bnwI60blSeSZ4vq0moRs53BlukfltIyMF7EOKdEzlO2wO42Ra66cjhuM8juDitFuRxHqAeTcq3NuRxiVx2ibAuR7G5yQLI2NtmMcRRhxWtx+zz/TMQ7QVAupOWhb9nz4HhmQmdqnoM3ZX8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR0102MB3336.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(396003)(39850400004)(366004)(136003)(376002)(451199021)(31686004)(66899021)(478600001)(83380400001)(38100700002)(31696002)(2616005)(83170400001)(42882007)(316002)(966005)(2906002)(6486002)(6512007)(186003)(53546011)(6506007)(26005)(8676002)(4326008)(8936002)(6666004)(66946007)(5660300002)(41300700001)(66476007)(66556008)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?dMCrPAMOilT3nfRslSH7EJHQvH9n6ZEjXwBLRnEzmq7ZeIKPsgSRa7fr7bLM?= =?us-ascii?Q?UlQ/f2xsrj4nTI6/GG0yRj3cCCvi6pYX0NRaIg96dDU4zHQ6D2MdRjsHLusj?= =?us-ascii?Q?3hcIpJdo/TbfbwSUGsF/UV9WINKGN9x3KFu0SmMQMRJUWf7DnMFp6UTYy4sN?= =?us-ascii?Q?Qk1QeQX2ywuJMX5gyLe2OYjN1xEYWdtrgJn44ttZM3Lt7GWBJi0QK2sHQU+P?= =?us-ascii?Q?QFwC5pMZyAdoBsP6gRUI3Jlhg1tcvAQZhuGIdtceWW7AkSkN4CPFrPdsxPHC?= =?us-ascii?Q?ix1aK8zIzGjzMn1u9PYOLaShBDXuOWEeVrCtdDb5xDMCLzuLnbpHgwjax1Kj?= =?us-ascii?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Q6xeLsjnB8L?= =?us-ascii?Q?olSr3RTtk4C0KnDVHqMVJhcN3DscG+1mTG03tVH+djprjeJQzZG59g0+ZtpE?= =?us-ascii?Q?Mnz/auyX2FzHPu3qpDgOdRfmjr+pjapWeiYFv25qaxFctya3XyfQ3XR6FbQN?= =?us-ascii?Q?2oMinwJsHxq6ESZ4Vjhjf2IeTGRAXqg1ml2NvPp1lAGtsu/RJwEhiysXifka?= =?us-ascii?Q?A+D13EBv+nm2ESaFQpNj+85ES40sT7H0eQewln0rLIww37TvtuuY/b//pE3J?= =?us-ascii?Q?p+W+hjjyQYK1tMnGcg1Bsu+sQ2iseOFsV+R/CEE7E1CgR6plgKr1hrS9mmX3?= =?us-ascii?Q?cYB0DC5byU+JL+VSBf3k9KJ/2lt36W9Po36opfETacvj/zmEeMaueSJFYII0?= =?us-ascii?Q?ic41yK48kdYgajCcRxC5KJs=3D?= X-OriginatorOrg: amperemail.onmicrosoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2134a9b0-593d-4c3a-522e-08db39e9e5ab X-MS-Exchange-CrossTenant-AuthSource: DM5PR0102MB3336.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2023 17:34:55.1679 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zDvVhjt8PWeVgjws0OTUSSi2VgaWfmjoNdph6yXdfizc6/ZgNoD4JzWeFhtK+st9+d9k5bpWFkFvkXokB5AF0MXfPy4d9pOLBJPC2DrG7c9NTeTG7R1S6ACEC8rXGBA5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR01MB5394 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Gentle ping, I=E2=80=99m looking for some feedback on this patch. Could som= eone=20 please help me to review it? On 4/6/2023 3:19 PM, Tinh Nguyen via groups.io wrote: > This introduces the EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2, > which adds a new UpdateBootOrder() function to support customizing > the boot options order according to the platform-specific policy. > > Signed-off-by: Tinh Nguyen > --- > > Changes since v1: Correct the format of the email. > > MdeModulePkg/Include/Protocol/PlatformBootManager.h | 24 ++++++++++++++= +++++- > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 9 ++++++++ > 2 files changed, 32 insertions(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Include/Protocol/PlatformBootManager.h b/MdeMod= ulePkg/Include/Protocol/PlatformBootManager.h > index e527b0ee0eaf..758bc2deb774 100644 > --- a/MdeModulePkg/Include/Protocol/PlatformBootManager.h > +++ b/MdeModulePkg/Include/Protocol/PlatformBootManager.h > @@ -1,6 +1,7 @@ > /** @file > =20 > Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. > + Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
> =20 > SPDX-License-Identifier: BSD-2-Clause-Patent > =20 > @@ -29,7 +30,8 @@ typedef struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL ED= KII_PLATFORM_BOOT_MANAGER > // All future revisions must be backwards compatible. > // If a future version is not back wards compatible it is not = the same GUID. > // > -#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION 0x00000001 > +#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION 0x00000001 > +#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2 0x00000002 > =20 > // > // Function Prototypes > @@ -72,9 +74,29 @@ EFI_STATUS > OUT UINTN *UpdatedBootOptionsCount > ); > =20 > +/** > + This function allows platform to update the DriverOrder/BootOrder vari= ables. > + And it is available from version 2 of the EDKII Platform Boot Manager = protocol. > + > + @retval EFI_SUCCESS Platform successfully modifies > + the DriverOrder/BootOrder variables as wanted. > + @retval Others There are some errors that happen. Check the stat= us code > + for details. > + > +**/ > +typedef > +EFI_STATUS > +(EFIAPI *PLATFORM_BOOT_MANAGER_UPDATE_BOOT_ORDER)( > + IN VOID > + ); > + > struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL { > UINT64 Revision; > PLATFORM_BOOT_MANAGER_REFRESH_ALL_BOOT_OPTIONS RefreshAllBootOptio= ns; > + // > + // EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2 > + // > + PLATFORM_BOOT_MANAGER_UPDATE_BOOT_ORDER UpdateBootOrder; > }; > =20 > extern EFI_GUID gEdkiiPlatformBootManagerProtocolGuid; > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModule= Pkg/Library/UefiBootManagerLib/BmBoot.c > index bde22fa6590e..67d1d54b3c24 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c > @@ -4,6 +4,7 @@ > Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. > Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.
> (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP
> +Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent > =20 > **/ > @@ -2412,6 +2413,8 @@ EfiBootManagerRefreshAllBootOption ( > BootOptions =3D UpdatedBootOptions; > BootOptionCount =3D UpdatedBootOptionCount; > } > + } else { > + PlatformBootManager =3D NULL; > } > =20 > NvBootOptions =3D EfiBootManagerGetLoadOptions (&NvBootOptionCount, L= oadOptionTypeBoot); > @@ -2453,6 +2456,12 @@ EfiBootManagerRefreshAllBootOption ( > =20 > EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount); > EfiBootManagerFreeLoadOptions (NvBootOptions, NvBootOptionCount); > + > + if ((PlatformBootManager !=3D NULL) && > + (PlatformBootManager->Revision >=3D EDKII_PLATFORM_BOOT_MANAGER_PR= OTOCOL_REVISION2)) > + { > + PlatformBootManager->UpdateBootOrder (); > + } > } > =20 > /** > -- > 2.40.0 > > >=20 > >