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 27BF9AC0D7A for ; Mon, 30 Oct 2023 07:49:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=tyCrjETsrh7P5tGNjLOG1Eaitvz1UwcsCe8xzXx/deU=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1698652178; v=1; b=OhkMvJ3LFnP9s23a/T7u17/WOaDQhCRKAU1u5ev5mxVLO1HEDUD+8n6Da9YaJ6JzWWDvZUno 8amYa4Nszasc5aJd8hJNaM/+238H8xBwk8LDc2OZdkKVtVo8EZ2vZAO26KNX1T+bz/NOIKsJcqC tl4q9eEo0vxn4DDDzoc4RwP4= X-Received: by 127.0.0.2 with SMTP id 0GL1YY7687511xxdzMPh4nKJ; Mon, 30 Oct 2023 00:49:38 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.143793.1698652164261209974 for ; Mon, 30 Oct 2023 00:49:38 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10878"; a="419138592" X-IronPort-AV: E=Sophos;i="6.03,263,1694761200"; d="scan'208";a="419138592" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2023 00:49:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10878"; a="736666797" X-IronPort-AV: E=Sophos;i="6.03,263,1694761200"; d="scan'208";a="736666797" X-Received: from shpfwdbuild003.ccr.corp.intel.com ([10.239.56.82]) by orsmga006.jf.intel.com with ESMTP; 30 Oct 2023 00:49:36 -0700 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Wei6 Xu , Laszlo Ersek , Ard Biesheuvel , Sami Mujawar , Ray Ni Subject: [edk2-devel] [PATCH v3 4/4] StandaloneMmPkg/Core: Fix the failure to find uncompressed inner FV Date: Mon, 30 Oct 2023 15:49:18 +0800 Message-Id: <0936c14a0495947f318724e50169b4161cae7c72.1698651605.git.wei6.xu@intel.com> In-Reply-To: References: MIME-Version: 1.0 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,wei6.xu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: BBuQYtgMmc7G6ATGxq3MgsNbx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=OhkMvJ3L; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io The MmCoreFfsFindMmDriver only checks for encapsulated compressed FVs. When an inner FV is uncompressed, StandaloneMmCore will miss the FV and all the MM drivers in the FV will not be dispatched. Add checks for uncompressed inner FV to fix this issue. Cc: Laszlo Ersek Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Ray Ni Signed-off-by: Wei6 Xu --- StandaloneMmPkg/Core/FwVol.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/StandaloneMmPkg/Core/FwVol.c b/StandaloneMmPkg/Core/FwVol.c index fa335d62c252..783dbaf9b048 100644 --- a/StandaloneMmPkg/Core/FwVol.c +++ b/StandaloneMmPkg/Core/FwVol.c @@ -116,6 +116,25 @@ MmCoreFfsFindMmDriver ( break;=0D }=0D =0D + //=0D + // Check uncompressed firmware volumes=0D + //=0D + Status =3D FfsFindSectionData (=0D + EFI_SECTION_FIRMWARE_VOLUME_IMAGE,=0D + FileHeader,=0D + &SectionData,=0D + &SectionDataSize=0D + );=0D + if (!EFI_ERROR (Status)) {=0D + if (SectionDataSize > sizeof (EFI_FIRMWARE_VOLUME_HEADER)) {=0D + InnerFvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *)SectionData;=0D + MmCoreFfsFindMmDriver (InnerFvHeader, Depth + 1);=0D + }=0D + }=0D +=0D + //=0D + // Check compressed firmware volumes=0D + //=0D Status =3D FfsFindSection (=0D EFI_SECTION_GUID_DEFINED,=0D FileHeader,=0D --=20 2.29.2.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#110300): https://edk2.groups.io/g/devel/message/110300 Mute This Topic: https://groups.io/mt/102270549/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-