summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2021-03-29 10:23:06 +0800
committerCommit Bot <commit-bot@chromium.org>2021-05-09 19:28:26 +0000
commit2fe1b752108ea2839770d250234aa857a3dc81ba (patch)
tree121474d82b9c98865d856b3de71998c4479d75f9
parent31b9ca2e55135c17f6cb5e14d1571d2f2dc658b4 (diff)
downloadvboot-2fe1b752108ea2839770d250234aa857a3dc81ba.tar.gz
vboot/vboot_kernel: remove unused VbSharedDataKernelCall
This CL is part of a series to merge vboot1 and vboot2.0 kernel verification code; see b/181739551. BUG=b:181739551 TEST=make clean && make runtests BRANCH=none Signed-off-by: Joel Kitching <kitching@google.com> Change-Id: Ie4a0f356ad387699e180cabdaa8dd2089199b42c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2824765 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r--firmware/lib/include/vboot_kernel.h31
-rw-r--r--firmware/lib/include/vboot_struct.h9
-rw-r--r--firmware/lib/vboot_kernel.c11
3 files changed, 3 insertions, 48 deletions
diff --git a/firmware/lib/include/vboot_kernel.h b/firmware/lib/include/vboot_kernel.h
index 2d3ebad9..b94502f6 100644
--- a/firmware/lib/include/vboot_kernel.h
+++ b/firmware/lib/include/vboot_kernel.h
@@ -16,37 +16,6 @@
struct vb2_context;
-/* Result codes for VbSharedDataKernelCall.check_result */
-#define VBSD_LKC_CHECK_NOT_DONE 0
-#define VBSD_LKC_CHECK_DEV_SWITCH_MISMATCH 1
-#define VBSD_LKC_CHECK_GPT_READ_ERROR 2
-#define VBSD_LKC_CHECK_GPT_PARSE_ERROR 3
-#define VBSD_LKC_CHECK_GOOD_PARTITION 4
-#define VBSD_LKC_CHECK_INVALID_PARTITIONS 5
-#define VBSD_LKC_CHECK_NO_PARTITIONS 6
-
-/* Information about a single call to LoadKernel() */
-typedef struct VbSharedDataKernelCall {
- /* Bottom 32 bits of flags passed in LoadKernelParams.boot_flags */
- uint32_t boot_flags;
- /* Debug flags; see VBSD_LK_FLAG_* */
- uint32_t flags;
- /* Number of sectors on drive */
- uint64_t sector_count;
- /* Sector size in bytes */
- uint32_t sector_size;
- /* Check result; see VBSD_LKC_CHECK_* */
- uint8_t check_result;
- /* Test error number, if non-zero */
- uint8_t test_error_num;
- /* Return code from LoadKernel() */
- uint8_t return_code;
- /* Number of kernel partitions found */
- uint8_t kernel_parts_found;
- /* Reserved for padding */
- uint8_t reserved0[199];
-} VbSharedDataKernelCall;
-
/**
* Attempt loading a kernel from the specified type(s) of disks.
*
diff --git a/firmware/lib/include/vboot_struct.h b/firmware/lib/include/vboot_struct.h
index caca1f26..8a068922 100644
--- a/firmware/lib/include/vboot_struct.h
+++ b/firmware/lib/include/vboot_struct.h
@@ -53,9 +53,6 @@ extern "C" {
/* NvStorage uses 64-byte record, not 16-byte */
#define VBSD_NVDATA_V2 0x00100000
-/* Number of kernel calls to track. Must be power of 2. */
-#define VBSD_MAX_KERNEL_CALLS 4
-
/* Data shared to OS. */
typedef struct VbSharedDataHeader {
/* Fields present in version 1 */
@@ -117,8 +114,8 @@ typedef struct VbSharedDataHeader {
/* Debugging information from LoadKernel() */
/* Number of times LoadKernel() called */
uint32_t lk_call_count;
- /* Info on calls */
- VbSharedDataKernelCall lk_calls[VBSD_MAX_KERNEL_CALLS];
+ /* Reserved for padding */
+ uint8_t reserved3[896];
/*
* Offset and size of supplemental kernel data. Reserve space for
@@ -137,7 +134,7 @@ typedef struct VbSharedDataHeader {
/* Recovery reason for current boot */
uint8_t recovery_reason;
/* Reserved for padding */
- uint8_t reserved3[7];
+ uint8_t reserved4[7];
/* Flags from firmware keyblock */
uint64_t fw_keyblock_flags;
/* Kernel TPM version at start of VbSelectAndLoadKernel() */
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c
index 34898706..331ecdbf 100644
--- a/firmware/lib/vboot_kernel.c
+++ b/firmware/lib/vboot_kernel.c
@@ -452,7 +452,6 @@ vb2_error_t LoadKernel(struct vb2_context *ctx, LoadKernelParams *params)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);
struct vb2_workbuf wb;
- VbSharedDataKernelCall shcall;
int found_partitions = 0;
uint32_t lowest_version = LOWEST_TPM_VERSION;
vb2_error_t rv;
@@ -465,14 +464,6 @@ vb2_error_t LoadKernel(struct vb2_context *ctx, LoadKernelParams *params)
params->bootloader_size = 0;
params->flags = 0;
- /*
- * Set up tracking for this call. This wraps around if called many
- * times, so we need to initialize the call entry each time.
- */
- memset(&shcall, 0, sizeof(shcall));
- shcall.boot_flags = (uint32_t)params->boot_flags;
- shcall.sector_size = (uint32_t)params->bytes_per_lba;
-
/* Locate key to verify kernel. This will either be a recovery key, or
a kernel subkey passed from firmware verification. */
struct vb2_packed_key *kernel_subkey =
@@ -506,7 +497,6 @@ vb2_error_t LoadKernel(struct vb2_context *ctx, LoadKernelParams *params)
part_start, part_size);
/* Found at least one kernel partition. */
- shcall.kernel_parts_found++;
found_partitions++;
/* Set up the stream */
@@ -628,6 +618,5 @@ vb2_error_t LoadKernel(struct vb2_context *ctx, LoadKernelParams *params)
rv = VB2_ERROR_LK_NO_KERNEL_FOUND;
}
- shcall.return_code = (uint8_t)rv;
return rv;
}