summaryrefslogtreecommitdiff
path: root/arch/s390/kernel/setup.c
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2024-11-20 21:46:17 +0100
committerAlexander Gordeev <agordeev@linux.ibm.com>2025-01-26 17:24:01 +0100
commitc09f8d0ad673afdfd5d097d95d2026a84fa4926e (patch)
tree4f802571b390d956d9ee1435a95437b4b9c1de2c /arch/s390/kernel/setup.c
parent847e5a4c713747e8c0e9e25bda00aea782d1062b (diff)
s390/boot: Defer boot messages when earlyprintk is not enabled
When earlyprintk is not specified, boot messages are only stored in a ring buffer to be printed later by printk when console driver is registered. Critical messages from boot_emerg() are always printed immediately, even without earlyprintk. Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/setup.c')
-rw-r--r--arch/s390/kernel/setup.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 0ce550faf073..feff1bb9ac2d 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -157,6 +157,10 @@ u64 __bootdata_preserved(stfle_fac_list[16]);
EXPORT_SYMBOL(stfle_fac_list);
struct oldmem_data __bootdata_preserved(oldmem_data);
+char __bootdata(boot_rb)[PAGE_SIZE * 2];
+bool __bootdata(boot_earlyprintk);
+size_t __bootdata(boot_rb_off);
+
unsigned long __bootdata_preserved(VMALLOC_START);
EXPORT_SYMBOL(VMALLOC_START);
@@ -878,6 +882,17 @@ static void __init log_component_list(void)
}
/*
+ * Print avoiding interpretation of % in buf
+ */
+static void __init print_rb_entry(char *buf)
+{
+ char fmt[] = KERN_SOH "0boot: %s";
+
+ fmt[1] = printk_get_level(buf);
+ printk(fmt, printk_skip_level(buf));
+}
+
+/*
* Setup function called from init/main.c just after the banner
* was printed.
*/
@@ -896,6 +911,9 @@ void __init setup_arch(char **cmdline_p)
pr_info("Linux is running natively in 64-bit mode\n");
else
pr_info("Linux is running as a guest in 64-bit mode\n");
+ /* Print decompressor messages if not already printed */
+ if (!boot_earlyprintk)
+ boot_rb_foreach(print_rb_entry);
if (have_relocated_lowcore())
pr_info("Lowcore relocated to 0x%px\n", get_lowcore());