security/vboot: Drop assert call from vbnv_udc_enable_flag()

It's true that vbnv_udc_enable_flag() is called after vbnv_init()
(that's why the assertion was added). However, the former is called in
the ramstage, while the latter in verstage. This means that
vbnv_initialized will be false in ramstage, which leads
to the assertion failure:

[EMERG]  ASSERTION ERROR: file 'src/security/vboot/vbnv.c', line 88

Since the ctx->nvdata will be restored in ramstage (by vb2api_reinit()),
simply remove the assertion. So, the patch drops assert call from
vbnv_udc_enable_flag() function.

TEST=Verify Rex system boots to OS without assert error.

Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
Change-Id: I49022155239febd5c5be5cf2c5eca2019ca61c12
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71097
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
This commit is contained in:
Sridhar Siricilla 2022-12-19 15:05:59 +05:30 committed by Julius Werner
parent 4af3df35e5
commit d13a57915d
1 changed files with 0 additions and 5 deletions

View File

@ -82,11 +82,6 @@ void save_vbnv(const uint8_t *vbnv_copy)
int vbnv_udc_enable_flag(void)
{
struct vb2_context *ctx = vboot_get_context();
/* This function is expected to be called after temporary nvdata storage in vboot
context is initialized. */
assert(vbnv_initialized);
return (ctx->nvdata[DEV_FLAGS_OFFSET] & DEV_ENABLE_UDC) ? 1 : 0;
}