From patchwork Tue Sep 25 06:26:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 974225 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42KB0c5tvJz9s3C for ; Tue, 25 Sep 2018 16:26:08 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42KB0c4m7czF3F2 for ; Tue, 25 Sep 2018 16:26:08 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42KB0T70ZBzDrSK for ; Tue, 25 Sep 2018 16:26:01 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 42KB0T5Zllz9s9G; Tue, 25 Sep 2018 16:26:01 +1000 (AEST) Received: by localhost.localdomain (Postfix, from userid 1000) id BCA3BEE78BF; Tue, 25 Sep 2018 16:26:01 +1000 (AEST) From: Michael Neuling To: stewart@linux.vnet.ibm.com Date: Tue, 25 Sep 2018 16:26:00 +1000 Message-Id: <20180925062600.25374-1-mikey@neuling.org> X-Mailer: git-send-email 2.17.1 Subject: [Skiboot] [PATCH] init: Fix starting stripped kernel X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: skiboot@lists.ozlabs.org, Michael Neuling MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Currently if we try to run a raw/stripped binary kernel (ie. without the elf header) we crash with: [ 0.008757768,5] INIT: Waiting for kernel... [ 0.008762937,5] INIT: platform wait for kernel load failed [ 0.008768171,5] INIT: Assuming kernel at 0x20000000 [ 0.008779241,3] INIT: ELF header not found. Assuming raw binary. [ 0.017047348,5] INIT: Starting kernel at 0x0, fdt at 0x3044b230 14339 bytes [ 0.017054251,0] FATAL: Kernel is zeros, can't execute! [ 0.017059054,0] Assert fail: core/init.c:590:0 [ 0.017065371,0] Aborting! This is because we haven't set kernel_entry correctly in this path. This fixes it. Signed-off-by: Michael Neuling --- core/init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/init.c b/core/init.c index a7e70c9ec3..262ac5fb31 100644 --- a/core/init.c +++ b/core/init.c @@ -394,6 +394,7 @@ static bool load_kernel(void) KERNEL_LOAD_BASE); /* Hack for STB in Mambo, assume at least 4kb in mem */ kernel_size = SECURE_BOOT_HEADERS_SIZE; + kernel_entry = (uint64_t)KERNEL_LOAD_BASE; } if (stb_is_container(KERNEL_LOAD_BASE, kernel_size)) { stb_container = KERNEL_LOAD_BASE;