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.web11.2563.1624323772661876971 for ; Mon, 21 Jun 2021 18:02:53 -0700 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 ; Tue, 22 Jun 2021 09:02:51 +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: , Cc: "'Jian J Wang'" , "'Hao A Wu'" , "'Zhichao Gao'" , "'Ray Ni'" References: <20210621195954.852-1-kenlautner3@gmail.com> In-Reply-To: <20210621195954.852-1-kenlautner3@gmail.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHYxIDEvMV0gTWRlTW9kdWxlUGtnL0Jkc0R4ZTogVXBkYXRlIEJkc0VudHJ5IHRvIHVzZSBWYXJpYWJsZSBQb2xpY3k=?= Date: Tue, 22 Jun 2021 09:02:51 +0800 Message-ID: <00c401d76702$53a385a0$faea90e0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJ8PUSx3YxthP5J5mn+6O+F5u9WMqnVigtw Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Reviewed-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io = =B4=FA=B1=ED Kenneth > Lautner > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA6=D4=C222=C8=D5 4:00 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Jian J Wang ; Hao A Wu > ; Zhichao Gao ; Ray Ni > ; Liming Gao > =D6=F7=CC=E2: [edk2-devel] [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 Variable Lock will be Deprecated eventually >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Zhichao Gao > Cc: Ray Ni > Cc: Liming Gao >=20 > Signed-off-by: Kenneth Lautner > Reviewed-by: Liming Gao > --- > MdeModulePkg/Universal/BdsDxe/Bds.h | 1 - > MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 3 ++- > MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 20 +++++++++++++++----- > 3 files changed, 17 insertions(+), 7 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/BdsDxe/Bds.h > b/MdeModulePkg/Universal/BdsDxe/Bds.h > index e7a9b5b4b7cb..84548041e861 100644 > --- a/MdeModulePkg/Universal/BdsDxe/Bds.h > +++ b/MdeModulePkg/Universal/BdsDxe/Bds.h > @@ -17,7 +17,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 > #include >=20 > #include >=20 > -#include >=20 > #include >=20 >=20 >=20 > #include >=20 > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > index 9310b4dccb18..5bac635def93 100644 > --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > @@ -50,6 +50,7 @@ > BaseMemoryLib >=20 > DebugLib >=20 > UefiBootManagerLib >=20 > + VariablePolicyHelperLib >=20 > PlatformBootManagerLib >=20 > PcdLib >=20 > PrintLib >=20 > @@ -77,7 +78,7 @@ > [Protocols] >=20 > gEfiBdsArchProtocolGuid ## PRODUCES >=20 > gEfiSimpleTextInputExProtocolGuid ## CONSUMES >=20 > - gEdkiiVariableLockProtocolGuid ## > SOMETIMES_CONSUMES >=20 > + gEdkiiVariablePolicyProtocolGuid ## > SOMETIMES_CONSUMES >=20 > gEfiDeferredImageLoadProtocolGuid ## CONSUMES >=20 >=20 >=20 > [FeaturePcd] >=20 > 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" >=20 > #include "Language.h" >=20 > #include "HwErrRecSupport.h" >=20 > +#include >=20 >=20 >=20 > #define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) { \ >=20 > (a) =3D ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) << > LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT)) & > EFI_BOOT_OPTION_SUPPORT_COUNT); \ >=20 > @@ -670,7 +671,7 @@ BdsEntry ( > EFI_STATUS Status; >=20 > UINT32 BootOptionSupport; >=20 > UINT16 BootTimeOut; >=20 > - EDKII_VARIABLE_LOCK_PROTOCOL *VariableLock; >=20 > + EDKII_VARIABLE_POLICY_PROTOCOL *VariablePolicy; >=20 > UINTN Index; >=20 > EFI_BOOT_MANAGER_LOAD_OPTION LoadOption; >=20 > UINT16 *BootNext; >=20 > @@ -716,12 +717,21 @@ BdsEntry ( > // >=20 > // Mark the read-only variables if the Variable Lock protocol = exists >=20 > // >=20 > - Status =3D gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, = NULL, > (VOID **) &VariableLock); >=20 > - DEBUG ((EFI_D_INFO, "[BdsDxe] Locate Variable Lock protocol - = %r\n", > Status)); >=20 > + Status =3D gBS->LocateProtocol(&gEdkiiVariablePolicyProtocolGuid, = NULL, > (VOID**)&VariablePolicy); >=20 > + DEBUG((DEBUG_INFO, "[BdsDxe] Locate Variable Policy protocol - = %r\n", > Status)); >=20 > if (!EFI_ERROR (Status)) { >=20 > for (Index =3D 0; Index < ARRAY_SIZE (mReadOnlyVariables); = Index++) { >=20 > - Status =3D VariableLock->RequestToLock (VariableLock, > mReadOnlyVariables[Index], &gEfiGlobalVariableGuid); >=20 > - ASSERT_EFI_ERROR (Status); >=20 > + Status =3D RegisterBasicVariablePolicy( >=20 > + VariablePolicy, >=20 > + &gEfiGlobalVariableGuid, >=20 > + mReadOnlyVariables[Index], >=20 > + VARIABLE_POLICY_NO_MIN_SIZE, >=20 > + VARIABLE_POLICY_NO_MAX_SIZE, >=20 > + VARIABLE_POLICY_NO_MUST_ATTR, >=20 > + VARIABLE_POLICY_NO_CANT_ATTR, >=20 > + VARIABLE_POLICY_TYPE_LOCK_NOW >=20 > + ); >=20 > + ASSERT_EFI_ERROR(Status); >=20 > } >=20 > } >=20 >=20 >=20 > -- > 2.31.1.windows.1 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#76813): = https://edk2.groups.io/g/devel/message/76813 > Mute This Topic: https://groups.io/mt/83697951/4905953 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [gaoliming@byosoft.com.cn] > -=3D-=3D-=3D-=3D-=3D-=3D >=20