Skip to content

Commit

Permalink
kexec: loongarch: fix load command line segment error
Browse files Browse the repository at this point in the history
When kernel cmdline reserved multiple crash kernel segments, like:
"crashkernel=4G,high crashkernel=256M,low".
Cmdline segment may be loaded in locations larger than 4G of memory.
So the parameter 'buf_max' of add_buffer function should be
'hole_max'.

Signed-off-by: Hongchen Zhang <zhanghongchen@loongson.cn>
Signed-off-by: Ming Wang <wangming01@loongson.cn>
Signed-off-by: Simon Horman <horms@kernel.org>
  • Loading branch information
Ming Wang authored and horms committed Jun 3, 2024
1 parent 69ccfa1 commit 2e8a93a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kexec/arch/loongarch/kexec-loongarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ int loongarch_load_other_segments(struct kexec_info *info, unsigned long hole_mi
cmdline[sizeof(cmdline) - 1] = 0;
add_buffer(info, cmdline, sizeof(cmdline), sizeof(cmdline),
sizeof(void *), _ALIGN_UP(hole_min, getpagesize()),
0xffffffff, 1);
hole_max, 1);

dbgprintf("%s:%d: command_line: %s\n", __func__, __LINE__, cmdline);

Expand Down

0 comments on commit 2e8a93a

Please sign in to comment.