Skip to content

Commit 9af310e

Browse files
Vasily GorbikAlexander Gordeev
authored andcommitted
s390/boot: Improve decompression error reporting
Currently, decompression error messages can be very uninformative: [ 0.029853] startup: read error [ 0.040507] startup: -- System halted Improve these messages to make it clear that the error originates from the decompression code. Additionally, on decompression failures, if bootdebug is enabled, dump the message ring buffer before halting. This provides more context for diagnosing startup issues. Signed-off-by: Vasily Gorbik <[email protected]> Acked-by: Heiko Carstens <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent ec6f9f7 commit 9af310e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

arch/s390/boot/decompressor.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <linux/kernel.h>
1111
#include <linux/string.h>
12+
#include <asm/boot_data.h>
1213
#include <asm/page.h>
1314
#include "decompressor.h"
1415
#include "boot.h"
@@ -63,6 +64,15 @@ static unsigned long free_mem_end_ptr = (unsigned long) _end + BOOT_HEAP_SIZE;
6364
#include "../../../../lib/decompress_unzstd.c"
6465
#endif
6566

67+
static void decompress_error(char *m)
68+
{
69+
if (bootdebug)
70+
boot_rb_dump();
71+
boot_emerg("Decompression error: %s\n", m);
72+
boot_emerg(" -- System halted\n");
73+
disabled_wait();
74+
}
75+
6676
unsigned long mem_safe_offset(void)
6777
{
6878
return ALIGN(free_mem_end_ptr, PAGE_SIZE);
@@ -71,5 +81,5 @@ unsigned long mem_safe_offset(void)
7181
void deploy_kernel(void *output)
7282
{
7383
__decompress(_compressed_start, _compressed_end - _compressed_start,
74-
NULL, NULL, output, vmlinux.image_size, NULL, error);
84+
NULL, NULL, output, vmlinux.image_size, NULL, decompress_error);
7585
}

0 commit comments

Comments
 (0)