From nobody Sun May 19 09:23:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+98842+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+98842+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1674093091; cv=none; d=zohomail.com; s=zohoarc; b=imbKtDwUyX9YAu9ubz8vpYAg7KU7jig699IeV3+/QIBbncRcXbcU89wkeFQN0w9Q2wX9pKRwU9GX+6jTx9jwz506FVocA0Tr4ECkk2Q74BC3nKzQwfTuZmjVZ5Vn+1frqrbUr4+bvcPnXUtGaHPZaKdfIcccPaBcHCMrKaVWqD0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674093091; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=YUY8w7jLtkwAwmLdmlo9CW+tOBIcc+Tw0YY37wL3Bos=; b=jgaWIQJ5q/kX4xxUj6tsrfWM5NMb/oyf9/5+zB5YOmRJowNIpGFQd94C+Ggsr4H5WnuhL7/kXrkHoraM71fgUkiuxZsqW1HScrihJ8O/HowYbUBmk+bTct/FvIHRc+TjodHvSqXmL+82dzzfLyvIg9mGu63lOTJuO8HkgkvkJb0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+98842+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1674093091064114.90174318034042; Wed, 18 Jan 2023 17:51:31 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id WPOzYY1788612xtScRcXxrff; Wed, 18 Jan 2023 17:51:30 -0800 X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.35930.1674093084732795787 for ; Wed, 18 Jan 2023 17:51:30 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="304846060" X-IronPort-AV: E=Sophos;i="5.97,226,1669104000"; d="scan'208";a="304846060" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 17:51:26 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="692238979" X-IronPort-AV: E=Sophos;i="5.97,226,1669104000"; d="scan'208";a="692238979" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.254.211.169]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 17:51:23 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Leif Lindholm , Ard Biesheuvel , Abner Chang , Daniel Schaefer , Gerd Hoffmann , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [edk2-devel] [PATCH V1 1/2] EmbeddedPkg: Rename FfsFindSectionData as FfsFindSectionDataWithHook Date: Thu, 19 Jan 2023 09:51:07 +0800 Message-Id: <20230119015108.1323-2-min.m.xu@intel.com> In-Reply-To: <20230119015108.1323-1-min.m.xu@intel.com> References: <20230119015108.1323-1-min.m.xu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,min.m.xu@intel.com X-Gm-Message-State: o8w5ihsa7d0UdO9r1zETNnq7x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1674093090; bh=D2sEOUo6Awx7CiBefK4QLx7Tn+EnMVItsBt6OSMZhuQ=; h=Cc:Date:From:Reply-To:Subject:To; b=vZUB2hsDLxAfjXDq0ehntkwPmXDf9duRzq5tR92bHu5KbMxCsU09R4lyI96vwGOubVG owqF1YVvtDlprPh+Y7rtwUczGnQfCOMPR0uBzQUprdsbdlZ/9s43MFN15VDIfjMoQbC5l iweLY7hIRNxxDwQ35HA3P/gO/voVGMF1d3w= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1674093092731100002 Content-Type: text/plain; charset="utf-8" From: Min M Xu Commit c673216f53 introduces FFS_CHECK_SECTION_HOOK and add it as the second input parameter in FfsFindSectionData. This change breaks the build of ArmVirtPkg. To fix this issue, the new version of FfsFindSectionData is renamed as FfsFindSectionDataWithHook in this patch. In the following patch the original FfsFindSectionData will be added back. FfsFindSectionData is renamed as FfsFindSectionDataWithHook. Accordingly PeilessStartupLib in OvmfPkg should be updated as well. To prevent the build from being broken, the changes in OvmfPkg are in this patch. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Abner Chang Cc: Daniel Schaefer Cc: Gerd Hoffmann Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Signed-off-by: Min Xu Acked-by: Gerd Hoffmann Reviewed-by: Jiewen Yao --- EmbeddedPkg/Include/Library/PrePiLib.h | 2 +- EmbeddedPkg/Library/PrePiLib/FwVol.c | 10 ++++++---- EmbeddedPkg/Library/PrePiLib/PrePiLib.c | 2 +- OvmfPkg/Library/PeilessStartupLib/DxeLoad.c | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/EmbeddedPkg/Include/Library/PrePiLib.h b/EmbeddedPkg/Include/L= ibrary/PrePiLib.h index f60b6678185a..0c259864d612 100644 --- a/EmbeddedPkg/Include/Library/PrePiLib.h +++ b/EmbeddedPkg/Include/Library/PrePiLib.h @@ -78,7 +78,7 @@ EFI_STATUS **/ EFI_STATUS EFIAPI -FfsFindSectionData ( +FfsFindSectionDataWithHook ( IN EFI_SECTION_TYPE SectionType, IN FFS_CHECK_SECTION_HOOK SectionCheckHook, IN EFI_PEI_FILE_HANDLE FileHandle, diff --git a/EmbeddedPkg/Library/PrePiLib/FwVol.c b/EmbeddedPkg/Library/Pre= PiLib/FwVol.c index 778d8b13c33b..85dbf5b0adb3 100644 --- a/EmbeddedPkg/Library/PrePiLib/FwVol.c +++ b/EmbeddedPkg/Library/PrePiLib/FwVol.c @@ -459,9 +459,11 @@ CheckNextSection: =20 /** This service enables discovery sections of a given type within a valid F= FS file. + Caller also can provide a SectionCheckHook to do additional checking. =20 - @param SearchType The value of the section type to find. - @param FfsFileHeader A pointer to the file header that contains= the set of sections to + @param SectionType The value of the section type to find. + @param SectionCheckHook A hook which can check if the section is t= he target one. + @param FileHandle A pointer to the file header that contains= the set of sections to be searched. @param SectionData A pointer to the discovered section, if su= ccessful. =20 @@ -471,7 +473,7 @@ CheckNextSection: **/ EFI_STATUS EFIAPI -FfsFindSectionData ( +FfsFindSectionDataWithHook ( IN EFI_SECTION_TYPE SectionType, IN FFS_CHECK_SECTION_HOOK SectionCheckHook, IN EFI_PEI_FILE_HANDLE FileHandle, @@ -817,7 +819,7 @@ FfsProcessFvFile ( // // Find FvImage in FvFile // - Status =3D FfsFindSectionData (EFI_SECTION_FIRMWARE_VOLUME_IMAGE, NULL, = FvFileHandle, (VOID **)&FvImageHandle); + Status =3D FfsFindSectionDataWithHook (EFI_SECTION_FIRMWARE_VOLUME_IMAGE= , NULL, FvFileHandle, (VOID **)&FvImageHandle); if (EFI_ERROR (Status)) { return Status; } diff --git a/EmbeddedPkg/Library/PrePiLib/PrePiLib.c b/EmbeddedPkg/Library/= PrePiLib/PrePiLib.c index 3b6fc4f0eba8..3cf866dab248 100644 --- a/EmbeddedPkg/Library/PrePiLib/PrePiLib.c +++ b/EmbeddedPkg/Library/PrePiLib/PrePiLib.c @@ -131,7 +131,7 @@ LoadDxeCoreFromFfsFile ( VOID *Hob; EFI_FV_FILE_INFO FvFileInfo; =20 - Status =3D FfsFindSectionData (EFI_SECTION_PE32, NULL, FileHandle, &PeCo= ffImage); + Status =3D FfsFindSectionDataWithHook (EFI_SECTION_PE32, NULL, FileHandl= e, &PeCoffImage); if (EFI_ERROR (Status)) { return Status; } diff --git a/OvmfPkg/Library/PeilessStartupLib/DxeLoad.c b/OvmfPkg/Library/= PeilessStartupLib/DxeLoad.c index 4b1fefd452dc..d34690eb8a0b 100644 --- a/OvmfPkg/Library/PeilessStartupLib/DxeLoad.c +++ b/OvmfPkg/Library/PeilessStartupLib/DxeLoad.c @@ -209,7 +209,7 @@ FindDxeNonCc ( // // Find FvImage in FvFile // - Status =3D FfsFindSectionData (EFI_SECTION_FIRMWARE_VOLUME_IMAGE, CheckS= ectionHookForDxeNonCc, FileHandle, (VOID **)&FvImageHandle); + Status =3D FfsFindSectionDataWithHook (EFI_SECTION_FIRMWARE_VOLUME_IMAGE= , CheckSectionHookForDxeNonCc, FileHandle, (VOID **)&FvImageHandle); if (EFI_ERROR (Status)) { return Status; } @@ -303,7 +303,7 @@ DxeLoadCore ( // // Load the DXE Core from a Firmware Volume. // - Status =3D FfsFindSectionData (EFI_SECTION_PE32, NULL, FileHandle, &PeCo= ffImage); + Status =3D FfsFindSectionDataWithHook (EFI_SECTION_PE32, NULL, FileHandl= e, &PeCoffImage); if (EFI_ERROR (Status)) { return Status; } --=20 2.29.2.windows.2 -=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 (#98842): https://edk2.groups.io/g/devel/message/98842 Mute This Topic: https://groups.io/mt/96369500/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 19 09:23:52 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+98843+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+98843+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1674093091; cv=none; d=zohomail.com; s=zohoarc; b=R5QKquq2Vsmw+HVBuxhfYZ98Hooia0nCwQ/L/CBD612Sf8yS719mQknVsOvTylW9M/XMXewEMYhibUr6V40vDjpMbToTtMrVz7giPXAFZ9vkuH4uiY3JwlFl7kSor7xhweglF/0QV8X7LSMs7XhVhz6eIMwLUOsHj8ZfvafI+OA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674093091; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=uo4bdFq6OPFOTNY+c6U67VVo1spGmJxYWs5euJ2RfhY=; b=gilvzj1wvrC5O5TQ9Prg+3qtY1sscnnm6/zgEiJUY0PK0R4viZRfQo9NWhzWRIgtR9cIYEUE6PcpTwarxAAw8IG5tvi61NmxfLXFgu3O4KkVi795sprrlPX1dpMA9deaemWQ9a0Aps5WcP0Qp1y+nPu/TyaiZzttGKd1h0MFuLA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+98843+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1674093091765255.09374105147208; Wed, 18 Jan 2023 17:51:31 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id DfFAYY1788612xTAXz8MBn7b; Wed, 18 Jan 2023 17:51:31 -0800 X-Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.35930.1674093084732795787 for ; Wed, 18 Jan 2023 17:51:30 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="304846069" X-IronPort-AV: E=Sophos;i="5.97,226,1669104000"; d="scan'208";a="304846069" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 17:51:30 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="692239006" X-IronPort-AV: E=Sophos;i="5.97,226,1669104000"; d="scan'208";a="692239006" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.254.211.169]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 17:51:26 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Leif Lindholm , Ard Biesheuvel , Abner Chang , Daniel Schaefer , Gerd Hoffmann , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [edk2-devel] [PATCH V1 2/2] EmbeddedPkg: Add back FfsFindSectionData Date: Thu, 19 Jan 2023 09:51:08 +0800 Message-Id: <20230119015108.1323-3-min.m.xu@intel.com> In-Reply-To: <20230119015108.1323-1-min.m.xu@intel.com> References: <20230119015108.1323-1-min.m.xu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,min.m.xu@intel.com X-Gm-Message-State: hDDYSgTJmmtIUuAxLCGTKURFx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1674093091; bh=w8wnIonw4fJMnTOxTBQEdGyFLVh3IhhVVZE+uWeblW4=; h=Cc:Date:From:Reply-To:Subject:To; b=w8vaCbxCkLdHER/1CoI8NlVoe3yF5XNDNGcg+2IChxTOANMqSjG/1zFR57T0ZhQCjrd LXgc+IcSAOO0xMgY4exTRTEf6gboOznHRPd4jlCGQX4V4sq4UDRTP5+NqNJU0cn4eaepV 3RrJWN1pYgM7nxY32rtmeM2jytEyaYEHqV0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1674093092729100001 Content-Type: text/plain; charset="utf-8" From: Min M Xu In commit c673216f53 a new input parameter is added in FfsFindSectionData. That change breaks the build of ArmVirtPkg. In this patch FfsFindSectionData is added back. It calls FfsFindSectionDataWithHook with a NULL hook. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Abner Chang Cc: Daniel Schaefer Cc: Gerd Hoffmann Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Signed-off-by: Min Xu Acked-by: Gerd Hoffmann Reviewed-by: Jiewen Yao --- EmbeddedPkg/Include/Library/PrePiLib.h | 20 ++++++++++++++++++++ EmbeddedPkg/Library/PrePiLib/FwVol.c | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/EmbeddedPkg/Include/Library/PrePiLib.h b/EmbeddedPkg/Include/L= ibrary/PrePiLib.h index 0c259864d612..93a9115eac2d 100644 --- a/EmbeddedPkg/Include/Library/PrePiLib.h +++ b/EmbeddedPkg/Include/Library/PrePiLib.h @@ -85,6 +85,26 @@ FfsFindSectionDataWithHook ( OUT VOID **SectionData ); =20 +/** + This service enables discovery sections of a given type within a valid F= FS file. + + @param SectionType The value of the section type to find. + @param FileHandle A pointer to the file header that contains= the set of sections to + be searched. + @param SectionData A pointer to the discovered section, if su= ccessful. + + @retval EFI_SUCCESS The section was found. + @retval EFI_NOT_FOUND The section was not found. + +**/ +EFI_STATUS +EFIAPI +FfsFindSectionData ( + IN EFI_SECTION_TYPE SectionType, + IN EFI_PEI_FILE_HANDLE FileHandle, + OUT VOID **SectionData + ); + /** Find a file in the volume by name =20 diff --git a/EmbeddedPkg/Library/PrePiLib/FwVol.c b/EmbeddedPkg/Library/Pre= PiLib/FwVol.c index 85dbf5b0adb3..7739a5c8aae7 100644 --- a/EmbeddedPkg/Library/PrePiLib/FwVol.c +++ b/EmbeddedPkg/Library/PrePiLib/FwVol.c @@ -504,6 +504,29 @@ FfsFindSectionDataWithHook ( ); } =20 +/** + This service enables discovery sections of a given type within a valid F= FS file. + + @param SectionType The value of the section type to find. + @param FileHandle A pointer to the file header that contains= the set of sections to + be searched. + @param SectionData A pointer to the discovered section, if su= ccessful. + + @retval EFI_SUCCESS The section was found. + @retval EFI_NOT_FOUND The section was not found. + +**/ +EFI_STATUS +EFIAPI +FfsFindSectionData ( + IN EFI_SECTION_TYPE SectionType, + IN EFI_PEI_FILE_HANDLE FileHandle, + OUT VOID **SectionData + ) +{ + return FfsFindSectionDataWithHook (SectionType, NULL, FileHandle, Sectio= nData); +} + /** This service enables discovery of additional firmware files. =20 --=20 2.29.2.windows.2 -=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 (#98843): https://edk2.groups.io/g/devel/message/98843 Mute This Topic: https://groups.io/mt/96369501/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-