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.3168.1635471988900429052 for ; Thu, 28 Oct 2021 18:46:29 -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 ; Fri, 29 Oct 2021 09:46:22 +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: "'Bob Morgan'" , Cc: "'Jian J Wang'" , "'Guomin Jiang'" References: <40287570ea45e6e5724c00657a7f9ef99f8693d0.1634587878.git.bobm@nvidia.com> In-Reply-To: <40287570ea45e6e5724c00657a7f9ef99f8693d0.1634587878.git.bobm@nvidia.com> Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0hdIE1kZU1vZHVsZVBrZy9EeGVDYXBzdWxlTGliRm1wOiBDYXBzdWxlIG9uIERpc2sgZmlsZSBuYW1lIGNhcHN1bGU=?= Date: Fri, 29 Oct 2021 09:46:26 +0800 Message-ID: <00a501d7cc66$c954fe40$5bfefac0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQGGhiWuXw4gGWhJoUZ4QD1z1Fz0EqyLwRjg Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Bob: =20 > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Bob Morgan > =B7=A2=CB=CD=CA=B1=BC=E4: 2021=C4=EA10=D4=C219=C8=D5 4:12 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Bob Morgan ; Jian J Wang > ; Liming Gao ; Guomin > Jiang > =D6=F7=CC=E2: [PATCH] MdeModulePkg/DxeCapsuleLibFmp: Capsule on Disk = file name > capsule >=20 > Enhance RelocateCapsuleToRam() to skip creation of the Capsule on Disk > file name capsule if PcdSupportUpdateCapsuleReset feature is not = enabled. > This avoids an EFI_UNSUPPORTED return status from UpdateCapsule() when > the > file name capsule is encountered and PcdSupportUpdateCapsuleReset is > FALSE. >=20 > Cc: Jian J Wang > Cc: Liming Gao > Cc: Guomin Jiang > Signed-off-by: Bob Morgan > --- > .../Library/DxeCapsuleLibFmp/CapsuleOnDisk.c | 19 > ++++++++++++++++--- > 1 file changed, 16 insertions(+), 3 deletions(-) >=20 > diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c > b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c > index 4c32c6cdcf..e65e335585 100644 > --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c > +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c > @@ -1739,6 +1739,7 @@ RelocateCapsuleToRam ( > UINT8 *StringBuf; > UINTN StringSize; > UINTN TotalStringSize; > + UINTN CapsulesToProcess; >=20 > CapsuleOnDiskBuf =3D NULL; > BlockDescriptors =3D NULL; > @@ -1778,6 +1779,13 @@ RelocateCapsuleToRam ( > TotalStringSize +=3D StrSize > (CapsuleOnDiskBuf[Index].FileInfo->FileName); > } >=20 > + // If Persist Across Reset isn't supported, skip the file name = strings capsule > + if (!FeaturePcdGet (PcdSupportUpdateCapsuleReset)) { > + CapsulesToProcess =3D CapsuleOnDiskNum; > + goto BuildSg; > + } > + CapsulesToProcess =3D CapsuleOnDiskNum + 1; > + > FileNameCapsule =3D AllocateZeroPool (sizeof (EFI_CAPSULE_HEADER) + > TotalStringSize); > if (FileNameCapsule =3D=3D NULL) { > DEBUG ((DEBUG_ERROR, "Fail to allocate memory for name > capsule.\n")); > @@ -1804,18 +1812,23 @@ RelocateCapsuleToRam ( > // > // 3. Build Gather list for the capsules > // > - Status =3D BuildGatherList (CapsuleBuffer, CapsuleSize, = CapsuleOnDiskNum + > 1, &BlockDescriptors); > +BuildSg: What does 'BuildSg' mean?=20 Thanks Liming > + Status =3D BuildGatherList (CapsuleBuffer, CapsuleSize, CapsulesToProcess, > &BlockDescriptors); > if (EFI_ERROR (Status) || BlockDescriptors =3D=3D NULL) { > FreePool (CapsuleBuffer); > FreePool (CapsuleSize); > - FreePool (FileNameCapsule); > + if (FileNameCapsule !=3D NULL) { > + FreePool (FileNameCapsule); > + } > return EFI_OUT_OF_RESOURCES; > } >=20 > // > // 4. Call UpdateCapsule() service > // > - Status =3D gRT->UpdateCapsule((EFI_CAPSULE_HEADER **) = CapsuleBuffer, > CapsuleOnDiskNum + 1, (UINTN) BlockDescriptors); > + Status =3D gRT->UpdateCapsule ((EFI_CAPSULE_HEADER **) = CapsuleBuffer, > + CapsulesToProcess, > + (UINTN) BlockDescriptors); >=20 > return Status; > } > -- > 2.17.1