From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=H1Csa9g7; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674093090; x=1705629090; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2LusXWHDJNII4FbtaQFcdVMNuoOB2awT4nB2I+xD880=; b=H1Csa9g7HTZAF7E5pHtFJZvfGmV/uAQuuae5z+ghtpgoayEaPAcFSr2p UIC3k2xWoo/XMhiRSvJJNwdwerulfLa67IZISYOJ7GmeZCJTifRX6HUpU UWUgMNiud+6zbXsNarr6ppJbhjKfyK/m24SML+qWmG/xj2wX4pyKDRTYr 6dA5yR5qUe/vte+/d9RrK+wn399XhZmd8OmUWU84jFZOS/yDEDfXnlkDc hm3U8tpuyFMcPpvEv6vA4DFlek8F4jYeLbojKR/xSDXU7eloTERm4bvh5 5VRFQw8eztCXERm0OWIvCsoQFpHbf7Hz21mBRr85D6ubbO+YkT//oQyeM Q==; 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" 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" 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: [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> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: <20230119015108.1323-1-min.m.xu@intel.com> References: <20230119015108.1323-1-min.m.xu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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/Library/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/PrePiLib/FwVol.c index 778d8b13c33b..85dbf5b0adb3 100644 --- a/EmbeddedPkg/Library/PrePiLib/FwVol.c +++ b/EmbeddedPkg/Library/PrePiLib/FwVol.c @@ -459,9 +459,11 @@ CheckNextSection: /** This service enables discovery sections of a given type within a valid FFS file. + Caller also can provide a SectionCheckHook to do additional checking. - @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 the 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 successful. @@ -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 = FfsFindSectionData (EFI_SECTION_FIRMWARE_VOLUME_IMAGE, NULL, FvFileHandle, (VOID **)&FvImageHandle); + Status = 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; - Status = FfsFindSectionData (EFI_SECTION_PE32, NULL, FileHandle, &PeCoffImage); + Status = FfsFindSectionDataWithHook (EFI_SECTION_PE32, NULL, FileHandle, &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 = FfsFindSectionData (EFI_SECTION_FIRMWARE_VOLUME_IMAGE, CheckSectionHookForDxeNonCc, FileHandle, (VOID **)&FvImageHandle); + Status = 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 = FfsFindSectionData (EFI_SECTION_PE32, NULL, FileHandle, &PeCoffImage); + Status = FfsFindSectionDataWithHook (EFI_SECTION_PE32, NULL, FileHandle, &PeCoffImage); if (EFI_ERROR (Status)) { return Status; } -- 2.29.2.windows.2