Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37231 )
Change subject: security/vboot: Remove struct vboot_working_data ......................................................................
Patch Set 2:
(2 comments)
https://review.coreboot.org/c/coreboot/+/37231/2/src/security/vboot/common.c File src/security/vboot/common.c:
https://review.coreboot.org/c/coreboot/+/37231/2/src/security/vboot/common.c... PS2, Line 85: #if CONFIG(VBOOT_STARTS_IN_BOOTBLOCK) I think we could now just rewrite this whole section as
static void vboot_setup_cbmem(int unused) { const size_t cbmem_size = VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE; void *wb_cbmem = cbmem_add(CBMEM_ID_VBOOT_WORKBUF, cbmem_size); assert(wb_cbmem != NULL);
if CONFIG(VBOOT_STARTS_IN_BOOTBLOCK) assert(vb2api_relocate(wb_cbmem, _vboot2_work, cbmem_size, car_get_var_ptr(&vboot_ctx)) == VB2_SUCCESS); } ROMSTAGE_CBMEM_INIT_HOOK(vboot_setup_cbmem)
which is neater than two wholly separate functions.
https://review.coreboot.org/c/coreboot/+/37231/2/src/security/vboot/common.c... PS2, Line 98: vb2api_relocate(wb_cbmem, wb_preram, cbmem_size, (Which also reminds me, we probably want to check the return value here...)