Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/boot: Replace boot_printk() with loglevel-specific helpers

Replaces boot_printk() calls with appropriate loglevel-specific helpers
such as boot_emerg(), boot_warn(), and boot_debug().

Using functions with explicit log levels improves log clarity and aligns
the boot code with standard kernel logging practices. This makes it
easier to filter and manage boot-time messages based on their severity.

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>

authored by

Vasily Gorbik and committed by
Alexander Gordeev
42fc158c d538fdc4

+48 -48
+5 -5
arch/s390/boot/als.c
··· 46 46 * z/VM adds a four character prefix. 47 47 */ 48 48 if (strlen(als_str) > 70) { 49 - boot_printk("%s\n", als_str); 49 + boot_emerg("%s\n", als_str); 50 50 *als_str = '\0'; 51 51 } 52 52 u16_to_decimal(val_str, i * BITS_PER_LONG + j); ··· 54 54 first = 0; 55 55 } 56 56 } 57 - boot_printk("%s\n", als_str); 57 + boot_emerg("%s\n", als_str); 58 58 } 59 59 60 60 static void facility_mismatch(void) ··· 62 62 struct cpuid id; 63 63 64 64 get_cpu_id(&id); 65 - boot_printk("The Linux kernel requires more recent processor hardware\n"); 66 - boot_printk("Detected machine-type number: %4x\n", id.machine); 65 + boot_emerg("The Linux kernel requires more recent processor hardware\n"); 66 + boot_emerg("Detected machine-type number: %4x\n", id.machine); 67 67 print_missing_facilities(); 68 - boot_printk("See Principles of Operations for facility bits\n"); 68 + boot_emerg("See Principles of Operations for facility bits\n"); 69 69 disabled_wait(); 70 70 } 71 71
+1 -1
arch/s390/boot/ipl_parm.c
··· 215 215 216 216 for (i = 0; i < ARRAY_SIZE(als); i++) { 217 217 if ((stfle_fac_list[i] & als[i]) != als[i]) { 218 - boot_printk("Warning: The Linux kernel requires facilities cleared via command line option\n"); 218 + boot_emerg("The Linux kernel requires facilities cleared via command line option\n"); 219 219 print_missing_facilities(); 220 220 break; 221 221 }
+1 -1
arch/s390/boot/kaslr.c
··· 32 32 static int check_prng(void) 33 33 { 34 34 if (!cpacf_query_func(CPACF_KMC, CPACF_KMC_PRNG)) { 35 - boot_printk("KASLR disabled: CPU has no PRNG\n"); 35 + boot_warn("KASLR disabled: CPU has no PRNG\n"); 36 36 return 0; 37 37 } 38 38 if (cpacf_query_func(CPACF_PRNO, CPACF_PRNO_TRNG))
+25 -26
arch/s390/boot/pgm_check_info.c
··· 17 17 (unsigned long)_stack_end }; 18 18 bool first = true; 19 19 20 - boot_printk("Call Trace:\n"); 20 + boot_emerg("Call Trace:\n"); 21 21 while (!(sp & 0x7) && on_stack(&boot_stack, sp, sizeof(struct stack_frame))) { 22 22 struct stack_frame *sf = (struct stack_frame *)sp; 23 23 24 - boot_printk(first ? "(sp:%016lx [<%016lx>] %pS)\n" : 25 - " sp:%016lx [<%016lx>] %pS\n", 26 - sp, sf->gprs[8], (void *)sf->gprs[8]); 24 + if (first) 25 + boot_emerg("(sp:%016lx [<%016lx>] %pS)\n", sp, sf->gprs[8], (void *)sf->gprs[8]); 26 + else 27 + boot_emerg(" sp:%016lx [<%016lx>] %pS\n", sp, sf->gprs[8], (void *)sf->gprs[8]); 27 28 if (sf->back_chain <= sp) 28 29 break; 29 30 sp = sf->back_chain; ··· 37 36 unsigned long *gpregs = (unsigned long *)get_lowcore()->gpregs_save_area; 38 37 struct psw_bits *psw = &psw_bits(get_lowcore()->psw_save_area); 39 38 40 - boot_printk("Linux version %s\n", kernel_version); 39 + boot_emerg("Linux version %s\n", kernel_version); 41 40 if (!is_prot_virt_guest() && early_command_line[0]) 42 - boot_printk("Kernel command line: %s\n", early_command_line); 43 - boot_printk("Kernel fault: interruption code %04x ilc:%x\n", 44 - get_lowcore()->pgm_code, get_lowcore()->pgm_ilc >> 1); 41 + boot_emerg("Kernel command line: %s\n", early_command_line); 42 + boot_emerg("Kernel fault: interruption code %04x ilc:%x\n", 43 + get_lowcore()->pgm_code, get_lowcore()->pgm_ilc >> 1); 45 44 if (kaslr_enabled()) { 46 - boot_printk("Kernel random base: %lx\n", __kaslr_offset); 47 - boot_printk("Kernel random base phys: %lx\n", __kaslr_offset_phys); 45 + boot_emerg("Kernel random base: %lx\n", __kaslr_offset); 46 + boot_emerg("Kernel random base phys: %lx\n", __kaslr_offset_phys); 48 47 } 49 - boot_printk("PSW : %016lx %016lx (%pS)\n", 50 - get_lowcore()->psw_save_area.mask, 51 - get_lowcore()->psw_save_area.addr, 52 - (void *)get_lowcore()->psw_save_area.addr); 53 - boot_printk( 54 - " R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x P:%x AS:%x CC:%x PM:%x RI:%x EA:%x\n", 55 - psw->per, psw->dat, psw->io, psw->ext, psw->key, psw->mcheck, 56 - psw->wait, psw->pstate, psw->as, psw->cc, psw->pm, psw->ri, 57 - psw->eaba); 58 - boot_printk("GPRS: %016lx %016lx %016lx %016lx\n", gpregs[0], gpregs[1], gpregs[2], gpregs[3]); 59 - boot_printk(" %016lx %016lx %016lx %016lx\n", gpregs[4], gpregs[5], gpregs[6], gpregs[7]); 60 - boot_printk(" %016lx %016lx %016lx %016lx\n", gpregs[8], gpregs[9], gpregs[10], gpregs[11]); 61 - boot_printk(" %016lx %016lx %016lx %016lx\n", gpregs[12], gpregs[13], gpregs[14], gpregs[15]); 48 + boot_emerg("PSW : %016lx %016lx (%pS)\n", 49 + get_lowcore()->psw_save_area.mask, 50 + get_lowcore()->psw_save_area.addr, 51 + (void *)get_lowcore()->psw_save_area.addr); 52 + boot_emerg(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x P:%x AS:%x CC:%x PM:%x RI:%x EA:%x\n", 53 + psw->per, psw->dat, psw->io, psw->ext, psw->key, psw->mcheck, 54 + psw->wait, psw->pstate, psw->as, psw->cc, psw->pm, psw->ri, psw->eaba); 55 + boot_emerg("GPRS: %016lx %016lx %016lx %016lx\n", gpregs[0], gpregs[1], gpregs[2], gpregs[3]); 56 + boot_emerg(" %016lx %016lx %016lx %016lx\n", gpregs[4], gpregs[5], gpregs[6], gpregs[7]); 57 + boot_emerg(" %016lx %016lx %016lx %016lx\n", gpregs[8], gpregs[9], gpregs[10], gpregs[11]); 58 + boot_emerg(" %016lx %016lx %016lx %016lx\n", gpregs[12], gpregs[13], gpregs[14], gpregs[15]); 62 59 print_stacktrace(get_lowcore()->gpregs_save_area[15]); 63 - boot_printk("Last Breaking-Event-Address:\n"); 64 - boot_printk(" [<%016lx>] %pS\n", (unsigned long)get_lowcore()->pgm_last_break, 65 - (void *)get_lowcore()->pgm_last_break); 60 + boot_emerg("Last Breaking-Event-Address:\n"); 61 + boot_emerg(" [<%016lx>] %pS\n", (unsigned long)get_lowcore()->pgm_last_break, 62 + (void *)get_lowcore()->pgm_last_break); 66 63 }
+13 -13
arch/s390/boot/physmem_info.c
··· 241 241 enum reserved_range_type t; 242 242 int i; 243 243 244 - boot_printk("Linux version %s\n", kernel_version); 244 + boot_emerg("Linux version %s\n", kernel_version); 245 245 if (!is_prot_virt_guest() && early_command_line[0]) 246 - boot_printk("Kernel command line: %s\n", early_command_line); 247 - boot_printk("Out of memory allocating %lx bytes %lx aligned in range %lx:%lx\n", 248 - size, align, min, max); 249 - boot_printk("Reserved memory ranges:\n"); 246 + boot_emerg("Kernel command line: %s\n", early_command_line); 247 + boot_emerg("Out of memory allocating %lx bytes %lx aligned in range %lx:%lx\n", 248 + size, align, min, max); 249 + boot_emerg("Reserved memory ranges:\n"); 250 250 for_each_physmem_reserved_range(t, range, &start, &end) { 251 - boot_printk("%016lx %016lx %s\n", start, end, get_rr_type_name(t)); 251 + boot_emerg("%016lx %016lx %s\n", start, end, get_rr_type_name(t)); 252 252 total_reserved_mem += end - start; 253 253 } 254 - boot_printk("Usable online memory ranges (info source: %s [%x]):\n", 255 - get_physmem_info_source(), physmem_info.info_source); 254 + boot_emerg("Usable online memory ranges (info source: %s [%x]):\n", 255 + get_physmem_info_source(), physmem_info.info_source); 256 256 for_each_physmem_usable_range(i, &start, &end) { 257 - boot_printk("%016lx %016lx\n", start, end); 257 + boot_emerg("%016lx %016lx\n", start, end); 258 258 total_mem += end - start; 259 259 } 260 - boot_printk("Usable online memory total: %lx Reserved: %lx Free: %lx\n", 261 - total_mem, total_reserved_mem, 262 - total_mem > total_reserved_mem ? total_mem - total_reserved_mem : 0); 260 + boot_emerg("Usable online memory total: %lx Reserved: %lx Free: %lx\n", 261 + total_mem, total_reserved_mem, 262 + total_mem > total_reserved_mem ? total_mem - total_reserved_mem : 0); 263 263 print_stacktrace(current_frame_address()); 264 - boot_printk("\n\n -- System halted\n"); 264 + boot_emerg(" -- System halted\n"); 265 265 disabled_wait(); 266 266 } 267 267
+3 -2
arch/s390/boot/startup.c
··· 42 42 43 43 void error(char *x) 44 44 { 45 - boot_printk("\n\n%s\n\n -- System halted", x); 45 + boot_emerg("%s\n", x); 46 + boot_emerg(" -- System halted\n"); 46 47 disabled_wait(); 47 48 } 48 49 ··· 306 305 kernel_start = round_down(kernel_end - kernel_size, THREAD_SIZE); 307 306 } else if (vmax < __NO_KASLR_END_KERNEL || vsize > __NO_KASLR_END_KERNEL) { 308 307 kernel_start = round_down(vmax - kernel_size, THREAD_SIZE); 309 - boot_printk("The kernel base address is forced to %lx\n", kernel_start); 308 + boot_debug("The kernel base address is forced to %lx\n", kernel_start); 310 309 } else { 311 310 kernel_start = __NO_KASLR_START_KERNEL; 312 311 }