[Skiboot] [RFC PATCH 2/6] core/init: Stop using size of other kernels for preloaded kernels

Jordan Niethe jniethe5 at gmail.com
Wed Dec 18 15:49:07 AEDT 2019


At the point of checking if the DT has a kernel-base-address that should
be used for loading the kernel from, kernel_size might already have a
value (e.g., from the embedded kernel). There is no connection between
this size and the size of the preloaded kernel whose address is in the
DT - so simply always set the preloaded kernel size to
SECURE_BOOT_HEADERS_SIZE.

Signed-off-by: Jordan Niethe <jniethe5 at gmail.com>
---
 core/init.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/core/init.c b/core/init.c
index 80222c6a9fc6..5e9306126204 100644
--- a/core/init.c
+++ b/core/init.c
@@ -397,8 +397,7 @@ static bool load_kernel(void)
 			sync_icache();
 		}
 		/* Hack for STB in Mambo, assume at least 4kb in mem */
-		if (!kernel_size)
-			kernel_size = SECURE_BOOT_HEADERS_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);
-- 
2.17.1



More information about the Skiboot mailing list