Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Nan <wangnan0@huawei.com>
To: Dave Young <dyoung@redhat.com>
Cc: Simon Horman <horms@verge.net.au>,
	kexec@lists.infradead.org, Geng Hui <hui.geng@huawei.com>
Subject: Re: [PATCH 2/2] kexec: pass initrd position in dtb
Date: Thu, 20 Mar 2014 11:57:25 +0800	[thread overview]
Message-ID: <532A6725.3010903@huawei.com> (raw)
In-Reply-To: <20140320033459.GC4722@dhcp-16-126.nay.redhat.com>

On 2014/3/20 11:34, Dave Young wrote:
> On 03/20/14 at 11:26am, Dave Young wrote:
>> On 03/20/14 at 10:36am, Wang Nan wrote:
>>> This patch append the position of initrd to dtb when loading arm kernel
>>> and initrd without using atag.
>>>
>>> Signed-off-by: Wang Nan <wangnan0@huawei.com>
>>> Cc: Simon Horman <horms@verge.net.au>
>>> Cc: Dave Young <dyoung@redhat.com>
>>> Cc: Geng Hui <hui.geng@huawei.com>
>>> ---
>>>  kexec/arch/arm/kexec-zImage-arm.c | 84 +++++++++++++++++++++++++++------------
>>>  1 file changed, 59 insertions(+), 25 deletions(-)
>>>
>>> diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
>>> index 8a35018..15d8829 100644
>>> --- a/kexec/arch/arm/kexec-zImage-arm.c
>>> +++ b/kexec/arch/arm/kexec-zImage-arm.c
>>> @@ -20,6 +20,7 @@
>>>  #include "kexec-arm.h"
>>>  #include "../../fs2dt.h"
>>>  #include "crashdump-arm.h"
>>> +#include "libfdt_internal.h"
>>
>> I guess it's for the FDT_TAGALIGN and FDT_TAGSIZE?
>> libfdt_internal.h should be used as internal header for libfdt, a better way is
>> adding another patch which move these 2 macros to fdt.h
> 
> Or moving your new function setup_dtb_prop to libfdt, I'm not sure if it works on
> other arch though.
> 
>> Thanks
>> Dave


What about following midification (FDT_TAGSIZE is in fdt.h)?
I'll send it formally if you agree this one.

diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
index 15d8829..1cd4ed0 100644
--- a/kexec/arch/arm/kexec-zImage-arm.c
+++ b/kexec/arch/arm/kexec-zImage-arm.c
@@ -20,7 +20,6 @@
 #include "kexec-arm.h"
 #include "../../fs2dt.h"
 #include "crashdump-arm.h"
-#include "libfdt_internal.h"

 #define BOOT_PARAMS_SIZE 1536

@@ -229,8 +228,8 @@ static int setup_dtb_prop(char **bufp, off_t *sizep, const char *node_name,
        dtb_buf = *bufp;

        *sizep = fdt_totalsize(*bufp) + FDT_TAGSIZE + len +
-               FDT_TAGALIGN(strlen(node_name) + 1) +
-               FDT_TAGALIGN(strlen(prop_name) + 1) +
+               _ALIGN(strlen(node_name) + 1, FDT_TAGSIZE) +
+               _ALIGN(strlen(prop_name) + 1, FDT_TAGSIZE) +
                sizeof(struct fdt_property);

        dtb_buf = xrealloc(dtb_buf, *sizep);


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

  reply	other threads:[~2014-03-20  3:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-20  2:36 [PATCH 0/2] Two patches for kexec for arm Wang Nan
2014-03-20  2:36 ` [PATCH 1/2] kexec: align initrd when no --image-size passed Wang Nan
2014-03-20  3:25   ` Dave Young
2014-03-20  3:51     ` Simon Horman
2014-03-20  2:36 ` [PATCH 2/2] kexec: pass initrd position in dtb Wang Nan
2014-03-20  3:26   ` Dave Young
2014-03-20  3:34     ` Dave Young
2014-03-20  3:57       ` Wang Nan [this message]
2014-03-20  5:37         ` Dave Young
2014-03-20  5:41         ` Dave Young

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=532A6725.3010903@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=dyoung@redhat.com \
    --cc=horms@verge.net.au \
    --cc=hui.geng@huawei.com \
    --cc=kexec@lists.infradead.org \
    /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