> 
>  * Why do you want do it in PEI instead?  The cover letter claims this
>    improves boot performance.  I don't buy that.  You are not skipping
>    the relocation process, you are just doing it somewhere else.

I clarified why it can improves boot performance, it's not just do somewhere 
else, but also each cpus smbase can be programmed in parallel. See [PATCH v3 
3/5] UefiCpuPkg/PiSmmCpuDxeSmm: Consume SMM Base Hob for SmBase info:

"> With SMM Base Hob, PiSmmCpuDxeSmm does not need the RSM
> instruction to reload the SMBASE register with the new allocated
> SMBASE each time when it exits SMM. SMBASE Register for each

See existing code smm cpu driver implementation:  
        //
        // Hook return after RSM to set SMM re-based flag
        //
        SemaphoreHook (Index, &mRebased[Index]);

With above Semaphore hook, SMM CPU init for each processor must do one by one 
to avoid the CPUs over-writing each other's SMM Save State Area. As you 
mentioned, if system has thousands of cores, early smm init in parallel has the 
advantage over existing serial lines.   

> processors have already been programmed and all SMBASE address
> have recorded in SMM Base Hob. So the same default SMBASE Address
> (0x30000) will not be used, thus the CPUs over-writing each
> other's SMM Save State Area will not happen in PiSmmCpuDxeSmm
> driver. This way makes the first SMI init can be executed in
> parallel and save boot time on multi-core system."


>  * Where is the code?
See the design of existing function: SemaphoreHook (Index, &mRebased[Index]); 

>  * It is totally unclear whenever it is possible and/or useful to
>    initialize SMM that way on OVMF.
> 

Add the same handing logic code in OVMF is necessary to make sure it work. If 
someone produced such hob in OVMF platform, and OVMF also use the same Pi smm 
cpu driver, then it will be a problem. Changes in OVMF is make sure it runs 
into right way.

> take care,
>   Gerd



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


Reply via email to