Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34972 )
Change subject: lib/bootblock: Add simplified entry with basetime ......................................................................
Patch Set 3:
(3 comments)
https://review.coreboot.org/c/coreboot/+/34972/3//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/34972/3//COMMIT_MSG@11 PS3, Line 11: with calls to timestamp_add() gets removed from bootblock. Are you sure this works that way (did you check the assembly output)? I don't think the compiler will do this because you still have two external functions (main() and bootblock_main_with_basetime()) call a relatively large static function (bootblock_main_with_timestamp()), so the compiler should output it as a separate function rather than duplicating the code to inline it in both callers. We know that one of those two callers will always be garbage collected by the linker, but the compiler doesn't know that at the time it processes that compilation unit in isolation. (Maybe LTO could solve this but we're not using that AFAIK.)
I think just moving all the timestamp handling out of the shared static function into the callers would be the easiest solution (only one of them still needs the whole loop anyway, for the others it's just one timestamp_init() call).
https://review.coreboot.org/c/coreboot/+/34972/3/src/include/bootblock_commo... File src/include/bootblock_common.h:
https://review.coreboot.org/c/coreboot/+/34972/3/src/include/bootblock_commo... PS3, Line 49: #if 0 Remove rather than #if 0?
https://review.coreboot.org/c/coreboot/+/34972/3/src/lib/bootblock.c File src/lib/bootblock.c:
https://review.coreboot.org/c/coreboot/+/34972/3/src/lib/bootblock.c@68 PS3, Line 68: void main(void)
I could not figure this out.. […]
This is for normal (non-decompressor) non-x86 builds. For example src/arch/arm64/armv8/bootblock.S calls this from _start. _start is in assembly and this is the C entry point.
Builds with decompressor don't use this (they compile it but it will be GC'ed), they use _start() below.