Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31489 )
Change subject: [WIP] soc/amd/common: Use static allocation for params ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/#/c/31489/5/src/soc/amd/common/block/pi/agesawra... File src/soc/amd/common/block/pi/agesawrapper.c:
https://review.coreboot.org/#/c/31489/5/src/soc/amd/common/block/pi/agesawra... PS5, Line 425: : : : : : : :
This section of code is needed, otherwise aip->AllocationMethod will always be ByHost and cause con […]
The point of this entire commit is that the lifetime of the parameter struct is the duration of the execution of the state, we release the struct before we return from agesa_execute_state().
As for agesa internals, ByHost means the artifact will not be allocated fro the heap at all. There is one argument that would justify allocating it from the heap; the size of the struct involved. It would be faster to have these on stack or .bss, I don't know if we can use latter due to SMP aspects.