[edk2-devel] [PATCH v1 2/2] StandaloneMmPkg: Fix HOB space and heap space conflicted issue

Oliver Smith-Denny osde at linux.microsoft.com
Wed Sep 6 16:22:39 UTC 2023


On 9/6/2023 1:50 AM, Ard Biesheuvel wrote:
> On Wed, 6 Sept 2023 at 09:56, Nhi Pham <nhi at amperemail.onmicrosoft.com> wrote:
>>
>> 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.
>>
> 
> The question here is whether the implementation follows the PI spec,
> and whether HOB creation should be supported to begin with.
> 

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


-=-=-=-=-=-=-=-=-=-=-=-
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/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list