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.21801.1604971719031001879 for ; Mon, 09 Nov 2020 17:28:40 -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 ; Tue, 10 Nov 2020 09:28:36 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , "'Xu, Wei6'" , , "'Kinney, Michael D'" , "'Jiang, Guomin'" References: <1645B1531363BCC0.9654@groups.io> In-Reply-To: <1645B1531363BCC0.9654@groups.io> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIHYxIDEvMV0gRm1wRGV2aWNlUGtnL0ZtcER4ZTogQ2FsbCBGbXBEZXZpY2VMaWIgV2l0aFN0YXR1cygpIGZ1bmN0aW9ucw==?= Date: Tue, 10 Nov 2020 09:28:36 +0800 Message-ID: <008001d6b700$cf834d20$6e89e760$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQG+wvebnnfv02WugxsiGZ+X+IiQBQIaO4CeAeGRsUECx1HC5am6YqiQ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Create PR https://github.com/tianocore/edk2/pull/1103 for this patch.=20 > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: bounce+27952+67127+4905953+8761045@groups.i= o > =E4=BB=A3=E8=A1=A8 gaolim= ing > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2020=E5=B9=B411=E6=9C=889=E6=97=A5= 9:03 > =E6=94=B6=E4=BB=B6=E4=BA=BA: 'Xu, Wei6' ; devel@edk2.= groups.io; > michael.kubacki@outlook.com; 'Kinney, Michael D' > ; 'Jiang, Guomin' > =E4=B8=BB=E9=A2=98: =E5=9B=9E=E5=A4=8D: [edk2-devel] [PATCH v1 1/1] FmpD= evicePkg/FmpDxe: Call > FmpDeviceLib WithStatus() functions >=20 > Acked-by: Liming Gao >=20 > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > =E5=8F=91=E4=BB=B6=E4=BA=BA: Xu, Wei6 > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2020=E5=B9=B411=E6=9C=886=E6=97= =A5 13:15 > > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; michael.kubacki@out= look.com; Liming > Gao > > ; Kinney, Michael D > > ; Jiang, Guomin > > =E4=B8=BB=E9=A2=98: RE: [edk2-devel] [PATCH v1 1/1] FmpDevicePkg/FmpDx= e: Call > > FmpDeviceLib WithStatus() functions > > > > This patch is good to me. > > Reviewed-by: Wei6 Xu > > > > BR, > > Wei > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Michael > > Kubacki > > Sent: Friday, November 6, 2020 11:16 AM > > To: devel@edk2.groups.io; Liming Gao ; > Kinney, > > Michael D ; Jiang, Guomin > > ; Xu, Wei6 > > Subject: Re: [edk2-devel] [PATCH v1 1/1] FmpDevicePkg/FmpDxe: Call > > FmpDeviceLib WithStatus() functions > > > > Hi FmpDevicePkg maintainers, > > > > Please let me know your feedback on this patch. Note that it is requir= ed to > > complete the Last Attempt Status support already merged in the followi= ng > > patch series: > > https://edk2.groups.io/g/devel/message/66418 > > > > Thanks, > > Michael > > > > On 10/30/2020 2:12 PM, michael.kubacki@outlook.com wrote: > > > From: Michael Kubacki > > > > > > Commit 6ad819c introduced two new functions in FmpDeviceLib: > > > 1. FmpDeviceCheckImageWithStatus () > > > 2. FmpDeviceSetImageWithStatus () > > > > > > These functions allow an FmpDeviceLib implementation to return a Las= t > > > Attempt Status code value within the Device Library range from > > > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE to > > > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE. > > > > > > To maintain backward compatibility, commit 6ad819c did not update th= e > > > FmpDxe driver to invoke these functions. FmpDeviceLib instances shou= ld > > > update their FmpDeviceCheckImage () function to simply call > > > FmpDeviceCheckImageWithStatus (). Similarly, FmpDeviceSetImage () > > > should simply call FmpDeviceSetImageWithStatus (). This is > > > demonstrated in the implementation of these functions in > > > FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLib.c. By doing so, > the > > > library can remain compatible with FmpDxe implementations before and > > > after this transition. > > > > > > This commit updates FmpDxe to call the WithStatus () version of thes= e > > > functions enabling the Last Attempt Status code returned to be > > > accessible to FmpDxe. > > > > > > Cc: Liming Gao > > > Cc: Michael D Kinney > > > Cc: Guomin Jiang > > > Cc: Wei6 Xu > > > Signed-off-by: Michael Kubacki > > > --- > > > FmpDevicePkg/FmpDxe/FmpDxe.c | 40 ++++++++++++++++++-- > > > 1 file changed, 36 insertions(+), 4 deletions(-) > > > > > > diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c > > > b/FmpDevicePkg/FmpDxe/FmpDxe.c index de7f1fe53e32..6b0675ea38f8 > > 100644 > > > --- a/FmpDevicePkg/FmpDxe/FmpDxe.c > > > +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c > > > @@ -1025,9 +1025,24 @@ CheckTheImageInternal ( > > > // > > > // FmpDeviceLib CheckImage function to do any specific checks > > > // > > > - Status =3D FmpDeviceCheckImage ((((UINT8 *)Image) + AllHeaderSize= ), > > > RawSize, ImageUpdatable); > > > + Status =3D FmpDeviceCheckImageWithStatus ((((UINT8 *) Image) + > > > + AllHeaderSize), RawSize, ImageUpdatable, LastAttemptStatus); > > > if (EFI_ERROR (Status)) { > > > DEBUG ((DEBUG_ERROR, "FmpDxe(%s): CheckTheImage() - > > FmpDeviceLib > > > CheckImage failed. Status =3D %r\n", mImageIdName, Status)); > > > + > > > + // > > > + // LastAttemptStatus returned from the device library should fa= ll > > within the designated error range > > > + // > > [LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE, > > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE] > > > + // > > > + if ((*LastAttemptStatus < > > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE) || > > > + (*LastAttemptStatus > > > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE)) { > > > + DEBUG ( > > > + (DEBUG_ERROR, > > > + "FmpDxe(%s): CheckTheImage() - LastAttemptStatus %d from > > FmpDeviceCheckImageWithStatus() is invalid.\n", > > > + mImageIdName, > > > + *LastAttemptStatus) > > > + ); > > > + *LastAttemptStatus =3D > > LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL; > > > + } > > > } > > > > > > cleanup: > > > @@ -1353,16 +1368,33 @@ SetTheImage ( > > > // > > > //Copy the requested image to the firmware using the FmpDeviceLi= b > > > // > > > - Status =3D FmpDeviceSetImage ( > > > - (((UINT8 *)Image) + AllHeaderSize), > > > + Status =3D FmpDeviceSetImageWithStatus ( > > > + (((UINT8 *) Image) + AllHeaderSize), > > > ImageSize - AllHeaderSize, > > > VendorCode, > > > FmpDxeProgress, > > > IncomingFwVersion, > > > - AbortReason > > > + AbortReason, > > > + &LastAttemptStatus > > > ); > > > if (EFI_ERROR (Status)) { > > > DEBUG ((DEBUG_ERROR, "FmpDxe(%s): SetTheImage() SetImage > > from > > > FmpDeviceLib failed. Status =3D %r.\n", mImageIdName, Status)); > > > + > > > + // > > > + // LastAttemptStatus returned from the device library should fa= ll > > within the designated error range > > > + // > > [LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE, > > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE] > > > + // > > > + if ((LastAttemptStatus < > > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MIN_ERROR_CODE_VALUE) || > > > + (LastAttemptStatus > > > LAST_ATTEMPT_STATUS_DEVICE_LIBRARY_MAX_ERROR_CODE_VALUE)) { > > > + DEBUG ( > > > + (DEBUG_ERROR, > > > + "FmpDxe(%s): SetTheImage() - LastAttemptStatus %d from > > FmpDeviceSetImageWithStatus() is invalid.\n", > > > + mImageIdName, > > > + LastAttemptStatus) > > > + ); > > > + LastAttemptStatus =3D > > LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL; > > > + } > > > + > > > goto cleanup; > > > } > > > > > > > > > > > > > > >=20 >=20 >=20 >=20 >=20 >=20 >=20