Attention is currently required from: Jason Glenesk, Marshall Dawson, Felix Held. Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/57068 )
Change subject: soc/amd/common/fsp/fsp_validate: check FSP-M binary size ......................................................................
Patch Set 2:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/57068/comment/79f66a55_ca52fe8c PS2, Line 13: SoCs can implement the soc_validate_fsp_version function : that ends up being called by the FSP driver in romstage to check the FSP : version, but since the image size is also present in the header we can : also implement and use this function to check if it fits into the : reserved region. I think it would be better to have a compile-time check to ensure that the build fails rather than having a bad firmware image. It should be possible to do this within soc/amd/common without impacting any other platforms.
``` # git grep -l FSP_M_SIZE src/soc/amd/cezanne/Kconfig src/soc/amd/cezanne/root_complex.c src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld src/soc/amd/picasso/Kconfig src/soc/amd/picasso/root_complex.c ```
Probably add a check in src/soc/amd/common/block/cpu/noncar/Makefile.inc which uses file-size macro which is already defined in top-level Makefile.inc to calculate size of FSP_M_FILE and compare that to FSP_M_SIZE.