summaryrefslogtreecommitdiff
path: root/kexec/arch/arm/kexec-zImage-arm.c
diff options
context:
space:
mode:
authorWang Nan <wangnan0@huawei.com>2014-03-20 10:36:32 +0800
committerSimon Horman <horms@verge.net.au>2014-03-20 12:50:35 +0900
commit3ff075747fe34d5ce244d6c6ad65ef1417d53943 (patch)
treec3e0f901b069553249913c801a2787f3f148a5d5 /kexec/arch/arm/kexec-zImage-arm.c
parent4533baa7ce3f7a8bec0635faff8f899122d4c535 (diff)
kexec: align initrd when no --image-size passed
Before this patch, when no --image-size passed, initrd_base is caculated using base + len * 4, which is unaligned, and unable to pass check in add_segment_phys_virt(): if (base & (pagesize -1)) { die("Base address: 0x%lx is not page aligned\n", base); } This patch also uses getpagesize() instead of hard encoded 4096. Signed-off-by: Wang Nan <wangnan0@huawei.com> Acked-by: Dave Young <dyoung@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/arm/kexec-zImage-arm.c')
-rw-r--r--kexec/arch/arm/kexec-zImage-arm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c
index 792187a..8a35018 100644
--- a/kexec/arch/arm/kexec-zImage-arm.c
+++ b/kexec/arch/arm/kexec-zImage-arm.c
@@ -347,11 +347,11 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len,
/* If the image size was passed as command line argument,
* use that value for determining the address for initrd,
* atags and dtb images. page-align the given length.*/
- initrd_base = base + _ALIGN(kexec_arm_image_size, 4096);
+ initrd_base = base + _ALIGN(kexec_arm_image_size, getpagesize());
} else {
/* Otherwise, assume the maximum kernel compression ratio
* is 4, and just to be safe, place ramdisk after that */
- initrd_base = base + len * 4;
+ initrd_base = base + _ALIGN(len * 4, getpagesize());
}
if (use_atags) {