aboutsummaryrefslogtreecommitdiff
path: root/src/security
diff options
context:
space:
mode:
authorJakub Czapiga <jacz@semihalf.com>2022-02-15 11:50:31 +0100
committerFelix Held <felix-coreboot@felixheld.de>2022-03-08 16:06:33 +0000
commitad6157ebdfddc39b95e388487e00cadd2bbf368b (patch)
treebbb85c9b13faf74515387ee8978eefd6d79e6b06 /src/security
parente96ade6981c60af4d6f24471d7f6a440ab7bfd4e (diff)
timestamps: Rename timestamps to make names more consistent
This patch aims to make timestamps more consistent in naming, to follow one pattern. Until now there were many naming patterns: - TS_START_*/TS_END_* - TS_BEFORE_*/TS_AFTER_* - TS_*_START/TS_*_END This change also aims to indicate, that these timestamps can be used to create time-ranges, e.g. from TS_BOOTBLOCK_START to TS_BOOTBLOCK_END. Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: I533e32392224d9b67c37e6a67987b09bf1cf51c6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62019 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/security')
-rw-r--r--src/security/vboot/ec_sync.c4
-rw-r--r--src/security/vboot/vboot_loader.c4
-rw-r--r--src/security/vboot/vboot_logic.c28
3 files changed, 18 insertions, 18 deletions
diff --git a/src/security/vboot/ec_sync.c b/src/security/vboot/ec_sync.c
index f31b78337b..56e6c44d60 100644
--- a/src/security/vboot/ec_sync.c
+++ b/src/security/vboot/ec_sync.c
@@ -42,7 +42,7 @@ void vboot_sync_ec(void)
vb2_error_t retval = VB2_SUCCESS;
struct vb2_context *ctx;
- timestamp_add_now(TS_START_EC_SYNC);
+ timestamp_add_now(TS_EC_SYNC_START);
ctx = vboot_get_context();
ctx->flags |= VB2_CONTEXT_EC_SYNC_SUPPORTED;
@@ -84,7 +84,7 @@ void vboot_sync_ec(void)
break;
}
- timestamp_add_now(TS_END_EC_SYNC);
+ timestamp_add_now(TS_EC_SYNC_END);
}
/* Convert firmware image type into a flash offset */
diff --git a/src/security/vboot/vboot_loader.c b/src/security/vboot/vboot_loader.c
index 482c6fb7c5..1c4343bdc5 100644
--- a/src/security/vboot/vboot_loader.c
+++ b/src/security/vboot/vboot_loader.c
@@ -52,10 +52,10 @@ void vboot_run_logic(void)
printk(BIOS_DEBUG, "VBOOT: Loading verstage.\n");
- timestamp_add_now(TS_START_COPYVER);
+ timestamp_add_now(TS_COPYVER_START);
if (cbfs_prog_stage_load(&verstage))
die("failed to load verstage");
- timestamp_add_now(TS_END_COPYVER);
+ timestamp_add_now(TS_COPYVER_END);
/* verify and select a slot */
prog_run(&verstage);
diff --git a/src/security/vboot/vboot_logic.c b/src/security/vboot/vboot_logic.c
index 91d42b2c7f..509169fc95 100644
--- a/src/security/vboot/vboot_logic.c
+++ b/src/security/vboot/vboot_logic.c
@@ -140,7 +140,7 @@ static vb2_error_t hash_body(struct vb2_context *ctx,
* (This split won't make sense with memory-mapped media like on x86.)
*/
load_ts = timestamp_get();
- timestamp_add(TS_START_HASH_BODY, load_ts);
+ timestamp_add(TS_HASH_BODY_START, load_ts);
remaining = region_device_sz(fw_body);
offset = 0;
@@ -169,15 +169,15 @@ static vb2_error_t hash_body(struct vb2_context *ctx,
offset += block_size;
}
- timestamp_add(TS_DONE_LOADING, load_ts);
- timestamp_add_now(TS_DONE_HASHING);
+ timestamp_add(TS_LOADING_END, load_ts);
+ timestamp_add_now(TS_HASHING_END);
/* Check the result (with RSA signature verification) */
rv = vb2api_check_hash_get_digest(ctx, hash_digest, hash_digest_sz);
if (rv)
return rv;
- timestamp_add_now(TS_END_HASH_BODY);
+ timestamp_add_now(TS_HASH_BODY_END);
if (handle_digest_result(hash_digest, hash_digest_sz))
return VB2_ERROR_UNKNOWN;
@@ -248,7 +248,7 @@ void verstage_main(void)
struct region_device fw_body;
vb2_error_t rv;
- timestamp_add_now(TS_START_VBOOT);
+ timestamp_add_now(TS_VBOOT_START);
/* Lockdown SPI flash controller if required */
if (CONFIG(BOOTMEDIA_LOCK_IN_VERSTAGE))
@@ -271,12 +271,12 @@ void verstage_main(void)
/* Read secdata from TPM. Initialize TPM if secdata not found. We don't
* check the return value here because vb2api_fw_phase1 will catch
* invalid secdata and tell us what to do (=reboot). */
- timestamp_add_now(TS_START_TPMINIT);
+ timestamp_add_now(TS_TPMINIT_START);
if (vboot_setup_tpm(ctx) == TPM_SUCCESS) {
antirollback_read_space_firmware(ctx);
antirollback_read_space_kernel(ctx);
}
- timestamp_add_now(TS_END_TPMINIT);
+ timestamp_add_now(TS_TPMINIT_END);
if (get_recovery_mode_switch()) {
ctx->flags |= VB2_CONTEXT_FORCE_RECOVERY_MODE;
@@ -343,9 +343,9 @@ void verstage_main(void)
/* Try that slot (verify its keyblock and preamble) */
printk(BIOS_INFO, "Phase 3\n");
- timestamp_add_now(TS_START_VERIFY_SLOT);
+ timestamp_add_now(TS_VERIFY_SLOT_START);
rv = vb2api_fw_phase3(ctx);
- timestamp_add_now(TS_END_VERIFY_SLOT);
+ timestamp_add_now(TS_VERIFY_SLOT_END);
if (rv) {
printk(BIOS_INFO, "Reboot requested (%x)\n", rv);
vboot_save_data(ctx);
@@ -367,7 +367,7 @@ void verstage_main(void)
/* Only extend PCRs once on boot. */
if (!(ctx->flags & VB2_CONTEXT_S3_RESUME)) {
- timestamp_add_now(TS_START_TPMPCR);
+ timestamp_add_now(TS_TPMPCR_START);
rv = extend_pcrs(ctx);
if (rv) {
printk(BIOS_WARNING,
@@ -376,12 +376,12 @@ void verstage_main(void)
vboot_save_data(ctx);
vboot_reboot();
}
- timestamp_add_now(TS_END_TPMPCR);
+ timestamp_add_now(TS_TPMPCR_END);
}
/* Lock TPM */
- timestamp_add_now(TS_START_TPMLOCK);
+ timestamp_add_now(TS_TPMLOCK_START);
rv = antirollback_lock_space_firmware();
if (rv) {
printk(BIOS_INFO, "Failed to lock TPM (%x)\n", rv);
@@ -389,7 +389,7 @@ void verstage_main(void)
vboot_save_data(ctx);
vboot_reboot();
}
- timestamp_add_now(TS_END_TPMLOCK);
+ timestamp_add_now(TS_TPMLOCK_END);
/* Lock rec hash space if available. */
if (CONFIG(VBOOT_HAS_REC_HASH_SPACE)) {
@@ -408,5 +408,5 @@ void verstage_main(void)
vboot_is_firmware_slot_a(ctx) ? 'A' : 'B');
verstage_main_exit:
- timestamp_add_now(TS_END_VBOOT);
+ timestamp_add_now(TS_VBOOT_END);
}