[Skiboot] [RFC PATCH 1/6] core/init: Check for STB container for kernel preloaded at 0
Jordan Niethe
jniethe5 at gmail.com
Wed Dec 18 15:49:06 AEDT 2019
Preloading a kernel at address 0 is intended for binary files with no
headers. We do not check for a STB header in this case, but there is no
real harm in doing so. When there is no STB header the code will
function as before. Move the check for a STB header to be be
unconditionally performed. This helps with a future tidy up.
Signed-off-by: Jordan Niethe <jniethe5 at gmail.com>
---
core/init.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/core/init.c b/core/init.c
index ade91e07ba5b..80222c6a9fc6 100644
--- a/core/init.c
+++ b/core/init.c
@@ -395,16 +395,15 @@ static bool load_kernel(void)
cpu_set_sreset_enable(false);
memcpy_null(NULL, old_vectors, EXCEPTION_VECTORS_END);
sync_icache();
- } else {
- /* Hack for STB in Mambo, assume at least 4kb in mem */
- if (!kernel_size)
- kernel_size = SECURE_BOOT_HEADERS_SIZE;
- if (stb_is_container((void*)kernel_entry, kernel_size)) {
- stb_container = (void*)kernel_entry;
- kh = (struct elf_hdr *) (kernel_entry + SECURE_BOOT_HEADERS_SIZE);
- } else
- kh = (struct elf_hdr *) (kernel_entry);
}
+ /* Hack for STB in Mambo, assume at least 4kb in mem */
+ if (!kernel_size)
+ kernel_size = SECURE_BOOT_HEADERS_SIZE;
+ if (stb_is_container((void *)kernel_entry, kernel_size)) {
+ stb_container = (void *)kernel_entry;
+ kh = (struct elf_hdr *) (kernel_entry + SECURE_BOOT_HEADERS_SIZE);
+ } else
+ kh = (struct elf_hdr *) (kernel_entry);
} else {
if (!kernel_size) {
printf("INIT: Assuming kernel at %p\n",
--
2.17.1
More information about the Skiboot
mailing list