From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web09.2644.1623205834137708172 for ; Tue, 08 Jun 2021 19:30:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=yU7M8Mof; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: zhichao.gao@intel.com) IronPort-SDR: jFUy01viIdouqu5frjcoX+4LAyokMAus/egep8ndP0eH4HCq5FZkF5J/y1UprvAYeCMjzROsiN xMrca1SLjPmA== X-IronPort-AV: E=McAfee;i="6200,9189,10009"; a="192097289" X-IronPort-AV: E=Sophos;i="5.83,259,1616482800"; d="scan'208";a="192097289" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 19:30:33 -0700 IronPort-SDR: JCCYm+fJKSoarhqJDs6QJm723JEKIuG9CjrDMckRm/G/06B9aMQfHYXFuRGq572y5FbAQVzqCq J1dRU++LzzAg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,259,1616482800"; d="scan'208";a="485542831" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga002.fm.intel.com with ESMTP; 08 Jun 2021 19:30:32 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Tue, 8 Jun 2021 19:30:32 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Tue, 8 Jun 2021 19:30:32 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.107) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Tue, 8 Jun 2021 19:30:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N1Vt3hks3jLl1tTITTwjRF6O77nV/RJKDGYlVojZl8CH86pdj3XvEfoubpsUnjwIRgC+EQYYar1vE4b0FIqfN3NLQGNVWxoJ+YqJIRmlhn+WaFdekdCKcTt/TVZ0M3xvg8a51ATYqX3vAgyVS8eqLUOHVsMqs06KwWtZKCuD8rrc3iClpEgDFKaY8QMonBjq4E0gtFG+4S8sp0oSlsANGAoeTeASRBeu8VOr47wE9pVXGud7DAtkyCeO0Zi6EkHOBhOP2fBmNtGxM/rb5QghFbjEXWs5qnKQxEFMKqlmu7a3KPOr/pqk17GA4n/7oZqwsWkExc4W48UJaEKavVWr5Q== 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-SenderADCheck; bh=0myDRL5RUumimieraqv/3rSjGT4ECtX+5FuBH70c1C8=; b=Vqm4KJdzRfShpN9koQSTmIQjxIjiIJ4EG5UrKQeh6vvUevG4fDpRMwWbrkzjhRSVEN4k56gLfSlZdjAUA7FyO+8M83mUgD5OnFSTdIrpfBQWHdN1dSTS0uS6RGuz07ippo2MTkRuKsIvOqWAOzPNdTZeRSLBhSSsCpZWp4TJSBc8yAG2O6BS7UsQwoAQTD/QEzNg49Q8xcgtT61psDr9QVvvi0o1/8JDxu3CyNdSvjTaJpC6mNxHc3OiiOjhnQ0KI3ERFVXLqqMmvoGVhxWWXG5V7zsJIp3XYnFykRq7aPZ/9UMch/sjsPGOTYVnNPDmzggyWshLWE4x5ZFYiRg3HA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0myDRL5RUumimieraqv/3rSjGT4ECtX+5FuBH70c1C8=; b=yU7M8MofV8bgbIrCmeuCZ9U+wwE+YXNz79CtmFSp5KaBcj5K6TDR8A+GD9O8JwCAUii4cvsP7Ol7Dr3+OS+tyQ8KVE2qC/OwSl2hoK6z2NJWshyWVqVIRB9EaDcJ5oDu6z80ua7X6F9T4CGjAiWU2ApNgXrt+wMeGNw+SxGxEwc= Received: from MWHPR11MB1647.namprd11.prod.outlook.com (2603:10b6:301:d::12) by CO1PR11MB4900.namprd11.prod.outlook.com (2603:10b6:303:9e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Wed, 9 Jun 2021 02:30:28 +0000 Received: from MWHPR11MB1647.namprd11.prod.outlook.com ([fe80::a1c8:576c:27f:9dcc]) by MWHPR11MB1647.namprd11.prod.outlook.com ([fe80::a1c8:576c:27f:9dcc%6]) with mapi id 15.20.4195.030; Wed, 9 Jun 2021 02:30:28 +0000 From: "Gao, Zhichao" To: "kenlautner3@gmail.com" , "devel@edk2.groups.io" , "gaoliming@byosoft.com.cn" CC: "Wang, Jian J" , "Wu, Hao A" , "Ni, Ray" Subject: Re: [PATCH v1 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use Variable Policy Thread-Topic: [PATCH v1 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use Variable Policy Thread-Index: AQHXWX4jewPPOs+2IU2J7nChg4p7o6sK+6Gg Date: Wed, 9 Jun 2021 02:30:28 +0000 Message-ID: References: <20210604201326.1383-1-kenlautner3@gmail.com> <20210604201326.1383-2-kenlautner3@gmail.com> In-Reply-To: <20210604201326.1383-2-kenlautner3@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.142.3] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 36e393ff-fb30-4fef-b955-08d92aee8be8 x-ms-traffictypediagnostic: CO1PR11MB4900: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Nx+BQlvo/bxsT+sx672wD3xMLe9MNT4IyY+cGPKrH+2z4oFjz6bBntwqClI8O4SyU6YkiWotmuIQiCdADSlblE1uNeDoW74kRX1MiZm/6jKJpq1Ku8FtKOpEbXarlYDVM0C7I7Zl8t6qRh+HQ7ZjpjGRZuxUs1FMjZtPoFtmVTm+9s9wBGps3NqbxaQ4n2syD7gOk0LpDiEb7tnT9McdS3lNVipVBwliUqPttN50uf8108xD54x0u9XB5REuKG70Zn6xR4eyoLpY2zmgHLOBRvgda8Xt9jry5A6W5VoyVJiL+FRwLKRT3AxliUOypJSoXs18UbCtlmEDufWhkghjgar7Q+QKwiqgvDEE6uao/n9oF9fMKf4RpR6JMURM93pPiKHHIc4ucX847tZ4Pu/c+NP8e/j7vM/69T5SXSox2j25/h9IvWPnuKilSvdr5Gqn3QdNhJQXG70oJoD6B5N28Ol7mVTlNkmei50BqC3YKZYW5t4MDyOLsNG8+VqbjP3MRo2MNVt2nTbhVTMgCh9XVWx09gpY1n2FPl5yF/WvcbR+mhoOFHcoPU6BCJn3+6HEDMLZFmj4RF+CvqoyLdWu3Je82q4kySRGD3iX+fLMja4= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1647.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(136003)(366004)(396003)(39860400002)(346002)(26005)(8936002)(15650500001)(9686003)(33656002)(55016002)(38100700002)(7696005)(6506007)(53546011)(2906002)(5660300002)(76116006)(54906003)(64756008)(66476007)(66556008)(66446008)(66946007)(122000001)(186003)(86362001)(71200400001)(52536014)(4326008)(8676002)(107886003)(316002)(110136005)(478600001)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4KiNiXYjGU2nck9iNAN3kAb57a/8rU0m8p8kybhWzz04PzAEuADGcLKlaEIS?= =?us-ascii?Q?tJ9EYxMln2IQNZ/Tdakc09xfjrHjklUVPqeMLVArkI8TL6rDKWsiKmpitJeY?= =?us-ascii?Q?o9Yl/i/OuVTlMSY+2Cy/1D5Ojr2W+WvJhioAWDHNORBgYn+XKTOpp2lVvbdm?= =?us-ascii?Q?0sveZs5XjKOQqmvJfZ1wHHFQOse9TWpMYIrOz/mXnKkngU/kBnwF2ayk3SFz?= =?us-ascii?Q?hSsW/ju0ZnX0kJraXR0nXpUBgD74OCRV9AKoqfQaS7U4aqFyRa4mN6FyrKof?= =?us-ascii?Q?bWhVvVL5UnxH7t5zitRC4zO0l1kEfe8mS3cR6UIJi+SPoWhn3RQmWXkby4/Y?= =?us-ascii?Q?jn45J+2P3WeCdQCcCaFnReyeY8OfgxBa9B8nq0XOgY05ttk2BTGwO4VDQPyG?= =?us-ascii?Q?IiguNTUvFhUGOTrhqp/05fXZ1kEMRLiZ1VBur2m7NuymtpQPTTWHTkUk0/5M?= =?us-ascii?Q?TAbjtFu3AWy2miZLd+vFGSIYXoaXB6vdZaXCGfwTzM6K78aeNoVLWm281gFF?= =?us-ascii?Q?5S7esUxklRRFvxpKbYgQoqVwnxAM8GA/Xy0AALvmv6kje1nrECQP6nkwN43k?= =?us-ascii?Q?+AgZsvtHLOU8Yee1X7Ksdq/znVwHYzJ19jJGX1kmsJj93iOsqn4FRVdOQxDg?= =?us-ascii?Q?JUUD1G//ca3Z5bMNwVu9641o3tQO57rN4eBqmk4XXemQftjULqi+vPACUuV2?= =?us-ascii?Q?tMCpMLUqQP/8sVqsv2tcux0lpYDqembHAquOJa3hRc+LakVWZ7aRUFYQLGB8?= =?us-ascii?Q?Et2CqRDx+fpI25N0An3/+KuD3HQZW4ep3yLrz+7rw3s7c5BFAKE4nk9xjgjD?= =?us-ascii?Q?vFL3qgtxLtaGv/lAmPc6nBa/14fbbzIf8G7COMNN/GKz++XTlprTjAQhXN2C?= =?us-ascii?Q?LB7JCXz+/ZlDGOtWx58yRejjnW1gQBNoPo3pjEdQKiBnGrajqATkzzVY+8Cj?= =?us-ascii?Q?wOYW5EpmIyVp2uaE1mdlRp89xN1FEZJ50LfLnE2f4ZrpNklsVc6FTj2bhjx4?= =?us-ascii?Q?FmxQ3KA+0bZzKkbKFSRMNQLnJYnuHy2YfwcbHwERsJ8Cx2d9iWA/WZbNVoM8?= =?us-ascii?Q?MyKUrQObJ0RG5C18YA5TXw7HiEpVrn4SG85n+FzfrajfDWMm2IRwihxcwjJB?= =?us-ascii?Q?lm52txw2p26bvdrgQ6AkdRCh50Nm3TGjXBY3les6RG/bEoAGFo6tI0+9yr81?= =?us-ascii?Q?FbOGbGZpP+f0VspFEUk04dvDpUBTxArd3PmKs41SrVQDFUtysdS/0Ixqn5Vj?= =?us-ascii?Q?JTH8Kgjs0kyV3TQ8XxzSY/htLLwijb4HWNtb6W+biChuRWIXAh1KuYQ1Cvq/?= =?us-ascii?Q?/+DBQ1uZNSVQvKY+2bbaZcaY?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1647.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36e393ff-fb30-4fef-b955-08d92aee8be8 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jun 2021 02:30:28.6114 (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: OsObBDjctOx1dc6TTAY4z+bZ0g1JxjBUT2GQhAk1Lookj6uICv89bULy2tsg71dQwRS0SBH6b7+0XAyyjg6zuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4900 Return-Path: zhichao.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Add Liming to review as it is a change related to variable. Thanks, Zhichao > -----Original Message----- > From: kenlautner3@gmail.com > Sent: Saturday, June 5, 2021 4:13 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Gao, Zhichao ; Ni, Ray > Subject: [PATCH v1 1/1] MdeModulePkg/BdsDxe: Update BdsEntry to use > Variable Policy >=20 > From: Ken Lautner >=20 > Changed BdsEntry.c to use Variable Policy instead of Variable Lock as Var= iable > Lock will be Deprecated eventually >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Zhichao Gao > Cc: Ray Ni > Signed-off-by: Kenneth Lautner > --- > MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 4 +++- > MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 20 +++++++++++++++----- > 2 files changed, 18 insertions(+), 6 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > index 9310b4dccb18..76ff6a0f5fc3 100644 > --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > @@ -50,6 +50,8 @@ > BaseMemoryLib DebugLib UefiBootManagerLib+ VariablePolicyLib+ > VariablePolicyHelperLib PlatformBootManagerLib PcdLib PrintLib@@ -7= 7,7 > +79,7 @@ > [Protocols] gEfiBdsArchProtocolGuid ## PRODUCES > gEfiSimpleTextInputExProtocolGuid ## CONSUMES- > gEdkiiVariableLockProtocolGuid ## SOMETIMES_CONSUMES+ > gEdkiiVariablePolicyProtocolGuid ## SOMETIMES_CONSUMES > gEfiDeferredImageLoadProtocolGuid ## CONSUMES [FeaturePcd]di= ff - > -git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > index 83b773a2fa5f..13723bee299b 100644 > --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > @@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #include "Bds.h" #include "Language.h" #include > "HwErrRecSupport.h"+#include "library/VariablePolicyHelperLib.h" #define > SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) { \ (a) =3D ((a) & > ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) << LowBitSet32 > (EFI_BOOT_OPTION_SUPPORT_COUNT)) & > EFI_BOOT_OPTION_SUPPORT_COUNT); \@@ -670,7 +671,7 @@ BdsEntry ( > EFI_STATUS Status; UINT32 = BootOptionSupport; > UINT16 BootTimeOut;- EDKII_VARIABLE_LOCK_PROTOC= OL > *VariableLock;+ EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy; > UINTN Index; EFI_BOOT_MANAGER_LOAD_OPTION > LoadOption; UINT16 *BootNext;@@ -716,12 +717,2= 1 @@ > BdsEntry ( > // // Mark the read-only variables if the Variable Lock protocol exi= sts //- > Status =3D gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, > (VOID **) &VariableLock);- DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable > Lock protocol - %r\n", Status));+ Status =3D gBS- > >LocateProtocol(&gEdkiiVariablePolicyProtocolGuid, NULL, > (VOID**)&VariablePolicy);+ DEBUG((DEBUG_INFO, "[BdsDxe] Locate > Variable Policy protocol - %r\n", Status)); if (!EFI_ERROR (Status)) { = for > (Index =3D 0; Index < ARRAY_SIZE (mReadOnlyVariables); Index++) {- S= tatus > =3D VariableLock->RequestToLock (VariableLock, mReadOnlyVariables[Index], > &gEfiGlobalVariableGuid);- ASSERT_EFI_ERROR (Status);+ Status = =3D > RegisterBasicVariablePolicy(+ VariablePolicy,+ > &gEfiGlobalVariableGuid,+ mReadOnlyVariables[Index],+ > VARIABLE_POLICY_NO_MIN_SIZE,+ > VARIABLE_POLICY_NO_MAX_SIZE,+ > VARIABLE_POLICY_NO_MUST_ATTR,+ > VARIABLE_POLICY_NO_CANT_ATTR,+ > VARIABLE_POLICY_TYPE_LOCK_NOW+ );+ > ASSERT_EFI_ERROR(Status); } } -- > 2.25.1.windows.1