[coreboot-gerrit] New patch to review for filo: linux_load: set init_size boot parameter
Mathias Krause (minipli@googlemail.com)
gerrit at coreboot.org
Tue Dec 20 13:18:46 CET 2016
Mathias Krause (minipli at googlemail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17927
-gerrit
commit c7670c29fc6ca0ca7c838f2ced4cc936cfb9821d
Author: Mathias Krause <mathias.krause at secunet.com>
Date: Tue Dec 20 10:28:26 2016 +0100
linux_load: set init_size boot parameter
Recent Linux kernels (v4.7+) require the boot loader to copy over the
init_size boot parameter, too. We also miss to copy the loadflags.
Fix that to comply to the boot protocol v2.10+.
This fixes booting kernels v4.7 and later.
Change-Id: Ie68d44caedc481c368c63420376caedbdb9a93b5
Signed-off-by: Mathias Krause <mathias.krause at secunet.com>
---
x86/linux_load.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/x86/linux_load.c b/x86/linux_load.c
index 7bb37dd..acbb830 100644
--- a/x86/linux_load.c
+++ b/x86/linux_load.c
@@ -182,7 +182,10 @@ struct linux_params {
u32 initrd_addr_max; /* 0x22c */
u32 kernel_alignment; /* 0x230 */
u8 relocatable_kernel; /* 0x234 */
- u8 reserved13[155]; /* 0x22c */
+ u8 min_alignment; /* 0x235 */
+ u8 reserved13[42]; /* 0x236 */
+ u32 init_size; /* 0x260 */
+ u8 reserved14[108]; /* 0x264 */
struct e820entry e820_map[E820MAX]; /* 0x2d0 */
u8 reserved16[688]; /* 0x550 */
#define COMMAND_LINE_SIZE 256
@@ -282,6 +285,7 @@ init_linux_params(struct linux_params *params, struct linux_header *hdr)
/* Copy some useful values from header */
params->mount_root_rdonly = hdr->root_flags;
params->orig_root_dev = hdr->root_dev;
+ params->loader_flags = hdr->loadflags;
/* Video parameters.
* This assumes we have VGA in standard 80x25 text mode,
@@ -812,6 +816,14 @@ int linux_load(const char *file, const char *cmdline)
free(initrd_file);
}
+ /* set init_size */
+ if (hdr.protocol_version < 0x020a) {
+ /* conservative size assumption */
+ params->init_size = 3 * kern_size;
+ } else {
+ params->init_size = hdr.init_size;
+ }
+
file_close();
#if IS_ENABLED(CONFIG_LP_USB)
usb_exit();
More information about the coreboot-gerrit
mailing list