Attention is currently required from: Aaron Durbin. Tim Wawrzynczak has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56673 )
Change subject: security/vboot: Initialize CMOS before attempting backup ......................................................................
security/vboot: Initialize CMOS before attempting backup
On an x86 board, in the case of a persistent early recovery request, where the RTC has failed, and the flash VBNV region is also invalid, RTC_BATTERY_DEAD is cleared now (by earlier patchsets), so in this flow, the CMOS will not get reinitialized. This patch fixes that by performing the initialization in the vbnv_cmos driver.
BUG=b:181678769
Change-Id: I711457a3ed5c22ec51ebd5fe7f05400da17d1b11 Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/security/vboot/vbnv_cmos.c 1 file changed, 5 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/73/56673/1
diff --git a/src/security/vboot/vbnv_cmos.c b/src/security/vboot/vbnv_cmos.c index 35e4c41..f1a13ef 100644 --- a/src/security/vboot/vbnv_cmos.c +++ b/src/security/vboot/vbnv_cmos.c @@ -71,9 +71,13 @@ { /* If no CMOS failure just defer to the normal read path for checking vbnv contents' integrity. */ - if (!vbnv_cmos_failed()) + const int failed = vbnv_cmos_failed(); + if (!failed) return;
+ /* Re-initialize CMOS contents first */ + cmos_init(failed); + /* In the case of CMOS failure force the backup. If backup wasn't used force the vbnv CMOS to be reset. */ if (!restore_from_backup(vbnv_copy)) {