aboutsummaryrefslogtreecommitdiff
path: root/core/init.c
diff options
context:
space:
mode:
authorClaudio Carvalho <cclaudio@linux.vnet.ibm.com>2017-12-09 02:52:18 -0200
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-12-18 21:30:57 -0600
commit060ff18d4ddcfb87e9aa31fc5eadaf4318bca9bb (patch)
tree93c9719ad8ff345033405abd43c387864dce2886 /core/init.c
parent75dbbe674c0fbe97cf64e96fd3b5ed2f3cd5efa6 (diff)
downloadskiboot-060ff18d4ddcfb87e9aa31fc5eadaf4318bca9bb.zip
skiboot-060ff18d4ddcfb87e9aa31fc5eadaf4318bca9bb.tar.gz
skiboot-060ff18d4ddcfb87e9aa31fc5eadaf4318bca9bb.tar.bz2
core/init.c: remove redundant calls to verify and measure BOOTKERNEL
The flash driver calls libstb to verify and measure every PNOR partition requested at boot time. This removes redundat code from init.c used to verify and measure BOOTKERNEL. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/init.c')
-rw-r--r--core/init.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/core/init.c b/core/init.c
index 9eb8e25..1c822f1 100644
--- a/core/init.c
+++ b/core/init.c
@@ -342,10 +342,8 @@ bool start_preload_kernel(void)
static bool load_kernel(void)
{
- void* stb_container = NULL;
struct elf_hdr *kh;
int loaded;
- bool do_stb = false;
prlog(PR_NOTICE, "INIT: Waiting for kernel...\n");
@@ -368,7 +366,6 @@ static bool load_kernel(void)
printf("Using built-in kernel\n");
memmove(KERNEL_LOAD_BASE, (void*)builtin_base,
kernel_size);
- do_stb = true;
}
}
@@ -386,21 +383,18 @@ static bool load_kernel(void)
memcpy(NULL, old_vectors, 0x2000);
sync_icache();
}
- do_stb = true;
- stb_container = kh; /* probably incorrect */
} else {
if (!kernel_size) {
printf("INIT: Assuming kernel at %p\n",
KERNEL_LOAD_BASE);
/* Hack for STB in Mambo, assume at least 4kb in mem */
kernel_size = SECURE_BOOT_HEADERS_SIZE;
- do_stb = true;
}
- kh = (struct elf_hdr *) (KERNEL_LOAD_BASE);
- if (stb_is_container(KERNEL_LOAD_BASE, kernel_size)) {
- stb_container = kh;
+ if (stb_is_container(KERNEL_LOAD_BASE, kernel_size))
kh = (struct elf_hdr *) (KERNEL_LOAD_BASE + SECURE_BOOT_HEADERS_SIZE);
- }
+ else
+ kh = (struct elf_hdr *) (KERNEL_LOAD_BASE);
+
}
prlog(PR_DEBUG,
@@ -423,18 +417,6 @@ static bool load_kernel(void)
return false;
}
- if (do_stb)
- {
- sb_verify(RESOURCE_ID_KERNEL, stb_container,
- kernel_size + SECURE_BOOT_HEADERS_SIZE);
- tb_measure(RESOURCE_ID_KERNEL, stb_container,
- kernel_size + SECURE_BOOT_HEADERS_SIZE);
- }
-
- /*
- * Verify and measure the retrieved PNOR partition as part of the
- * secure boot and trusted boot requirements
- */
stb_final();
return true;