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 0FC147803D2 for ; Tue, 5 Sep 2023 21:29:54 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=aVRivv3XzV3McyUcYGv6XtzJZGFW99pESuqopYNowY8=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:Message-ID:Date:MIME-Version:User-Agent: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=1693949393; v=1; b=EeDIfn6WaUThA9SixprNY1qHg9W0kzVDhXbHTKD6Jw/hlEk8LLnA5OKYj2RhM5TBJqUMOF5F qLfZ6kWSYTqRlA6ww05TXFS2kVQmxwbhAiCcruCEq0Zplb+5dG+5emU/ojKSFb3InhDo1kzyrJi HKipxxMi78qTc1wMvpA50PzA= X-Received: by 127.0.0.2 with SMTP id fqseYY7687511xoFY18gFRd1; Tue, 05 Sep 2023 14:29:53 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.34701.1693949392863489492 for ; Tue, 05 Sep 2023 14:29:52 -0700 X-Received: from [10.137.194.171] (unknown [131.107.1.171]) by linux.microsoft.com (Postfix) with ESMTPSA id BF9BA212B183; Tue, 5 Sep 2023 14:29:51 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BF9BA212B183 Message-ID: <59c604a4-7e65-4319-8441-806a29327f6f@linux.microsoft.com> Date: Tue, 5 Sep 2023 14:29:51 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v1 2/2] StandaloneMmPkg: Fix HOB space and heap space conflicted issue To: Nhi Pham , devel@edk2.groups.io, nhi@os.amperecomputing.com, Ard Biesheuvel Cc: huangming@linux.alibaba.com, Sami Mujawar , Ard Biesheuvel , Jiewen Yao , Supreeth Venkatesh , ming.huang-@outlook.com References: <20220209122558.60329-1-huangming@linux.alibaba.com> <20220209122558.60329-3-huangming@linux.alibaba.com> <14f25a95-7153-4eec-8804-a3da768ccb11@linux.alibaba.com> <0e0bc14c-88a1-21a8-0be7-34ed023e1127@amperemail.onmicrosoft.com> From: "Oliver Smith-Denny" In-Reply-To: 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,osde@linux.microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: EdslTLkSQza2HSD3rjW7Ux2Ex7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed 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=EeDIfn6W; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=linux.microsoft.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 9/4/2023 7:20 PM, Nhi Pham wrote: > On 9/2/2023 3:43 AM, Oliver Smith-Denny wrote: >> On 8/31/2023 1:20 AM, Nhi Pham via groups.io wrote: >> >> If I am understanding this correctly, this is only an issue when >> HOBs are created in StMM, i.e. not from HOBs that are passed in. Is this >> correct? > Yes, the issue only occurs when HOB are created in StandaloneMM by the=20 > HOB library instance=20 > StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf >> >> If so, is HOB creation in StMM and supported use case? The only instance > I think it is intended to work as the CreateHob() function is implemented= . Well, that may just be a copy/paste sort of thing :). >> a quick search turns up is the ARM StMM Core entry, where some >> information from TF-A is converted to HOB format. Do we have any other >> use cases (and curious more on this use case). My thought process would >> be that StMM would not create any HOBs. Depending on FW configuration, >> it may receive HOBs from PEI. >=20 > I have a use case when enabling the UEFI Variable driver running in=20 > StandaloneMM. Instead of using the PCDs, the in-memory NVRAM region is=20 > allocated **dynamically** at boot time in the StMM secure memory. Then,= =20 > they will be passed into the gVariableFlashInfoHobGuid for being=20 > consumed by other variable MM drivers. >=20 I do believe that per the PI spec, we should have HOB producer and HOB consumer phases, where in this case PEI (if it was the launching entity for StMM) is the HOB producer and StMM is the HOB producer. This is the same pattern the PI spec details for PEI and DXE, where DXE is not intended to create new HOBs, but just to consume information from the previous phase. As I mentioned, there are other interfaces for passing information within a phase, such as protocols, dynamic PCDs, variables, etc. that are built for this application. I think it is useful to adhere to the model for HOBs (which are hand off blocks, one phase handing information to another phase) and that we will create more issues if we rely on HOB consumer phases producing HOBs. My proposal would be to remove the HOB creation code from StMM completely. I believe in your use case that you are describing a dynamic PCD or a protocol could work to pass the information. If we are saying that prior to your patch that HOB creation in StMM was completely broken, anyway, it seems that folks were not relying on this code? Thanks, Oliver -=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 (#108293): https://edk2.groups.io/g/devel/message/108293 Mute This Topic: https://groups.io/mt/89020085/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-