All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kexec: should use uchunk for user buffer increasing
@ 2024-01-30 10:18 ` yang.zhang
  0 siblings, 0 replies; 14+ messages in thread
From: yang.zhang @ 2024-01-30 10:18 UTC (permalink / raw)
  To: ebiederm; +Cc: kexec, linux-kernel, yang.zhang

From: "yang.zhang" <yang.zhang@hexintek.com>

Because of alignment requirement in kexec-tools, there is
no problem for user buffer increasing when loading segments.
But when coping, the step is uchunk, so we should use uchunk
not mchunk.

Signed-off-by: yang.zhang <yang.zhang@hexintek.com>
---
 kernel/kexec_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index d08fc7b5db97..2b8354313c85 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -813,9 +813,9 @@ static int kimage_load_normal_segment(struct kimage *image,
 		ubytes -= uchunk;
 		maddr  += mchunk;
 		if (image->file_mode)
-			kbuf += mchunk;
+			kbuf += uchunk;
 		else
-			buf += mchunk;
+			buf += uchunk;
 		mbytes -= mchunk;
 
 		cond_resched();
@@ -881,9 +881,9 @@ static int kimage_load_crash_segment(struct kimage *image,
 		ubytes -= uchunk;
 		maddr  += mchunk;
 		if (image->file_mode)
-			kbuf += mchunk;
+			kbuf += uchunk;
 		else
-			buf += mchunk;
+			buf += uchunk;
 		mbytes -= mchunk;
 
 		cond_resched();
-- 
2.34.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-02-19  9:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-30 10:18 [PATCH] kexec: should use uchunk for user buffer increasing yang.zhang
2024-01-30 10:18 ` yang.zhang
2024-02-04  7:38 ` Baoquan He
2024-02-04  7:38   ` Baoquan He
2024-02-05 12:27   ` Eric W. Biederman
2024-02-05 12:27     ` Eric W. Biederman
2024-02-05 12:59     ` Baoquan He
2024-02-05 12:59       ` Baoquan He
2024-02-19  2:00     ` yang.zhang
2024-02-19  2:00       ` yang.zhang
2024-02-19  2:38       ` Baoquan He
2024-02-19  2:38         ` Baoquan He
2024-02-19  9:26         ` yang.zhang
2024-02-19  9:26           ` yang.zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.