Skip to content

Commit 3b96784

Browse files
Vasily GorbikMartin Schwidefsky
authored andcommitted
s390/ipl: correct kdump reipl block checksum calculation
s390 kdump reipl implementation relies on os_info kernel structure residing in old memory being dumped. os_info contains reipl block, which is used (if valid) by the kdump kernel for reipl parameters. The problem is that the reipl block and its checksum inside os_info is updated only when /sys/firmware/reipl/reipl_type is written. This sets an offset of a reipl block for "reipl_type" and re-calculates reipl block checksum. Any further alteration of values under /sys/firmware/reipl/{reipl_type}/ without subsequent write to /sys/firmware/reipl/reipl_type lead to incorrect os_info reipl block checksum. In such a case kdump kernel ignores it and reboots using default logic. To fix this, os_info reipl block update is moved right before kdump execution. Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 0649685 commit 3b96784

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

arch/s390/include/asm/ipl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ struct ipl_info
120120

121121
extern struct ipl_info ipl_info;
122122
extern void setup_ipl(void);
123+
extern void set_os_info_reipl_block(void);
123124

124125
/*
125126
* DIAG 308 support

arch/s390/kernel/ipl.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -913,11 +913,10 @@ static struct attribute_group reipl_nss_attr_group = {
913913
.attrs = reipl_nss_attrs,
914914
};
915915

916-
static void set_reipl_block_actual(struct ipl_parameter_block *reipl_block)
916+
void set_os_info_reipl_block(void)
917917
{
918-
reipl_block_actual = reipl_block;
919918
os_info_entry_add(OS_INFO_REIPL_BLOCK, reipl_block_actual,
920-
reipl_block->hdr.len);
919+
reipl_block_actual->hdr.len);
921920
}
922921

923922
/* reipl type */
@@ -930,18 +929,18 @@ static int reipl_set_type(enum ipl_type type)
930929
switch(type) {
931930
case IPL_TYPE_CCW:
932931
reipl_method = REIPL_METHOD_CCW_DIAG;
933-
set_reipl_block_actual(reipl_block_ccw);
932+
reipl_block_actual = reipl_block_ccw;
934933
break;
935934
case IPL_TYPE_FCP:
936935
reipl_method = REIPL_METHOD_FCP_DIAG;
937-
set_reipl_block_actual(reipl_block_fcp);
936+
reipl_block_actual = reipl_block_fcp;
938937
break;
939938
case IPL_TYPE_FCP_DUMP:
940939
reipl_method = REIPL_METHOD_FCP_DUMP;
941940
break;
942941
case IPL_TYPE_NSS:
943942
reipl_method = REIPL_METHOD_NSS_DIAG;
944-
set_reipl_block_actual(reipl_block_nss);
943+
reipl_block_actual = reipl_block_nss;
945944
break;
946945
case IPL_TYPE_UNKNOWN:
947946
reipl_method = REIPL_METHOD_DEFAULT;

arch/s390/kernel/machine_kexec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ void machine_shutdown(void)
252252

253253
void machine_crash_shutdown(struct pt_regs *regs)
254254
{
255+
set_os_info_reipl_block();
255256
}
256257

257258
/*

0 commit comments

Comments
 (0)