Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Hua <sdu.liu@huawei.com>
To: horms@verge.net.au
Cc: wangnan0@huawei.com, kexec@lists.infradead.org,
	peifeiyue@huawei.com, Liu Hua <sdu.liu@huawei.com>
Subject: [PATCH] kexec: align the extended size of dtb
Date: Wed, 23 Jul 2014 19:20:34 +0800	[thread overview]
Message-ID: <1406114434-77987-1-git-send-email-sdu.liu@huawei.com> (raw)

When loading dtb on arm platform, we may need change strings in dtb
in function setup_dtb_prop. If length of new string is larger than that
of the old one. We should extend the dtb by "FDT_TAGALIGN"ed size.
If not, kexec may fail to load the capture kernel.

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
---
 kexec/arch/arm/kexec-zImage-arm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
index 44b87bb..ff4e38d 100644
--- a/kexec/arch/arm/kexec-zImage-arm.c
+++ b/kexec/arch/arm/kexec-zImage-arm.c
@@ -259,7 +259,7 @@ static int setup_dtb_prop(char **bufp, off_t *sizep, const char *node_name,
 		dtb_size += fdt_prop_len(prop_name, len);
 	} else {
 		if (prop_len < len)
-			dtb_size += len - prop_len;
+			dtb_size += FDT_TAGALIGN(len - prop_len);
 	}
 
 	if (fdt_totalsize(dtb_buf) < dtb_size) {
-- 
1.9.0


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

             reply	other threads:[~2014-07-23 11:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23 11:20 Liu Hua [this message]
2014-07-24  8:12 ` [PATCH] kexec: align the extended size of dtb Simon Horman

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=1406114434-77987-1-git-send-email-sdu.liu@huawei.com \
    --to=sdu.liu@huawei.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=peifeiyue@huawei.com \
    --cc=wangnan0@huawei.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