Browse Source
It looks safer and cleaner approach to record the measurement taken by BL1 straightaway in TCG Event Log instead of deferring these recordings to BL2. Hence pull in the full-fledged measured boot driver into BL1 that replaces the former ad-hoc platform interfaces i.e. bl1_plat_set_bl2_hash, bl2_plat_get_hash. As a result of this change the BL1 of Arm FVP platform now do the measurements and recordings of below images: 1. FW_CONFIG 2. TB_FW_CONFIG 3. BL2 Change-Id: I798c20336308b5e91b547da4f8ed57c24d490731 Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>pull/1981/head
Manish V Badarkhe
3 years ago
9 changed files with 106 additions and 39 deletions
@ -0,0 +1,33 @@ |
|||||
|
/*
|
||||
|
* Copyright (c) 2021, Arm Limited. All rights reserved. |
||||
|
* |
||||
|
* SPDX-License-Identifier: BSD-3-Clause |
||||
|
*/ |
||||
|
|
||||
|
#include <stdint.h> |
||||
|
|
||||
|
#include <drivers/measured_boot/event_log/event_log.h> |
||||
|
|
||||
|
/* Event Log data */ |
||||
|
static uint8_t event_log[PLAT_ARM_EVENT_LOG_MAX_SIZE]; |
||||
|
|
||||
|
/* FVP table with platform specific image IDs, names and PCRs */ |
||||
|
const event_log_metadata_t fvp_event_log_metadata[] = { |
||||
|
{ FW_CONFIG_ID, FW_CONFIG_STRING, PCR_0 }, |
||||
|
{ TB_FW_CONFIG_ID, TB_FW_CONFIG_STRING, PCR_0 }, |
||||
|
{ BL2_IMAGE_ID, BL2_STRING, PCR_0 }, |
||||
|
{ INVALID_ID, NULL, (unsigned int)(-1) } /* Terminator */ |
||||
|
}; |
||||
|
|
||||
|
void bl1_plat_mboot_init(void) |
||||
|
{ |
||||
|
event_log_init(event_log, PLAT_ARM_EVENT_LOG_MAX_SIZE, 0U); |
||||
|
} |
||||
|
|
||||
|
void bl1_plat_mboot_finish(void) |
||||
|
{ |
||||
|
/*
|
||||
|
* ToDo: populate tb_fw_config with Event Log address, its maximum size |
||||
|
* and filled size |
||||
|
*/ |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
/*
|
||||
|
* Copyright (c) 2021, Arm Limited. All rights reserved. |
||||
|
* |
||||
|
* SPDX-License-Identifier: BSD-3-Clause |
||||
|
*/ |
||||
|
|
||||
|
#include <assert.h> |
||||
|
#include <stdint.h> |
||||
|
|
||||
|
#include <common/desc_image_load.h> |
||||
|
#include <drivers/measured_boot/event_log/event_log.h> |
||||
|
#include <plat/arm/common/plat_arm.h> |
||||
|
#include <plat/common/platform.h> |
||||
|
|
||||
|
extern event_log_metadata_t fvp_event_log_metadata[]; |
||||
|
|
||||
|
const event_log_metadata_t *plat_event_log_get_metadata(void) |
||||
|
{ |
||||
|
return fvp_event_log_metadata; |
||||
|
} |
||||
|
|
||||
|
int plat_mboot_measure_image(unsigned int image_id, image_info_t *image_data) |
||||
|
{ |
||||
|
/* Calculate image hash and record data in Event Log */ |
||||
|
int err = event_log_measure_and_record(image_data->image_base, |
||||
|
image_data->image_size, |
||||
|
image_id); |
||||
|
if (err != 0) { |
||||
|
ERROR("%s%s image id %u (%i)\n", |
||||
|
"Failed to ", "record", image_id, err); |
||||
|
return err; |
||||
|
} |
||||
|
|
||||
|
return 0; |
||||
|
} |
Loading…
Reference in new issue