From bedd49f6c07a691663253a0973fdad82e9b1a103 Mon Sep 17 00:00:00 2001 From: Matei Valeanu Date: Wed, 20 Jun 2018 10:47:14 +0200 Subject: kernel messages: add different host/guest messages Rebase the patch and split it into host/guest. Add different kernel start/end messages for host and guest for easier parsing when booting both. Signed-off-by: Matei Valeanu Signed-off-by: Adrian Dudau --- ...-Enea-Linux-guest-boot-start-end-messages.patch | 103 +++++++++++++++++++++ ...d-Enea-Linux-host-boot-start-end-messages.patch | 103 +++++++++++++++++++++ ...tk-add-Enea-Linux-boot-start-end-messages.patch | 95 ------------------- .../kernel_guest_startend_msg.scc | 4 + .../kernel_host_startend_msg.scc | 4 + .../kernel_startend_msg/kernel_startend_msg.scc | 4 - 6 files changed, 214 insertions(+), 99 deletions(-) create mode 100644 patches/kernel_startend_msg/0001-printk-Add-Enea-Linux-guest-boot-start-end-messages.patch create mode 100644 patches/kernel_startend_msg/0001-printk-Add-Enea-Linux-host-boot-start-end-messages.patch delete mode 100644 patches/kernel_startend_msg/0001-printk-add-Enea-Linux-boot-start-end-messages.patch create mode 100644 patches/kernel_startend_msg/kernel_guest_startend_msg.scc create mode 100644 patches/kernel_startend_msg/kernel_host_startend_msg.scc delete mode 100644 patches/kernel_startend_msg/kernel_startend_msg.scc diff --git a/patches/kernel_startend_msg/0001-printk-Add-Enea-Linux-guest-boot-start-end-messages.patch b/patches/kernel_startend_msg/0001-printk-Add-Enea-Linux-guest-boot-start-end-messages.patch new file mode 100644 index 0000000..e5c613c --- /dev/null +++ b/patches/kernel_startend_msg/0001-printk-Add-Enea-Linux-guest-boot-start-end-messages.patch @@ -0,0 +1,103 @@ +From 30aff2983e14dc6482dd2cd6c9a3b96db65c689e Mon Sep 17 00:00:00 2001 +From: Matei Valeanu +Date: Wed, 20 Jun 2018 09:41:46 +0200 +Subject: [PATCH] printk: Add Enea Linux guest boot start/end messages + +rebased for 4.14 + +Upstream-status: Inappropriate [specific measurement] + +Signed-off-by: Adrian Calianu +Signed-off-by: Matei Valeanu +--- + arch/x86/boot/compressed/misc.c | 23 ++++++++++++----------- + init/main.c | 4 +++- + 2 files changed, 15 insertions(+), 12 deletions(-) + +diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c +index 252fee3..ecff964 100644 +--- a/arch/x86/boot/compressed/misc.c ++++ b/arch/x86/boot/compressed/misc.c +@@ -212,10 +212,10 @@ static void handle_relocations(void *output, unsigned long output_len, + delta = virt_addr - LOAD_PHYSICAL_ADDR; + + if (!delta) { +- debug_putstr("No relocation needed... "); ++ /* debug_putstr("No relocation needed... "); */ + return; + } +- debug_putstr("Performing relocations... "); ++ /* debug_putstr("Performing relocations... "); */ + + /* + * Process relocations: 32 bit relocations first then 64 bit after. +@@ -296,7 +296,7 @@ static void parse_elf(void *output) + return; + } + +- debug_putstr("Parsing ELF... "); ++ /* debug_putstr("Parsing ELF... ");*/ + + phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum); + if (!phdrs) +@@ -374,7 +374,8 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, + cols = boot_params->screen_info.orig_video_cols; + + console_init(); +- debug_putstr("early console in extract_kernel\n"); ++ /* debug_putstr("early console in extract_kernel\n");*/ ++ debug_putstr("\n");debug_putstr("Enea Linux guest kernel boot start\n"); + + if (IS_ENABLED(CONFIG_X86_5LEVEL) && !l5_supported()) { + error("This linux kernel as configured requires 5-level paging\n" +@@ -386,11 +387,11 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, + free_mem_end_ptr = heap + BOOT_HEAP_SIZE; + + /* Report initial kernel position details. */ +- debug_putaddr(input_data); +- debug_putaddr(input_len); +- debug_putaddr(output); +- debug_putaddr(output_len); +- debug_putaddr(kernel_total_size); ++ /*debug_putaddr(input_data); */ ++ /*debug_putaddr(input_len); */ ++ /*debug_putaddr(output); */ ++ /*debug_putaddr(output_len); */ ++ /*debug_putaddr(kernel_total_size);*/ + + /* + * The memory hole needed for the kernel is the larger of either +@@ -423,12 +424,12 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, + error("Destination virtual address changed when not relocatable"); + #endif + +- debug_putstr("\nDecompressing Linux... "); ++ /*debug_putstr("\nDecompressing Linux... ");*/ + __decompress(input_data, input_len, NULL, NULL, output, output_len, + NULL, error); + parse_elf(output); + handle_relocations(output, output_len, virt_addr); +- debug_putstr("done.\nBooting the kernel.\n"); ++ /*debug_putstr("done.\nBooting the kernel.\n");*/ + return output; + } + +diff --git a/init/main.c b/init/main.c +index 56210eb..9e61f9d 100644 +--- a/init/main.c ++++ b/init/main.c +@@ -1025,8 +1025,10 @@ static int __ref kernel_init(void *unused) + if (!try_to_run_init_process("/sbin/init") || + !try_to_run_init_process("/etc/init") || + !try_to_run_init_process("/bin/init") || +- !try_to_run_init_process("/bin/sh")) ++ !try_to_run_init_process("/bin/sh")) { ++ printk(KERN_EMERG "Enea Linux guest kernel boot end\n"); + return 0; ++ } + + panic("No working init found. Try passing init= option to kernel. " + "See Linux Documentation/admin-guide/init.rst for guidance."); +-- +2.7.4 + diff --git a/patches/kernel_startend_msg/0001-printk-Add-Enea-Linux-host-boot-start-end-messages.patch b/patches/kernel_startend_msg/0001-printk-Add-Enea-Linux-host-boot-start-end-messages.patch new file mode 100644 index 0000000..565e689 --- /dev/null +++ b/patches/kernel_startend_msg/0001-printk-Add-Enea-Linux-host-boot-start-end-messages.patch @@ -0,0 +1,103 @@ +From 30aff2983e14dc6482dd2cd6c9a3b96db65c689e Mon Sep 17 00:00:00 2001 +From: Matei Valeanu +Date: Wed, 20 Jun 2018 09:41:46 +0200 +Subject: [PATCH] printk: Add Enea Linux host boot start/end messages + +rebased for 4.14 + +Upstream-status: Inappropriate [specific measurement] + +Signed-off-by: Adrian Calianu +Signed-off-by: Matei Valeanu +--- + arch/x86/boot/compressed/misc.c | 23 ++++++++++++----------- + init/main.c | 4 +++- + 2 files changed, 15 insertions(+), 12 deletions(-) + +diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c +index 252fee3..ecff964 100644 +--- a/arch/x86/boot/compressed/misc.c ++++ b/arch/x86/boot/compressed/misc.c +@@ -212,10 +212,10 @@ static void handle_relocations(void *output, unsigned long output_len, + delta = virt_addr - LOAD_PHYSICAL_ADDR; + + if (!delta) { +- debug_putstr("No relocation needed... "); ++ /* debug_putstr("No relocation needed... "); */ + return; + } +- debug_putstr("Performing relocations... "); ++ /* debug_putstr("Performing relocations... "); */ + + /* + * Process relocations: 32 bit relocations first then 64 bit after. +@@ -296,7 +296,7 @@ static void parse_elf(void *output) + return; + } + +- debug_putstr("Parsing ELF... "); ++ /* debug_putstr("Parsing ELF... ");*/ + + phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum); + if (!phdrs) +@@ -374,7 +374,8 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, + cols = boot_params->screen_info.orig_video_cols; + + console_init(); +- debug_putstr("early console in extract_kernel\n"); ++ /* debug_putstr("early console in extract_kernel\n");*/ ++ debug_putstr("\n");debug_putstr("Enea Linux kernel boot start\n"); + + if (IS_ENABLED(CONFIG_X86_5LEVEL) && !l5_supported()) { + error("This linux kernel as configured requires 5-level paging\n" +@@ -386,11 +387,11 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, + free_mem_end_ptr = heap + BOOT_HEAP_SIZE; + + /* Report initial kernel position details. */ +- debug_putaddr(input_data); +- debug_putaddr(input_len); +- debug_putaddr(output); +- debug_putaddr(output_len); +- debug_putaddr(kernel_total_size); ++ /*debug_putaddr(input_data); */ ++ /*debug_putaddr(input_len); */ ++ /*debug_putaddr(output); */ ++ /*debug_putaddr(output_len); */ ++ /*debug_putaddr(kernel_total_size);*/ + + /* + * The memory hole needed for the kernel is the larger of either +@@ -423,12 +424,12 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, + error("Destination virtual address changed when not relocatable"); + #endif + +- debug_putstr("\nDecompressing Linux... "); ++ /*debug_putstr("\nDecompressing Linux... ");*/ + __decompress(input_data, input_len, NULL, NULL, output, output_len, + NULL, error); + parse_elf(output); + handle_relocations(output, output_len, virt_addr); +- debug_putstr("done.\nBooting the kernel.\n"); ++ /*debug_putstr("done.\nBooting the kernel.\n");*/ + return output; + } + +diff --git a/init/main.c b/init/main.c +index 56210eb..9e61f9d 100644 +--- a/init/main.c ++++ b/init/main.c +@@ -1025,8 +1025,10 @@ static int __ref kernel_init(void *unused) + if (!try_to_run_init_process("/sbin/init") || + !try_to_run_init_process("/etc/init") || + !try_to_run_init_process("/bin/init") || +- !try_to_run_init_process("/bin/sh")) ++ !try_to_run_init_process("/bin/sh")) { ++ printk(KERN_EMERG "Enea Linux kernel boot end\n"); + return 0; ++ } + + panic("No working init found. Try passing init= option to kernel. " + "See Linux Documentation/admin-guide/init.rst for guidance."); +-- +2.7.4 + diff --git a/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-boot-start-end-messages.patch b/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-boot-start-end-messages.patch deleted file mode 100644 index 0fa8756..0000000 --- a/patches/kernel_startend_msg/0001-printk-add-Enea-Linux-boot-start-end-messages.patch +++ /dev/null @@ -1,95 +0,0 @@ -From b91730ba705d151577974d5fb9f5371a4569b467 Mon Sep 17 00:00:00 2001 -From: Adrian Calianu -Date: Tue, 6 Jun 2017 15:47:54 +0200 -Subject: [PATCH 1/1] printk: add Enea Linux boot start/end messages - -Signed-off-by: Adrian Calianu ---- - arch/x86/boot/compressed/misc.c | 23 ++++++++++++----------- - init/main.c | 4 +++- - 2 files changed, 15 insertions(+), 12 deletions(-) - -diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c -index b3c5a5f0..9fdf3c6 100644 ---- a/arch/x86/boot/compressed/misc.c -+++ b/arch/x86/boot/compressed/misc.c -@@ -202,10 +202,10 @@ static void handle_relocations(void *output, unsigned long output_len, - delta = virt_addr - LOAD_PHYSICAL_ADDR; - - if (!delta) { -- debug_putstr("No relocation needed... "); -+ /* debug_putstr("No relocation needed... "); */ - return; - } -- debug_putstr("Performing relocations... "); -+ /* debug_putstr("Performing relocations... "); */ - - /* - * Process relocations: 32 bit relocations first then 64 bit after. -@@ -286,7 +286,7 @@ static void parse_elf(void *output) - return; - } - -- debug_putstr("Parsing ELF... "); -+ /* debug_putstr("Parsing ELF... ");*/ - - phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum); - if (!phdrs) -@@ -360,17 +360,18 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, - cols = boot_params->screen_info.orig_video_cols; - - console_init(); -- debug_putstr("early console in extract_kernel\n"); -+ /* debug_putstr("early console in extract_kernel\n");*/ -+ debug_putstr("\n");debug_putstr("Enea Linux kernel boot start\n"); - - free_mem_ptr = heap; /* Heap */ - free_mem_end_ptr = heap + BOOT_HEAP_SIZE; - - /* Report initial kernel position details. */ -- debug_putaddr(input_data); -- debug_putaddr(input_len); -- debug_putaddr(output); -- debug_putaddr(output_len); -- debug_putaddr(kernel_total_size); -+ /*debug_putaddr(input_data); */ -+ /*debug_putaddr(input_len); */ -+ /*debug_putaddr(output); */ -+ /*debug_putaddr(output_len); */ -+ /*debug_putaddr(kernel_total_size);*/ - - /* - * The memory hole needed for the kernel is the larger of either -@@ -401,11 +402,11 @@ asmlinkage __visible void *extract_kernel(void *rmode, memptr heap, - error("Destination virtual address changed when not relocatable"); - #endif - -- debug_putstr("\nDecompressing Linux... "); -+ /*debug_putstr("\nDecompressing Linux... ");*/ - __decompress(input_data, input_len, NULL, NULL, output, output_len, - NULL, error); - parse_elf(output); - handle_relocations(output, output_len, virt_addr); -- debug_putstr("done.\nBooting the kernel.\n"); -+ /*debug_putstr("done.\nBooting the kernel.\n");*/ - return output; - } -diff --git a/init/main.c b/init/main.c -index 8358cbe..613caa1 100644 ---- a/init/main.c -+++ b/init/main.c -@@ -976,8 +976,10 @@ static int __ref kernel_init(void *unused) - if (!try_to_run_init_process("/sbin/init") || - !try_to_run_init_process("/etc/init") || - !try_to_run_init_process("/bin/init") || -- !try_to_run_init_process("/bin/sh")) -+ !try_to_run_init_process("/bin/sh")) { -+ printk(KERN_EMERG "Enea Linux kernel boot end\n"); - return 0; -+ } - - panic("No working init found. Try passing init= option to kernel. " - "See Linux Documentation/init.txt for guidance."); --- -2.7.4 - diff --git a/patches/kernel_startend_msg/kernel_guest_startend_msg.scc b/patches/kernel_startend_msg/kernel_guest_startend_msg.scc new file mode 100644 index 0000000..e7a1bec --- /dev/null +++ b/patches/kernel_startend_msg/kernel_guest_startend_msg.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Enable the kernel to output messages when it starts and ends booting" +define KFEATURE_COMPATIBILITY all + +patch 0001-printk-Add-Enea-Linux-guest-boot-start-end-messages.patch diff --git a/patches/kernel_startend_msg/kernel_host_startend_msg.scc b/patches/kernel_startend_msg/kernel_host_startend_msg.scc new file mode 100644 index 0000000..861a936 --- /dev/null +++ b/patches/kernel_startend_msg/kernel_host_startend_msg.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Enable the kernel to output messages when it starts and ends booting" +define KFEATURE_COMPATIBILITY all + +patch 0001-printk-Add-Enea-Linux-host-boot-start-end-messages.patch diff --git a/patches/kernel_startend_msg/kernel_startend_msg.scc b/patches/kernel_startend_msg/kernel_startend_msg.scc deleted file mode 100644 index e6da49c..0000000 --- a/patches/kernel_startend_msg/kernel_startend_msg.scc +++ /dev/null @@ -1,4 +0,0 @@ -define KFEATURE_DESCRIPTION "Enable the kernel to output messages when it starts and ends booting" -define KFEATURE_COMPATIBILITY all - -patch 0001-printk-add-Enea-Linux-boot-start-end-messages.patch -- cgit v1.2.3-54-g00ecf