[PATCH] kexec-tools: mips: Fix the increased mem parameter size
Youling Tang
tangyouling at loongson.cn
Wed Mar 17 03:45:14 GMT 2021
The added "mem=size at start" parameter actually corresponds to
"crashkernel=YM at XM", but 1 byte is missing when calculating
the size, so 1 byte should be added.
For example, when using crashkernel=108M at 64M (110592K at 65536K):
Without this patch:
the mem parameter added is: mem=110591K at 65536K
With this patch:
the mem parameter added is: mem=110592K at 65536K
Fixes: 0eac64052636 ("kexec: mips: Fix mem parameters")
Signed-off-by: Youling Tang <tangyouling at loongson.cn>
---
kexec/arch/mips/crashdump-mips.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kexec/arch/mips/crashdump-mips.c b/kexec/arch/mips/crashdump-mips.c
index 56b8fe8..aa09c83 100644
--- a/kexec/arch/mips/crashdump-mips.c
+++ b/kexec/arch/mips/crashdump-mips.c
@@ -401,7 +401,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
* kernel's available memory
*/
cmdline_add_mem(mod_cmdline, crash_reserved_mem.start,
- crash_reserved_mem.end - crash_reserved_mem.start);
+ crash_reserved_mem.end - crash_reserved_mem.start + 1);
cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
dbgprintf("CRASH MEMORY RANGES:\n");
--
2.1.0
More information about the kexec
mailing list