On Thu, Oct 14, 2021 at 12:55:22AM +0000, Xu, Min M wrote:
> On October 12, 2021 6:39 PM, Gerd Hoffmann wrote:
> >   Hi,
> > 
> > >  - AcceptPages:
> > >    To mitigate the performance impact of accepting pages in SEC phase on
> > >    BSP, BSP will parse memory resources and assign each AP the task of
> > >    accepting a subset of pages. This command may be called several times
> > >    until all memory resources are processed. In accepting pages, PageLevel
> > >    may fall back to smaller one if SIZE_MISMATCH error is returned.
> > 
> > Hmm, I'm wondering whenever it is useful to have this in the first place 
> > with
> > the longer-term plan to implement lazy on-demand acceptance.
> To mitigate the performance impact of accepting pages, there are 3 ways.
> 1. Big accept page size.
> 2. Accept the pages by BSP and APs together.
> 3. Lazy on-demand acceptance.
> From the perspective of implementation complexity, 1 < 2 < 3.

> Lazy on-demand acceptance need the update not only in TDVF, but also
> in Guest kernel. More investigation shows it also impacts the grub and
> memory management in EDK2.

Yes.

> From the perspective of performance improvement, 2M accept page size +
> BSP/AP together, can improve the performance a lot. 

Yes.

The question is whenever that has to happen in the SEC phase though,
especially considering that we want get rid of that longer-term with
the switch to lazy acceptance.

You have patches to setup MpLib for Tdx.  So it should be possible to
use MpLib to distribute the acceptance jobs to the APs in PEI or DXE
phase instead.  Advantages:

  * You don't need large chunks of assembler code for the APs to
    handle acceptance.
  * The AP boot can be simplified, you can just let them spin until
    the BSP initialized MpLib.
  * You can continue to use the MpLib-based parallel acceptance code
    when switching over to lazy on-demand acceptance later on.

The BSP would still need to accept some memory in SEC (enough to reach
PEI or DXE), but that shouldn't be very much.

take care,
  Gerd



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


Reply via email to