From fa74e4705dbb5ecf5ba466fd6a9bc309f7e3e8bf Mon Sep 17 00:00:00 2001 From: "Ronald G. Minnich" Date: Wed, 28 Sep 2016 10:43:12 -0700 Subject: cbfstool: set init_size for linux payloads. We were not setting the init_size for linux payloads. A proper value of init_size is required if the kernel is x86_64. This is tested in qemu and fixes the observed problem that 974f221c84b05b1dc2f5ea50dc16d2a9d1e95eda and later would not boot, and would in fact fail in head_64.S. Change-Id: I254c13d16b1e014a6f1d4fd7c39b1cfe005cd9b0 Signed-off-by: Ronald G. Minnich Reviewed-on: https://review.coreboot.org/16781 Reviewed-by: Aaron Durbin Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- util/cbfstool/cbfs-payload-linux.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'util/cbfstool/cbfs-payload-linux.c') diff --git a/util/cbfstool/cbfs-payload-linux.c b/util/cbfstool/cbfs-payload-linux.c index 03a41cd7f4..afb0f3ac71 100644 --- a/util/cbfstool/cbfs-payload-linux.c +++ b/util/cbfstool/cbfs-payload-linux.c @@ -220,14 +220,19 @@ int parse_bzImage_to_payload(const struct buffer *input, if (hdr->setup_sects != 0) { setup_size = (hdr->setup_sects + 1) * 512; + } else { + WARN("hdr->setup_sects is 0, which could cause boot problems.\n"); } /* Setup parameter block. Imitate FILO. */ struct linux_params params; memset(¶ms, 0, sizeof(struct linux_params)); + params.mount_root_rdonly = hdr->root_flags; params.orig_root_dev = hdr->root_dev; + params.init_size = hdr->init_size; + /* Sensible video defaults. Might be overridden on runtime by coreboot tables. */ params.orig_video_mode = 3; params.orig_video_cols = 80; @@ -262,6 +267,10 @@ int parse_bzImage_to_payload(const struct buffer *input, * so if possible (relocatable kernel) use that to * avoid a trampoline copy. */ kernel_base = ALIGN(16*1024*1024, params.kernel_alignment); + if (hdr->init_size == 0) { + ERROR("init_size 0 for relocatable kernel\n"); + return -1; + } } } -- cgit v1.2.3