Various minor patches
v3 cover Various minor patches
This series contains a number of minor patches collected while completing the ACPI updates for U-Boot.
Changes in v3:
- Rebase to master
Changes in v2:
- Drop patches already applied
- Rebase to master
Simon Glass (3):
x86: zimage: Add a little more logging
x86: zimage: Sanity-check the kernel version before printing it
x86: zimage: Quieten down the zimage boot process
arch/x86/lib/zimage.c | 26 +++++++++++++++++++++----- common/log.c | 1 + include/log.h | 1 + 3 files changed, 23 insertions(+), 5 deletions(-)
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
PATCH v3 1/3 x86: zimage: Add a little more logging
Add logging for each part of the boot process, using a new
---
(no changes since v1)
arch/x86/lib/zimage.c | 6 ++++++ common/log.c | 1 + include/log.h | 1 + 3 files changed, 8 insertions(+)
arch/x86/lib/zimage.c +6 -0
@@ -12,10 +12,13 @@* linux/Documentation/i386/boot.txt */ +#define LOG_CATEGORY LOGC_BOOT +#include <common.h> #include <command.h> #include <env.h> #include <irq_func.h> +#include <log.h> #include <malloc.h> #include <acpi/acpi_table.h> #include <asm/io.h>
@@ -292,6 +295,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,struct setup_header *hdr = &setup_base->hdr;int bootproto =get_boot_protocol (hdr, false); +log_debug ("Setup E820 entries\n" ); setup_base->e820_entries =install_e820_map (ARRAY_SIZE (setup_base->e820_map), setup_base->e820_map);
@@ -317,6 +321,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, }if (cmd_line) { +log_debug ("Setup cmdline\n" );if (bootproto >=0x0202 ) { hdr->cmd_line_ptr = (uintptr_t )cmd_line; }else if (bootproto >=0x0200 ) {
@@ -340,6 +345,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,if (IS_ENABLED (CONFIG_GENERATE_ACPI_TABLE )) setup_base->acpi_rsdp_addr =acpi_get_rsdp_addr (); +log_debug ("Setup devicetree\n" );setup_device_tree (hdr, (const void *)env_get_hex ("fdtaddr" ,0 ));setup_video (&setup_base->screen_info);
common/log.c +1 -0
@@ -26,6 +26,7 @@ static const char *const log_cat_name[] = {"bloblist" ,"devres" ,"acpi" , +"boot" , }; _Static_assert(ARRAY_SIZE(log_cat_name) == LOGC_COUNT - LOGC_NONE,
include/log.h +1 -0
@@ -96,6 +96,7 @@ enum log_category_t {LOGC_DEVRES ,/** @LOGC_ACPI: Advanced Configuration and Power Interface (ACPI) */ LOGC_ACPI , +LOGC_BOOT ,/* Related to boot process / boot image processing */ /** @LOGC_COUNT: Number of log categories */ LOGC_COUNT,
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
PATCH v3 1/3 x86: zimage: Add a little more logging
Quoted 81 lines · Simon Glass
Add logging for each part of the boot process, using a new
Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
(no changes since v1)
arch/x86/lib/zimage.c | 6 ++++++ common/log.c | 1 + include/log.h | 1 + 3 files changed, 8 insertions(+)arch/x86/lib/zimage.c +6
-0@@ -12,10 +12,13 @@* linux/Documentation/i386/boot.txt */ +#define LOG_CATEGORY LOGC_BOOT +#include <common.h> #include <command.h> #include <env.h> #include <irq_func.h> +#include <log.h> #include <malloc.h> #include <acpi/acpi_table.h> #include <asm/io.h> @@ -292,6 +295,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,struct setup_header *hdr = &setup_base->hdr;int bootproto =get_boot_protocol (hdr, false); +log_debug ("Setup E820 entries\n" ); setup_base->e820_entries =install_e820_map (ARRAY_SIZE (setup_base->e820_map), setup_base->e820_map);@@ -317,6 +321,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot, }if (cmd_line) { +log_debug ("Setup cmdline\n" );if (bootproto >=0x0202 ) { hdr->cmd_line_ptr = (uintptr_t )cmd_line; }else if (bootproto >=0x0200 ) {@@ -340,6 +345,7 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,if (IS_ENABLED (CONFIG_GENERATE_ACPI_TABLE )) setup_base->acpi_rsdp_addr =acpi_get_rsdp_addr (); +log_debug ("Setup devicetree\n" );setup_device_tree (hdr, (const void *)env_get_hex ("fdtaddr" ,0 ));setup_video (&setup_base->screen_info);common/log.c +1
-0@@ -26,6 +26,7 @@ static const char *const log_cat_name[] = {"bloblist" ,"devres" ,"acpi" , +"boot" , }; _Static_assert(ARRAY_SIZE(log_cat_name) == LOGC_COUNT - LOGC_NONE,include/log.h +1
-1@@ -96,6 +96,7 @@ enum log_category_t {LOGC_DEVRES ,/** @LOGC_ACPI: Advanced Configuration and Power Interface (ACPI) */ LOGC_ACPI , +LOGC_BOOT ,/* Related to boot process / boot image processing */ /** @LOGC_COUNT: Number of log categories */ LOGC_COUNT, --
Quoted 2 lines
2.29.1.341.ge80a0c044ae-goog
Signature · 8 lines
Best regards - Freundliche Gr?sse - Meilleures salutations Igor Opaniuk mailto: igor.opaniuk at gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk
PATCH v3 2/3 x86: zimage: Sanity-check the kernel version before printing it
In reply to Simon GlassWith Chrome OS the kernel setup block is stored in a separate place from the kernel, so it is not possible to access the kernel version string. At present, garbage is printed.
Add a sanity check to avoid this.
---
(no changes since v1)
arch/x86/lib/zimage.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/x86/lib/zimage.c +9 -0
@@ -31,6 +31,7 @@#include <asm/arch/timestamp.h> #endif #include <linux/compiler.h> +#include <linux/ctype.h> #include <linux/libfdt.h> /*
@@ -175,11 +176,19 @@ static const char *get_kernel_version(struct boot_params *params, {struct setup_header *hdr = ¶ms->hdr;int bootproto; +const char *s, *end; bootproto =get_boot_protocol (hdr, false);if (bootproto <0x0200 || hdr->setup_sects <15 )return NULL ; +/* sanity-check the kernel version in case it is missing */ +for (s = kernel_base + hdr->kernel_version +0x200 , end = s +0x100 ; *s; + s++) { +if (!isprint (*s)) +return NULL ; + } +return kernel_base + hdr->kernel_version +0x200 ; }
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
PATCH v3 3/3 x86: zimage: Quieten down the zimage boot process
In reply to Simon GlassMuch of the output is not very useful. The bootm command is quite a bit quieter. Convert some output to use log_debug().
---
Changes in v3:
- Rebase to master
Changes in v2:
- Drop patches already applied
- Rebase to master
arch/x86/lib/zimage.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
arch/x86/lib/zimage.c +6 -5
@@ -212,13 +212,13 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size,/* determine size of setup */ if (0 == hdr->setup_sects) { -printf ("Setup Sectors = 0 (defaulting to 4)\n" ); +log_warning ("Setup Sectors = 0 (defaulting to 4)\n" ); setup_size =5 *512 ; }else { setup_size = (hdr->setup_sects +1 ) *512 ; } -printf ("Setup Size = 0x%8.8lx\n" , (ulong )setup_size); +log_debug ("Setup Size = 0x%8.8lx\n" , (ulong )setup_size);if (setup_size >SETUP_MAX_SIZE )printf ("Error: Setup is too large (%d bytes)\n" , setup_size);
@@ -226,8 +226,8 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size,/* determine boot protocol version */ bootproto =get_boot_protocol (hdr, true); -printf ("Using boot protocol version %x.%02x\n" , - (bootproto &0xff00 ) >>8 , bootproto &0xff ); +log_debug ("Using boot protocol version %x.%02x\n" , + (bootproto &0xff00 ) >>8 , bootproto &0xff ); version =get_kernel_version (params, image);if (version)
@@ -420,7 +420,8 @@ static int do_zboot_load(struct cmd_tbl *cmdtp, int flag, int argc,struct boot_params *from = (struct boot_params *)state.base_ptr; base_ptr = (struct boot_params *)DEFAULT_SETUP_BASE ; -printf ("Building boot_params at 0x%8.8lx\n" , (ulong )base_ptr); +log_debug ("Building boot_params at 0x%8.8lx\n" , + (ulong )base_ptr);memset (base_ptr,'\0' ,sizeof (*base_ptr)); base_ptr->hdr = from->hdr; }else {
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
PATCH v3 3/3 x86: zimage: Quieten down the zimage boot process
Quoted 60 lines · Simon Glass
Much of the output is not very useful. The bootm command is quite a bit quieter. Convert some output to use
log_debug().Signed-off-by Simon Glass <[email protected]>Reviewed-by Bin Meng <[email protected]>---
Changes in v3:
- Rebase to masterChanges in v2:
- Drop patches already applied
- Rebase to masterarch/x86/lib/zimage.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)arch/x86/lib/zimage.c +6
-6@@ -212,13 +212,13 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size,/* determine size of setup */ if (0 == hdr->setup_sects) { -printf ("Setup Sectors = 0 (defaulting to 4)\n" ); +log_warning ("Setup Sectors = 0 (defaulting to 4)\n" ); setup_size =5 *512 ; }else { setup_size = (hdr->setup_sects +1 ) *512 ; } -printf ("Setup Size = 0x%8.8lx\n" , (ulong )setup_size); +log_debug ("Setup Size = 0x%8.8lx\n" , (ulong )setup_size);if (setup_size >SETUP_MAX_SIZE )printf ("Error: Setup is too large (%d bytes)\n" , setup_size);@@ -226,8 +226,8 @@ struct boot_params *load_zimage(char *image, unsigned long kernel_size,/* determine boot protocol version */ bootproto =get_boot_protocol (hdr, true); -printf ("Using boot protocol version %x.%02x\n" , - (bootproto &0xff00 ) >>8 , bootproto &0xff ); +log_debug ("Using boot protocol version %x.%02x\n" , + (bootproto &0xff00 ) >>8 , bootproto &0xff ); version =get_kernel_version (params, image);if (version)@@ -420,7 +420,8 @@ static int do_zboot_load(struct cmd_tbl *cmdtp, int flag, int argc,struct boot_params *from = (struct boot_params *)state.base_ptr; base_ptr = (struct boot_params *)DEFAULT_SETUP_BASE ; -printf ("Building boot_params at 0x%8.8lx\n" , (ulong )base_ptr); +log_debug ("Building boot_params at 0x%8.8lx\n" , + (ulong )base_ptr);memset (base_ptr,'\0' ,sizeof (*base_ptr)); base_ptr->hdr = from->hdr; }else { --
Quoted 2 lines
2.29.1.341.ge80a0c044ae-goog
Signature · 8 lines
Best regards - Freundliche Gr?sse - Meilleures salutations Igor Opaniuk mailto: igor.opaniuk at gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk
v3 cover Various minor patches
In reply to Simon GlassQuoted 16 lines · Simon Glass
This series contains a number of minor patches collected while completing the ACPI updates for U-Boot.
Changes in v3:
- Rebase to masterChanges in v2:
- Drop patches already applied
- Rebase to masterSimon Glass (3):
x86: zimage: Add a little more logging
x86: zimage: Sanity-check the kernel version before printing it
x86: zimage: Quieten down the zimage boot process
Quoted 5 lines
arch/x86/lib/zimage.c | 26 +++++++++++++++++++++----- common/log.c | 1 + include/log.h | 1 + 3 files changed, 23 insertions(+), 5 deletions(-)
series applied to u-boot-x86, thanks!