[PATCH] kexec: loongarch: fix load command line segment error

Ming Wang wangming01 at loongson.cn
Sun May 19 18:45:53 PDT 2024


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 at loongson.cn>
Signed-off-by: Ming Wang <wangming01 at loongson.cn>
---
 kexec/arch/loongarch/kexec-loongarch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/arch/loongarch/kexec-loongarch.c b/kexec/arch/loongarch/kexec-loongarch.c
index f00027c..ac75030 100644
--- a/kexec/arch/loongarch/kexec-loongarch.c
+++ b/kexec/arch/loongarch/kexec-loongarch.c
@@ -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);
 

base-commit: 2a3e54e9f734ce08dee20b4ff1bdd5037f1b0193
prerequisite-patch-id: 773329268ca8ca42f7b6aeafce0e83aceb75888d
-- 
2.39.2




More information about the kexec mailing list