From: "yang.zhang" <gaoshanliukou@163.com>
To: ebiederm@xmission.com
Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
"yang.zhang" <yang.zhang@hexintek.com>
Subject: [PATCH] kexec: should use uchunk for user buffer increasing
Date: Tue, 30 Jan 2024 18:18:02 +0800 [thread overview]
Message-ID: <20240130101802.23850-1-gaoshanliukou@163.com> (raw)
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
next reply other threads:[~2024-01-30 10:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 10:18 yang.zhang [this message]
2024-02-04 7:38 ` [PATCH] kexec: should use uchunk for user buffer increasing Baoquan He
2024-02-05 12:27 ` Eric W. Biederman
2024-02-05 12:59 ` Baoquan He
2024-02-19 2:00 ` yang.zhang
2024-02-19 2:38 ` Baoquan He
2024-02-19 9:26 ` yang.zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240130101802.23850-1-gaoshanliukou@163.com \
--to=gaoshanliukou@163.com \
--cc=ebiederm@xmission.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yang.zhang@hexintek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).