Martin Roth has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/45964 )
Change subject: soc/amd/picasso: Die if the workbuf is missing two boots in a row ......................................................................
soc/amd/picasso: Die if the workbuf is missing two boots in a row
BUG=b:169199392 TEST=Corrupt vboot signature to force an error, see that the system halts instead of rebooting forever. BRANCH=Zork
Signed-off-by: Martin Roth martinroth@chromium.org Change-Id: I949f94e78d25720f6cd7e81de8d030084e267f29 --- M src/soc/amd/picasso/bootblock/bootblock.c 1 file changed, 9 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/45964/1
diff --git a/src/soc/amd/picasso/bootblock/bootblock.c b/src/soc/amd/picasso/bootblock/bootblock.c index 4700027..a8303f5 100644 --- a/src/soc/amd/picasso/bootblock/bootblock.c +++ b/src/soc/amd/picasso/bootblock/bootblock.c @@ -134,10 +134,17 @@
#if CONFIG(VBOOT_STARTS_BEFORE_BOOTBLOCK) if (*(uint32_t *)_vboot2_work != VB2_SHARED_DATA_MAGIC) { + /* + * If the system has already been rebooted once, but still returns here, + * instead of rebooting to verstage again, assume that the system is in + * a reboot loop, so halt instead. + */ + if ((!vbnv_cmos_failed()) && cmos_read(CMOS_RECOVERY_BYTE) == + CMOS_RECOVERY_MAGIC_VAL) + die("Error: Reboot into recovery was unsuccessful. Halting."); + printk(BIOS_ERR, "ERROR: VBOOT workbuf not valid.\n"); - printk(BIOS_DEBUG, "Signature: %#08x\n", *(uint32_t *)_vboot2_work); - cmos_init(0); cmos_write(CMOS_RECOVERY_MAGIC_VAL, CMOS_RECOVERY_BYTE); warm_reset();