aboutsummaryrefslogtreecommitdiff
path: root/src/security/vboot/common.c
diff options
context:
space:
mode:
authorMartin Roth <martin@coreboot.org>2020-05-04 10:13:45 -0600
committerMartin Roth <martinroth@google.com>2020-06-15 21:04:00 +0000
commit8a3a3c820b8f8a8d357bf54fb7532ad1ae1ba270 (patch)
tree1e3c8c2c30753118a16eba2d0f3afc25bc74d836 /src/security/vboot/common.c
parent61ba7fb2d9ecd2cfd64dda0618d544e4429fee8e (diff)
security/vboot: Add option to run verstage before bootblock
For AMD's family 17h, verstage can run as a userspace app in the PSP before the X86 is released. The flags for this have been made generic to support any other future systems that might run verstage before the main processor starts. Although an attempt has been made to make things somewhat generic, since this is the first and currently only chip to support verstage before bootblock, there are a number of options which might ultimately be needed which have currently been left out for simplicity. Examples of this are: - PCI is not currently supported - this is currently just a given instead of making a separate Kconfig option for it. - The PSP uses an ARM v7 processor, so that's the only processor that is getting updated for the verstage-before-bootblock option. BUG=b:158124527 TEST=Build with following patches Signed-off-by: Martin Roth <martin@coreboot.org> Change-Id: I4849777cb7ba9f90fe8428b82c21884d1e662b96 Reviewed-on: https://review.coreboot.org/c/coreboot/+/41814 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/security/vboot/common.c')
-rw-r--r--src/security/vboot/common.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/security/vboot/common.c b/src/security/vboot/common.c
index db51fa13b8..0121f56e8c 100644
--- a/src/security/vboot/common.c
+++ b/src/security/vboot/common.c
@@ -18,8 +18,7 @@ static void *vboot_get_workbuf(void)
if (cbmem_possibly_online())
wb = cbmem_find(CBMEM_ID_VBOOT_WORKBUF);
- if (wb == NULL && CONFIG(VBOOT_STARTS_IN_BOOTBLOCK) &&
- preram_symbols_available())
+ if (wb == NULL && !CONFIG(VBOOT_STARTS_IN_ROMSTAGE) && preram_symbols_available())
wb = _vboot2_work;
assert(wb != NULL);
@@ -76,6 +75,11 @@ static void vboot_setup_cbmem(int unused)
void *wb_cbmem = cbmem_add(CBMEM_ID_VBOOT_WORKBUF, cbmem_size);
assert(wb_cbmem != NULL);
/*
+ * On platforms where VBOOT_STARTS_BEFORE_BOOTBLOCK, the verification
+ * occurs before the main processor starts running. The vboot data-
+ * structure is available in the _vboot2_work memory area as soon
+ * as the main processor is released.
+ *
* For platforms where VBOOT_STARTS_IN_BOOTBLOCK, vboot verification
* occurs before CBMEM is brought online, using pre-RAM. In order to
* make vboot data structures available downstream, copy vboot workbuf
@@ -85,7 +89,7 @@ static void vboot_setup_cbmem(int unused)
* after CBMEM is brought online. Directly initialize vboot data
* structures in CBMEM, which will also be available downstream.
*/
- if (CONFIG(VBOOT_STARTS_IN_BOOTBLOCK))
+ if (!CONFIG(VBOOT_STARTS_IN_ROMSTAGE))
rv = vb2api_relocate(wb_cbmem, _vboot2_work, cbmem_size,
&vboot_ctx);
else