Frans Hendriks has uploaded this change for review.

View Change

lib/prog_loaders.c: Add prog_locate_hook() for measured and verified boot.

Before images are loaded from cbfs it needs to be measured and/or verified.
prog_locate_hook() is added and can be used to start measured/verified boot.

BUG=N/A
TEST=Created verified binary and verify logging on Facebook FBG-1701

Change-Id: I12207fc8f2e9ca45d048cf8c8d9c057f53e5c2c7
Signed-off-by: Frans Hendriks <fhendriks@eltan.com>
---
M src/include/program_loading.h
M src/lib/prog_loaders.c
2 files changed, 7 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/30811/1
diff --git a/src/include/program_loading.h b/src/include/program_loading.h
index 468f0b3..a382daf 100644
--- a/src/include/program_loading.h
+++ b/src/include/program_loading.h
@@ -3,6 +3,7 @@
*
* Copyright 2015 Google Inc.
* Copyright (C) 2014 Imagination Technologies
+ * Copyright (C) 2018 Eltan B.V.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -136,6 +137,7 @@

/* Locate the identified program to run. Return 0 on success. < 0 on error. */
int prog_locate(struct prog *prog);
+int prog_locate_hook(struct prog *prog);

/* Run the program described by prog. */
void prog_run(struct prog *prog);
diff --git a/src/lib/prog_loaders.c b/src/lib/prog_loaders.c
index b763417..4fa9a03 100644
--- a/src/lib/prog_loaders.c
+++ b/src/lib/prog_loaders.c
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright 2015 Google Inc.
+ * Copyright (C) 2018 Eltan B.V.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -39,6 +40,9 @@
{
struct cbfsf file;

+ if (prog_locate_hook(prog))
+ return -1;
+
cbfs_prepare_program_locate();

if (cbfs_boot_locate(&file, prog_name(prog), NULL))
@@ -74,6 +78,7 @@
halt();
}

+int __weak prog_locate_hook(struct prog *prog) {return 0; }
void __weak stage_cache_add(int stage_id,
const struct prog *stage) {}
void __weak stage_cache_load_stage(int stage_id,

To view, visit change 30811. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I12207fc8f2e9ca45d048cf8c8d9c057f53e5c2c7
Gerrit-Change-Number: 30811
Gerrit-PatchSet: 1
Gerrit-Owner: Frans Hendriks <fhendriks@eltan.com>
Gerrit-MessageType: newchange