public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: Nhi Pham <nhi@os.amperecomputing.com>,
	Oliver Smith-Denny <osde@linux.microsoft.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	"ardb@kernel.org" <ardb@kernel.org>
Cc: "huangming@linux.alibaba.com" <huangming@linux.alibaba.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	Supreeth Venkatesh <supreeth.venkatesh@arm.com>,
	"ming.huang-@outlook.com" <ming.huang-@outlook.com>
Subject: Re: [edk2-devel] [PATCH v1 2/2] StandaloneMmPkg: Fix HOB space and heap space conflicted issue
Date: Fri, 1 Dec 2023 05:29:48 +0000	[thread overview]
Message-ID: <MN6PR11MB82444D92CB10D589302292D68C81A@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <048c809b-a825-4818-acea-7a2a2392b6a6@os.amperecomputing.com>

Yes please!

Thanks,
Ray
> -----Original Message-----
> From: Nhi Pham <nhi@os.amperecomputing.com>
> Sent: Thursday, November 30, 2023 9:59 PM
> To: Oliver Smith-Denny <osde@linux.microsoft.com>; devel@edk2.groups.io;
> ardb@kernel.org
> Cc: Ni, Ray <ray.ni@intel.com>; huangming@linux.alibaba.com; Sami Mujawar
> <sami.mujawar@arm.com>; Ard Biesheuvel <ardb+tianocore@kernel.org>;
> Yao, Jiewen <jiewen.yao@intel.com>; Supreeth Venkatesh
> <supreeth.venkatesh@arm.com>; ming.huang-@outlook.com
> Subject: Re: [edk2-devel] [PATCH v1 2/2] StandaloneMmPkg: Fix HOB space
> and heap space conflicted issue
> 
> On 9/7/2023 10:38 PM, Nhi Pham wrote:
> > On 9/6/2023 11:22 PM, Oliver Smith-Denny wrote:
> >> On 9/6/2023 1:50 AM, Ard Biesheuvel wrote:
> >>> On Wed, 6 Sept 2023 at 09:56, Nhi Pham
> >>> <nhi@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.
> > Thanks Oliver so much for that. I agree. We should focus on my specific
> > problem with UEFI Variable Flash Info in StandaloneMM in another thread.
> >>
> >> 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 again. The HOB library should be updated to remove the HOB
> > creation once we have the clarification.
> 
> I found that we can hook a platform NULL library class to the
> StandaloneMmCore to create UEFI Variable Flash Info HOB. This way is
> compliant to the spec as the HOB is created in MM_CORE_STANDALONE
> phase.
> 
> Should I write a patch to remove the HOB creation in StandaloneMmHobLib?
> 
> Regards,
> Nhi



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111969): https://edk2.groups.io/g/devel/message/111969
Mute This Topic: https://groups.io/mt/89020085/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-12-01  5:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 12:25 [PATCH v1 0/2] Fix StandaloneMmPkg HOB issue Ming Huang
2022-02-09 12:25 ` [PATCH v1 1/2] StandaloneMmPkg/Hob: Assert or return NULL for create hob failed Ming Huang
2022-02-09 12:25 ` [PATCH v1 2/2] StandaloneMmPkg: Fix HOB space and heap space conflicted issue Ming Huang
2022-05-03  9:10   ` Ard Biesheuvel
2022-05-12 10:09     ` [edk2-devel] " Ming Huang
2023-08-16  8:55       ` Nhi Pham via groups.io
2023-08-30 13:10         ` Ard Biesheuvel
2023-08-31  8:20           ` Nhi Pham via groups.io
2023-09-01 20:43             ` Oliver Smith-Denny
2023-09-05  2:20               ` Nhi Pham via groups.io
2023-09-05 21:29                 ` Oliver Smith-Denny
2023-09-06  6:33                   ` Ni, Ray
2023-09-06  6:56                     ` Ard Biesheuvel
2023-09-06  7:55                     ` Nhi Pham via groups.io
2023-09-06  8:50                       ` Ard Biesheuvel
2023-09-06 16:22                         ` Oliver Smith-Denny
2023-09-07 15:38                           ` Nhi Pham via groups.io
2023-11-30 13:59                             ` Nhi Pham via groups.io
2023-12-01  5:29                               ` Ni, Ray [this message]
2023-09-06  7:35                   ` Nhi Pham via groups.io
     [not found]       ` <177BD141FD103BE4.8497@groups.io>
2023-08-29  2:48         ` Nhi Pham via groups.io
2022-03-30  9:35 ` [PATCH v1 0/2] Fix StandaloneMmPkg HOB issue Ming Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN6PR11MB82444D92CB10D589302292D68C81A@MN6PR11MB8244.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox