On Wed, Jun 08, 2022 at 12:06:28AM +0000, Xu, Min M wrote:
> On June 7, 2022 6:46 PM, Gerd Hoffmann wrote:
> > On Mon, Jun 06, 2022 at 10:59:55AM +0800, Min Xu wrote:
> > > From: Min M Xu <min.m...@intel.com>
> > >
> > > RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3937
> > >
> > > Lazy accept page can be controlled in build time like below:
> > >   -D LAZY_ACCEPT_PARTIAL_MEM=512
> > >
> > > The unit is MB. If it is 0 then it means Lazy-accept is turned off.
> > >
> > > Lazy-accept is turned off by default in OvmfPkgX64.
> > > Lazy-accept is turned on with 512MB by default in IntelTdxX64.
> > 
> > Care to explain?  What is the point in not using lazy accept in OvmfPkgX64?

> It's an Open to the community that if lazy accept should be enabled in
> OvmfPkgX64. I would like to hear the suggestions/comments from you
> guys. So as the first step, it is disabled.

I think OvmfPkgX64 and IntelTdxX64 configuration should be identical,
and I'm wondering whenever this should be a compile time option in the
first place.  Can we simply use lazy accept unconditionally?

With the edk2 memory management code being able to handle unaccepted
memory I just don't see the point in supporting different options in
early firmware setup.  I think sec/pei should accept the memory needed
to run dxe and not more.  Anything beyond that can be accepted later on
demand via TdxDxe.

> > Also what exactly does this option mean?  Is this the minimum amount of
> > memory accepted by the firmware?

> Yes, this option defines the minimum amount of memory accepted by the
> firmware. For example, if it is 512MB, then there will be such amount
> memory accepted by the firmware before jump to OS.

Where does the 512MB figure come from?

Using a fixed amount of memory doesn't look very robust to me.  Is it
possible to accept memory when the guest calls ExitBootServices?  That
way we could guarantee a minimum amount of *free* accepted memory being
available, to make sure the linux kernel has enough memory to decompress
itself, allocate memory management data structures and get its own lazy
accept support going.

For guests which don't support lazy accept we could offer a (runtime)
option to simply accept all memory in ExitBootServices.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90324): https://edk2.groups.io/g/devel/message/90324
Mute This Topic: https://groups.io/mt/91570202/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to