summaryrefslogtreecommitdiff
path: root/src/security/vboot/common.c
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2019-11-20 19:47:10 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-11-29 09:05:04 +0000
commit344e86bb3baff8f89c1335c190dbee050176e058 (patch)
tree31d3d610d0cd1b5bad9f96d8513f896b3c949404 /src/security/vboot/common.c
parent7255610d9fe0867de50add6890653f14da676c06 (diff)
downloadcoreboot-344e86bb3baff8f89c1335c190dbee050176e058.tar.xz
security/vboot: Drop CAR_GLOBAL_MIGRATION support
Change-Id: I9dee03da028b9111b685e325368815a86e444a47 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37028 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/security/vboot/common.c')
-rw-r--r--src/security/vboot/common.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/security/vboot/common.c b/src/security/vboot/common.c
index bad01ff57f..290fa5e231 100644
--- a/src/security/vboot/common.c
+++ b/src/security/vboot/common.c
@@ -25,7 +25,7 @@
#include <security/vboot/symbols.h>
#include <security/vboot/vboot_common.h>
-static struct vb2_context *vboot_ctx CAR_GLOBAL;
+static struct vb2_context *vboot_ctx;
struct vboot_working_data *vboot_get_working_data(void)
{
@@ -50,20 +50,19 @@ static inline void *vboot_get_workbuf(struct vboot_working_data *wd)
struct vb2_context *vboot_get_context(void)
{
- struct vb2_context **vboot_ctx_ptr = car_get_var_ptr(&vboot_ctx);
struct vboot_working_data *wd;
/* Return if context has already been initialized/restored. */
- if (*vboot_ctx_ptr)
- return *vboot_ctx_ptr;
+ if (vboot_ctx)
+ return vboot_ctx;
wd = vboot_get_working_data();
/* Restore context from a previous stage. */
if (vboot_logic_executed()) {
assert(vb2api_reinit(vboot_get_workbuf(wd),
- vboot_ctx_ptr) == VB2_SUCCESS);
- return *vboot_ctx_ptr;
+ &vboot_ctx) == VB2_SUCCESS);
+ return vboot_ctx;
}
assert(verification_should_run());
@@ -78,10 +77,10 @@ struct vb2_context *vboot_get_context(void)
/* Initialize vb2_shared_data and friends. */
assert(vb2api_init(vboot_get_workbuf(wd),
VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE -
- wd->buffer_offset,
- vboot_ctx_ptr) == VB2_SUCCESS);
+ wd->buffer_offset,
+ &vboot_ctx) == VB2_SUCCESS);
- return *vboot_ctx_ptr;
+ return vboot_ctx;
}
int vboot_locate_firmware(const struct vb2_context *ctx,
@@ -116,7 +115,7 @@ static void vboot_migrate_cbmem(int unused)
vb2api_relocate(vboot_get_workbuf(wd_cbmem),
vboot_get_workbuf(wd_preram),
cbmem_size - wd_cbmem->buffer_offset,
- car_get_var_ptr(&vboot_ctx));
+ &vboot_ctx);
}
ROMSTAGE_CBMEM_INIT_HOOK(vboot_migrate_cbmem)
#else