Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50241 )
Change subject: drivers/intel/fsp2_0/memory_init: check if UPD struct has expected size ......................................................................
drivers/intel/fsp2_0/memory_init: check if UPD struct has expected size
If the UPD size in coreboot sizes mismatches the one from the FSP-M binary, call die(). We ran into the issue in soc/amd/cezanne, where the UPD struct in coreboot was smaller than the one in the FSP, so the defaults didn't get completely copied.
TEST=Mandolin still boots.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: Ia7e9f6f20d0091bbb4abfd42abb40b485da2079d --- M src/drivers/intel/fsp2_0/memory_init.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/41/50241/1
diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c index 92f3d9d..aba8447 100644 --- a/src/drivers/intel/fsp2_0/memory_init.c +++ b/src/drivers/intel/fsp2_0/memory_init.c @@ -239,6 +239,9 @@
upd = (FSPM_UPD *)(hdr->cfg_region_offset + hdr->image_base);
+ if (hdr->cfg_region_size != sizeof(FSPM_UPD)) + die("FSPM_UPD struct size doesn't match expected UPD size.\n"); + fsp_verify_upd_header_signature(upd->FspUpdHeader.Signature, FSPM_UPD_SIGNATURE);
/* Copy the default values from the UPD area */