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 61D6A74003E for ; Wed, 6 Sep 2023 16:22:42 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7dut/XVZlGeD87DtmLgd/r/qDukB5vgFD1tGKz//w2M=; 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=1694017361; v=1; b=NhFFiw5aIXS+/EPLoyp/oCu1gv93t+7jdl4MDfWdZPSkKN6TWoFpF80iNuSmRx7e2mFjDmoB NvykFoDtbrz/KKS+gfwMcIfRcdQhm1sz7R/ETaVR/8eZFYKc/y5avrbUrlmAdzJQoUf8etQ86L8 GSdIc4r4etpFKtTcDMzwTQPI= X-Received: by 127.0.0.2 with SMTP id 4zhMYY7687511xjOb6822crl; Wed, 06 Sep 2023 09:22:41 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.3149.1694017360637634322 for ; Wed, 06 Sep 2023 09:22:40 -0700 X-Received: from [10.137.194.171] (unknown [131.107.1.171]) by linux.microsoft.com (Postfix) with ESMTPSA id 0FB43212B194; Wed, 6 Sep 2023 09:22:40 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0FB43212B194 Message-ID: <2654664c-63c1-41e2-b2d4-2946a7963afd@linux.microsoft.com> Date: Wed, 6 Sep 2023 09:22:39 -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: devel@edk2.groups.io, ardb@kernel.org, Nhi Pham Cc: "Ni, Ray" , "nhi@os.amperecomputing.com" , "huangming@linux.alibaba.com" , Sami Mujawar , Ard Biesheuvel , "Yao, Jiewen" , 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> <59c604a4-7e65-4319-8441-806a29327f6f@linux.microsoft.com> <2485a946-3cab-9b9e-feb9-47084074c35c@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: pZ2ObXYfsKi3aron2wLkBnzbx7686176AA= 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=NhFFiw5a; 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/6/2023 1:50 AM, Ard Biesheuvel wrote: > On Wed, 6 Sept 2023 at 09:56, Nhi Pham w= rote: >> >> On 9/6/2023 1:33 PM, Ni, Ray wrote: >>> [EXTERNAL EMAIL NOTICE: This email originated from an external sender. >>> Please be mindful of safe email handling and proprietary information >>> protection practices.] >>> >>> I am a bit confused. >>> >>> The HOB list in standalone MM is read-only. Why could any module call >>> BuildGuidHob() to modify the HOB. >>> >>> I saw Oliver mentioned something about StMM. I don't know what that is. >>> But it seems that's ARM specific. Then, I don't think it's proper to >>> modify code here for a specific arch ARM. >> >> The HOB creation is available in the >> StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf. If >> other architectures also use that instance, I think the issue is not >> specific to ARM. >> >=20 > The question here is whether the implementation follows the PI spec, > and whether HOB creation should be supported to begin with. >=20 My reading of the PI spec is that this implementation does not follow it. However, the PI spec is not very explicit about Standalone MM in general, but particularly in relation to HOBs. However, in the generic HOB section of PI spec v1.7, Vol. 3, section 4 (entitled HOB Design Discussion) it explicitly lays out that there are HOB producer phases and HOB consumer phases. It uses PEI as a HOB producer phase and DXE as a HOB consumer phase and explicitly says that the HOB consumer phase must treat HOBs as read-only memory, per Ray's comment. In vol. 4, section 2.2, in discussing the Standalone MM entry point, the document talks about the HOB list being passed to Standalone MM to consume, which per the reading of the above section would classify Standalone MM as a HOB consumer phase, where HOBs should then be read-only. So, I believe that we should not support HOB creation in Standalone MM and instead rely on other mechanisms to pass information within the phase. Per Nhi's other email in this thread, we should have the discussion on how to solve that specific problem and that may well lead to a discussion on whether HOBs are in fact the right mechanism here, but I tend to lean towards leaving something as architectural as HOBs to what the PI spec defines and using different mechanisms to accomplish in-phase communication. Does this reading of the spec align with others' expectations? As I mentioned to Ray in another thread, Standalone MM feels like it could have extra clarification in a few areas in the PI spec. 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 (#108333): https://edk2.groups.io/g/devel/message/108333 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-