s390/kexec: Fix checksum validation return code for kdump
Before kexec boots to a crash kernel it checks whether the image in memory changed after load. This is done by the function kdump_csum_valid, which returns true, i.e. an int != 0, on success and 0 otherwise. In other words when kdump_csum_valid returns an error code it means that the validation succeeded. This is not only counterintuitive but also produces the wrong result if the kernel was build without CONFIG_CRASH_DUMP. Fix this by making kdump_csum_valid return a bool. Signed-off-by: Philipp Rudo <prudo@linux.vnet.ibm.com> Acked-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
7f581d03bd
commit
7c3eaaa391
|
@ -144,7 +144,7 @@ static noinline void __machine_kdump(void *image)
|
||||||
/*
|
/*
|
||||||
* Check if kdump checksums are valid: We call purgatory with parameter "0"
|
* Check if kdump checksums are valid: We call purgatory with parameter "0"
|
||||||
*/
|
*/
|
||||||
static int kdump_csum_valid(struct kimage *image)
|
static bool kdump_csum_valid(struct kimage *image)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_CRASH_DUMP
|
#ifdef CONFIG_CRASH_DUMP
|
||||||
int (*start_kdump)(int) = (void *)image->start;
|
int (*start_kdump)(int) = (void *)image->start;
|
||||||
|
@ -153,9 +153,9 @@ static int kdump_csum_valid(struct kimage *image)
|
||||||
__arch_local_irq_stnsm(0xfb); /* disable DAT */
|
__arch_local_irq_stnsm(0xfb); /* disable DAT */
|
||||||
rc = start_kdump(0);
|
rc = start_kdump(0);
|
||||||
__arch_local_irq_stosm(0x04); /* enable DAT */
|
__arch_local_irq_stosm(0x04); /* enable DAT */
|
||||||
return rc ? 0 : -EINVAL;
|
return rc == 0;
|
||||||
#else
|
#else
|
||||||
return -EINVAL;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue