From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id E0591941A8F for ; Wed, 6 Mar 2024 14:08:01 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=jHrmiz2sYPJMfYrKECRp7MEyF3i9DP7gFxpWafXQows=; c=relaxed/simple; d=groups.io; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding:Content-Language; s=20240206; t=1709734080; v=1; b=QdumsbZq8fMLxfJECOxux6LOBnQpkuE1bRobpFAwd4ylm0sVQFaOMExZ+/6Fe1HtBVsbP5N6 lnlIhk974RT62FBdtghxtTYX7ir3TU9DeRIdHV9mjawcBqRaCa4lohEh2Or0uhkYczgh4jR4flz COYq6QYL36pWDIjB3PIKuMdQF6B7Dk2hKEZinZ9Q1F/AgYMi0U6a4JolrgPjkmNKVbiTbC10ykN 2qZHjgU7o9cpeO1uiluZNW/JgKv0oLqSkMeZSUMXt+0LcUmBRR5WrlNb5HXelCevUm9HcxpJEXQ 3gnKKyrrIp9fudPm24EJFgvytEMki8PwVRyVRGIq2UtPA== X-Received: by 127.0.0.2 with SMTP id mZiOYY7687511xqwLS4OuBgO; Wed, 06 Mar 2024 06:08:00 -0800 X-Received: from zrleap.intel-email.com (zrleap.intel-email.com [114.80.218.36]) by mx.groups.io with SMTP id smtpd.web11.12477.1709734079111658403 for ; Wed, 06 Mar 2024 06:08:00 -0800 X-Received: from zrleap.intel-email.com (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 719BDA32DFEA for ; Wed, 6 Mar 2024 22:07:55 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 5CDFAA32DFD2 for ; Wed, 6 Mar 2024 22:07:55 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by zrleap.intel-email.com (Postfix) with SMTP id 91144A32E047 for ; Wed, 6 Mar 2024 22:07:52 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([114.93.194.54]) (envelope-sender ) by 192.168.6.13 with ESMTP(SSL) for ; Wed, 06 Mar 2024 22:07:50 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 114.93.194.54 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming via groups.io" To: "'Pethaiyan Madhan'" , Cc: "'Michael D Kinney'" , "'Zhiguang Liu'" , "'Yi Li'" , "'GuoX Xu'" References: <2087d874d004f54bd5b14366e84e2b530da90f97.1709027111.git.madhan.pethaiyan@intel.com> In-Reply-To: <2087d874d004f54bd5b14366e84e2b530da90f97.1709027111.git.madhan.pethaiyan@intel.com> Subject: =?UTF-8?B?W2VkazItZGV2ZWxdIOWbnuWkjTogW1BBVENIIFY0XSBGbXBEZXZpY2VQa2c6IEdldEltYWdlSW5mbyBBZGQgbWlzc2luZyBjb25kaXRpb25z?= Date: Wed, 06 Mar 2024 06:08:00 -0800 Message-ID: <00e701da6fcf$add7ded0$09879c70$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQGbk3hVyHjnSdb4HEwirbSm8gwZELGoeGhQ Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3BpjQVmArpVasiNsB3nfiM4sx7686176AA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=QdumsbZq; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Liming Gao > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Pethaiyan Madhan > =B7=A2=CB=CD=CA=B1=BC=E4: 2024=C4=EA2=D4=C227=C8=D5 17:46 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: Pethaiyan Madhan ; Michael D Ki= nney > ; Liming Gao ; > Zhiguang Liu ; Yi Li ; GuoX Xu > > =D6=F7=CC=E2: [PATCH V4] FmpDevicePkg: GetImageInfo Add missing condition= s >=20 > 1.For EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImage(): > Add the following sentence at the end of the Image parameter > description. "May be NULL with a zero ImageSize in order to determine > the size of the buffer needed". >=20 > Modify the description of "EFI_INVALID_PARAMETER" return code as "The > ImageSize is not too small and Image is NULL." >=20 > 2.For EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImageInfo(): > Add the following sentence at the end of the ImageInfo parameter > description."May be NULL with a zero ImageInfoSize in order to > determine the size of the buffer needed". >=20 > Modify the description of "EFI_INVALID_PARAMETER" return code as "The > ImageInfoSize is not too small and Image is NULL." and add new > descriptions for "EFI_INVALID_PARAMETER" return code. >=20 > REF: UEFI spec v2.10 23.1.2 >=20 > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Yi Li > Cc: GuoX Xu > Signed-off-by: Pethaiyan Madhan > --- > FmpDevicePkg/FmpDxe/FmpDxe.c | 20 +++++++++++++++----- > FmpDevicePkg/FmpDxe/FmpDxe.h | 15 ++++++++++++--- > 2 files changed, 27 insertions(+), 8 deletions(-) >=20 > diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c > b/FmpDevicePkg/FmpDxe/FmpDxe.c > index 1e7ec4a09e..1d580c9f69 100644 > --- a/FmpDevicePkg/FmpDxe/FmpDxe.c > +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c > @@ -43,7 +43,7 @@ const FIRMWARE_MANAGEMENT_PRIVATE_DATA > mFirmwareManagementPrivateDataTemplate =3D > FIRMWARE_MANAGEMENT_PRIVATE_DATA_SIGNATURE, // Signature > NULL, // Handle > { // Fmp > - GetTheImageInfo, > + GetImageInfo, > GetTheImage, > SetTheImage, > CheckTheImage, > @@ -417,6 +417,8 @@ PopulateDescriptor ( > to contain the image(s) > information if the buffer was too small. > @param[in, out] ImageInfo A pointer to the buffer in which > firmware places the current image(s) > information. The information > is an array of EFI_FIRMWARE_IMAGE_DESCRIPTORs. > + May be NULL with a zero > ImageInfoSize in order to determine the size of the > + buffer needed. > @param[out] DescriptorVersion A pointer to the location in which > firmware returns the version number > associated with the > EFI_FIRMWARE_IMAGE_DESCRIPTOR. > @param[out] DescriptorCount A pointer to the location in > which firmware returns the number of > @@ -437,13 +439,18 @@ PopulateDescriptor ( > @retval EFI_SUCCESS The device was successfully > updated with the new image. > @retval EFI_BUFFER_TOO_SMALL The ImageInfo buffer was too > small. The current buffer size > needed to hold the image(s) > information is returned in ImageInfoSize. > - @retval EFI_INVALID_PARAMETER ImageInfoSize is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is not too small > and ImageInfo is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is non-zero and > DescriptorVersion is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is non-zero and > DescriptorCount is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is non-zero and > DescriptorSize is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is non-zero and > PackageVersion is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is non-zero and > PackageVersionName is NULL. > @retval EFI_DEVICE_ERROR Valid information could not be > returned. Possible corrupted image. >=20 > **/ > EFI_STATUS > EFIAPI > -GetTheImageInfo ( > +GetImageInfo ( > IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, > IN OUT UINTN *ImageInfoSize, > IN OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo, > @@ -495,7 +502,7 @@ GetTheImageInfo ( > // Confirm that buffer isn't null > // > if ( (ImageInfo =3D=3D NULL) || (DescriptorVersion =3D=3D NULL) || > (DescriptorCount =3D=3D NULL) || (DescriptorSize =3D=3D NULL) > - || (PackageVersion =3D=3D NULL)) > + || (PackageVersion =3D=3D NULL) || (PackageVersionName =3D=3D NULL)= ) > { > DEBUG ((DEBUG_ERROR, "FmpDxe(%s): GetImageInfo() - Pointer > Parameter is NULL.\n", mImageIdName)); > Status =3D EFI_INVALID_PARAMETER; > @@ -544,6 +551,9 @@ cleanup: > @param[in] ImageIndex A unique number identifying the > firmware image(s) within the device. > The number is between 1 and > DescriptorCount. > @param[in, out] Image Points to the buffer where the current > image is copied to. > + May be NULL with a zero > ImageSize in order to determine the size of the > + buffer needed. > + > @param[in, out] ImageSize On entry, points to the size of the > buffer pointed to by Image, in bytes. > On return, points to the length of > the image, in bytes. >=20 > @@ -551,7 +561,7 @@ cleanup: > @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is > too small to hold the > image. The current buffer size > needed to hold the image is returned > in ImageSize. > - @retval EFI_INVALID_PARAMETER The Image was NULL. > + @retval EFI_INVALID_PARAMETER The ImageSize is not too small and > Image is NULL > @retval EFI_NOT_FOUND The current image is not copied to > the buffer. > @retval EFI_UNSUPPORTED The operation is not supported. > @retval EFI_SECURITY_VIOLATION The operation could not be performed > due to an authentication failure. > diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.h > b/FmpDevicePkg/FmpDxe/FmpDxe.h > index 7baf730e69..d2ade143bd 100644 > --- a/FmpDevicePkg/FmpDxe/FmpDxe.h > +++ b/FmpDevicePkg/FmpDxe/FmpDxe.h > @@ -114,6 +114,8 @@ DetectTestKey ( > to contain the image(s) > information if the buffer was too small. > @param[in, out] ImageInfo A pointer to the buffer in which > firmware places the current image(s) > information. The information > is an array of EFI_FIRMWARE_IMAGE_DESCRIPTORs. > + May be NULL with a zero > ImageInfoSize in order to determine the size of the > + buffer needed. > @param[out] DescriptorVersion A pointer to the location in which > firmware returns the version number > associated with the > EFI_FIRMWARE_IMAGE_DESCRIPTOR. > @param[out] DescriptorCount A pointer to the location in > which firmware returns the number of > @@ -134,13 +136,18 @@ DetectTestKey ( > @retval EFI_SUCCESS The device was successfully > updated with the new image. > @retval EFI_BUFFER_TOO_SMALL The ImageInfo buffer was too > small. The current buffer size > needed to hold the image(s) > information is returned in ImageInfoSize. > - @retval EFI_INVALID_PARAMETER ImageInfoSize is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is not too small > and ImageInfo is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is non-zero and > DescriptorVersion is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is non-zero and > DescriptorCount is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is non-zero and > DescriptorSize is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is non-zero and > PackageVersion is NULL. > + @retval EFI_INVALID_PARAMETER ImageInfoSize is non-zero and > PackageVersionName is NULL. > @retval EFI_DEVICE_ERROR Valid information could not be > returned. Possible corrupted image. >=20 > **/ > EFI_STATUS > EFIAPI > -GetTheImageInfo ( > +GetImageInfo ( > IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This, > IN OUT UINTN *ImageInfoSize, > IN OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo, > @@ -161,6 +168,8 @@ GetTheImageInfo ( > @param[in] ImageIndex A unique number identifying the > firmware image(s) within the device. > The number is between 1 and > DescriptorCount. > @param[in, out] Image Points to the buffer where the current > image is copied to. > + May be NULL with a zero > ImageSize in order to determine the size of the > + buffer needed. > @param[in, out] ImageSize On entry, points to the size of the > buffer pointed to by Image, in bytes. > On return, points to the length of > the image, in bytes. >=20 > @@ -168,7 +177,7 @@ GetTheImageInfo ( > @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is > too small to hold the > image. The current buffer size > needed to hold the image is returned > in ImageSize. > - @retval EFI_INVALID_PARAMETER The Image was NULL. > + @retval EFI_INVALID_PARAMETER The ImageSize is not too small and > Image is NULL > @retval EFI_NOT_FOUND The current image is not copied to > the buffer. > @retval EFI_UNSUPPORTED The operation is not supported. > @retval EFI_SECURITY_VIOLATION The operation could not be performed > due to an authentication failure. > -- > 2.38.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116438): https://edk2.groups.io/g/devel/message/116438 Mute This Topic: https://groups.io/mt/104765996/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-