Joel Kitching has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33551
Change subject: vboot: relocate call to vboot_save_recovery_reason_vbnv ......................................................................
vboot: relocate call to vboot_save_recovery_reason_vbnv
Relocate call to vboot_save_recovery_reason_vbnv and rename vb2_clear_recovery_reason_vbnv for consistency.
BUG=b:124141368, b:124192753 TEST=make clean && make test-abuild BRANCH=none
Change-Id: I111cc23cf3d4b16fdb058dd395ac17a97f23a53f Signed-off-by: Joel Kitching kitching@google.com --- M src/security/vboot/bootmode.c M src/security/vboot/vboot_loader.c M src/security/vboot/vboot_logic.c 3 files changed, 5 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/33551/1
diff --git a/src/security/vboot/bootmode.c b/src/security/vboot/bootmode.c index 4d4dc0d..4625bcd 100644 --- a/src/security/vboot/bootmode.c +++ b/src/security/vboot/bootmode.c @@ -43,7 +43,7 @@ set_recovery_mode_into_vbnv(reason); }
-static void vb2_clear_recovery_reason_vbnv(void *unused) +static void vboot_clear_recovery_reason_vbnv(void *unused) { if (!CONFIG(VBOOT_SAVE_RECOVERY_REASON_ON_REBOOT)) return; @@ -62,7 +62,7 @@ * only in FSP stages which run before BS_DEV_INIT. */ BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_EXIT, - vb2_clear_recovery_reason_vbnv, NULL); + vboot_clear_recovery_reason_vbnv, NULL);
/* * Returns 1 if vboot is being used and currently in a stage which might have diff --git a/src/security/vboot/vboot_loader.c b/src/security/vboot/vboot_loader.c index 9e2cd00..b205a38 100644 --- a/src/security/vboot/vboot_loader.c +++ b/src/security/vboot/vboot_loader.c @@ -44,7 +44,6 @@ /* Note: this path is not used for VBOOT_RETURN_FROM_VERSTAGE */ verstage_main(); car_set_var(vboot_executed, 1); - vboot_save_recovery_reason_vbnv(); } else if (verstage_should_load()) { struct cbfsf file; struct prog verstage = diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c index 62e033a..2468f5f 100644 --- a/src/security/vboot/vboot_logic.c +++ b/src/security/vboot/vboot_logic.c @@ -474,6 +474,9 @@ if (ENV_ROMSTAGE && CONFIG(VBOOT_STARTS_IN_ROMSTAGE)) vboot_log_and_clear_recovery_mode_switch(0);
+ /* Save recovery reason in case of unexpected reboots on x86. */ + vboot_save_recovery_reason_vbnv(); + vboot_finalize_work_context(&ctx); timestamp_add_now(TS_END_VBOOT); }