Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/37838 )
Change subject: cbfs: Do not use vboot_locator in bootblock with separate verstage ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/37838/1/src/lib/cbfs.c File src/lib/cbfs.c:
https://review.coreboot.org/c/coreboot/+/37838/1/src/lib/cbfs.c@305 PS1, Line 305: #if CONFIG(VBOOT) && !(ENV_BOOTBLOCK && CONFIG(VBOOT_SEPARATE_VERSTAGE)) If you are using VBOOT_RETURN_FROM_VERSTAGE then this change is incorrect as you need to steer correctly through vboot_locator for loading romstage. It might make more sense to have a quick bail out in vboot_locate() for the condition you care about. It won't save the full 1KiB, but it should basically be the size of the cbfs_locator object plus a a few instructions.
What does the following look like?
diff --git a/src/security/vboot/vboot_loader.c b/src/security/vboot/vboot_loader.c index b72c82ba4a..477995ec00 100644 --- a/src/security/vboot/vboot_loader.c +++ b/src/security/vboot/vboot_loader.c @@ -74,6 +74,11 @@ static int vboot_locate(struct region_device *rdev) { struct vb2_context *ctx;
+ /* Don't carry the steering logic when verstage is separate. Bootblock + * will just chainload verstage and never return back to bootblock. */ + if (verstage_should_load() && !CONFIG(VBOOT_RETURN_FROM_VERSTAGE)) + return -1; + /* Don't honor vboot results until the vboot logic has run. */ if (!vboot_logic_executed()) return -1;