From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web09.3163.1642573831526840065 for ; Tue, 18 Jan 2022 22:30:32 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 19 Jan 2022 14:30:27 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Rebecca Cran'" , , Cc: "'Jian J Wang'" , "'Hao A Wu'" , "'Zhichao Gao'" , "'Ray Ni'" References: <20210616224526.1523-1-kenlautner3@gmail.com> <004401d76313$de84c2d0$9b8e4870$@byosoft.com.cn> <01e4e221-6291-955d-68c7-a573f526435d@quicinc.com> In-Reply-To: <01e4e221-6291-955d-68c7-a573f526435d@quicinc.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0g5Zue5aSNOiBbUEFUQ0ggdjIgMS8xXSBNZGVNb2R1bGVQa2cvQmRzRHhlOiBVcGRhdGUgQmRzRW50cnkgdG8gdXNlIFZhcmlhYmxlIFBvbGljeQ==?= Date: Wed, 19 Jan 2022 14:30:30 +0800 Message-ID: <015501d80cfe$0dfed2a0$29fc77e0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQFmIJydk9mpNfgwdb0irOpKFk+eEQI14UwMAkdza5itKdAsAA== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Rebecca: It has been merged @ d9a7612f8d1da197883bd1cb9f91f229522d39b1 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Rebecca Cran > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2022=E5=B9=B41=E6=9C=8819=E6=97=A5 = 8:18 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; gaoliming@byosoft.com.= cn; > kenlautner3@gmail.com > =E6=8A=84=E9=80=81: 'Jian J Wang' ; 'Hao A Wu' > ; 'Zhichao Gao' ; 'Ray Ni' > > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] =E5=9B=9E=E5=A4=8D: [PATCH v2 1/1] M= deModulePkg/BdsDxe: > Update BdsEntry to use Variable Policy >=20 > It looks like the BZ associated with this change is > https://bugzilla.tianocore.org/show_bug.cgi?id=3D3421 . >=20 > It would be nice to get this fix committed, to stop the loud deprecated > interface messages. >=20 >=20 > -- > Rebecca Cran >=20 >=20 > On 6/16/21 18:58, gaoliming wrote: > > Ken: > > Thanks for your update. Please also update > > MdeModulePkg\Universal\BdsDxe\Bds.h to remove #include > > , because EDKII_VARIABLE_LOCK_PROTOCOL is > not used > > any more. > > > > Thanks > > Liming > >> -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > >> =E5=8F=91=E4=BB=B6=E4=BA=BA: kenlautner3@gmail.com > >> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B46=E6=9C=8817=E6=97= =A5 6:45 > >> =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io > >> =E6=8A=84=E9=80=81: Jian J Wang ; Hao A Wu > >> ; Zhichao Gao ; Ray Ni > >> ; Liming Gao > >> =E4=B8=BB=E9=A2=98: [PATCH v2 1/1] MdeModulePkg/BdsDxe: Update BdsEntr= y to use > >> Variable Policy > >> > >> From: Ken Lautner > >> > >> Changed BdsEntry.c to use Variable Policy instead of Variable Lock > >> as Variable Lock will be Deprecated eventually > >> > >> Cc: Jian J Wang > >> Cc: Hao A Wu > >> Cc: Zhichao Gao > >> Cc: Ray Ni > >> Cc: Liming Gao > >> Signed-off-by: Kenneth Lautner > >> > >> Reviewed-by Liming Gao > >> --- > >> MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 4 +++- > >> MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 20 > +++++++++++++++----- > >> 2 files changed, 18 insertions(+), 6 deletions(-) > >> > >> 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 > >> > >> @@ -77,7 +79,7 @@ > >> [Protocols] > >> > >> gEfiBdsArchProtocolGuid ## PRODUCES > >> > >> gEfiSimpleTextInputExProtocolGuid ## CONSUMES > >> > >> - gEdkiiVariableLockProtocolGuid ## > >> SOMETIMES_CONSUMES > >> > >> + gEdkiiVariablePolicyProtocolGuid ## > >> SOMETIMES_CONSUMES > >> > >> gEfiDeferredImageLoadProtocolGuid ## CONSUMES > >> > >> > >> > >> [FeaturePcd] > >> > >> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > >> b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > >> index 83b773a2fa5f..13c10bdc5bf8 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 > >> > >> > >> > >> #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_PROTOCOL *VariableLock; > >> > >> + EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy; > >> > >> UINTN Index; > >> > >> EFI_BOOT_MANAGER_LOAD_OPTION LoadOption; > >> > >> UINT16 *BootNext; > >> > >> @@ -716,12 +717,21 @@ BdsEntry ( > >> // > >> > >> // Mark the read-only variables if the Variable Lock protocol exis= ts > >> > >> // > >> > >> - Status =3D gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NU= LL, > >> (VOID **) &VariableLock); > >> > >> - DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - %r\n"= , > >> Status)); > >> > >> + Status =3D gBS->LocateProtocol(&gEdkiiVariablePolicyProtocolGuid, N= ULL, > >> (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= ++) > { > >> > >> - Status =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.31.1.windows.1 > > > > > > > > > >=20 > > > >