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 A129B740034 for ; Wed, 8 Nov 2023 20:15:49 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=QvtKCU8ngXG/t81tU8Cd7bqsaO2EiC+VaS2sCYN7DpU=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699474548; v=1; b=loCzOWZS+VgRIc/srbiAI/IbFGcQGSGYlo4wD6Yy9tUId6bje5vwKCFnBealmmYJf4m0xxVP 8KmzC/HbGZQs00tuSjTNQCtQMt/aXWA6Pn8oIfMpz/EEtYG/k85pKWD4ULyKvYUYjMWX9snj+cc zd4VvYO/CGu5sFZ+aQj62WeA= X-Received: by 127.0.0.2 with SMTP id RjVmYY7687511xhmTDRVmnYr; Wed, 08 Nov 2023 12:15:48 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.25252.1699474547694402064 for ; Wed, 08 Nov 2023 12:15:47 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-504-cFZdvaSaN-COH2AcV9YHZQ-1; Wed, 08 Nov 2023 15:15:43 -0500 X-MC-Unique: cFZdvaSaN-COH2AcV9YHZQ-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4CACA811E7E; Wed, 8 Nov 2023 20:15:43 +0000 (UTC) X-Received: from [10.39.192.41] (unknown [10.39.192.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7A2BC15983; Wed, 8 Nov 2023 20:15:41 +0000 (UTC) Message-ID: <3666a807-636a-838e-7a57-1077aaab617b@redhat.com> Date: Wed, 8 Nov 2023 21:15:40 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v4 4/4] StandaloneMmPkg/Core: Fix the failure to find uncompressed inner FV To: devel@edk2.groups.io, wei6.xu@intel.com Cc: Ard Biesheuvel , Sami Mujawar , Ray Ni References: From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: lKaGCRixeobmwQxlYRJl7Xnnx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 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=loCzOWZS; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.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 On 11/6/23 08:52, Xu, Wei6 wrote: > 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. >=20 > Cc: Laszlo Ersek > Cc: Ard Biesheuvel > Cc: Sami Mujawar > Cc: Ray Ni > Signed-off-by: Wei6 Xu > --- > StandaloneMmPkg/Core/FwVol.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) >=20 > diff --git a/StandaloneMmPkg/Core/FwVol.c b/StandaloneMmPkg/Core/FwVol.c > index 4d2b63a448e7..07500cee41f3 100644 > --- a/StandaloneMmPkg/Core/FwVol.c > +++ b/StandaloneMmPkg/Core/FwVol.c > @@ -79,6 +79,8 @@ MmCoreFfsFindMmDriver ( > UINTN DepexSize; > UINTN Index; > EFI_COMMON_SECTION_HEADER *Section; > + VOID *SectionData; > + UINTN SectionDataSize; > UINT32 DstBufferSize; > VOID *ScratchBuffer; > UINT32 ScratchBufferSize; > @@ -115,6 +117,26 @@ MmCoreFfsFindMmDriver ( > break; > } > =20 > + // > + // Check uncompressed firmware volumes > + // > + Status =3D FfsFindSectionData ( > + EFI_SECTION_FIRMWARE_VOLUME_IMAGE, > + FileHeader, > + &SectionData, > + &SectionDataSize > + ); > + if (!EFI_ERROR (Status)) { > + if (SectionDataSize > sizeof (EFI_FIRMWARE_VOLUME_HEADER)) { > + InnerFvHeader =3D (EFI_FIRMWARE_VOLUME_HEADER *)SectionData; > + MmCoreFfsFindMmDriver (InnerFvHeader, Depth + 1); > + continue; > + } > + } > + > + // > + // Check compressed firmware volumes > + // > Status =3D FfsFindSection ( > EFI_SECTION_GUID_DEFINED, > FileHeader, Reviewed-by: Laszlo Ersek -=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 (#110924): https://edk2.groups.io/g/devel/message/110924 Mute This Topic: https://groups.io/mt/102416011/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-