condition check fix

In commit 91f5b9c ("kdump: pass e820 reserved region to 2nd kernel via
e820 table or setup_data"), I made a wrong condition check.

We should only add cmdline for a memory range if --pass-memmap-cmdline
and the range type isn't RANGE_RESERVED.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
zImage-arm: bugfix: kernel offset must be 0x8000

This patch fixs a problem introduced by commit e5d6a55 which make ARM
kexec fails.

Due to that commit, kernel is loaded at a dynamically offset: it computes
extra_size using size of dtb, and load zImage at base + extra_size. When
dtb size small (for example, 0x3000 bytes), kernel will be loaded at
address like 0x60003000. For ARM zImage such address is incorrect.

In kernel code arch/arm/boot/compressed/head.S, zImage builds a
temporary page table at (pc & 0xf8000000) + TEXT_OFFSET - 0x4000. The
related instructions sequence is:

 mov     r4, pc
 and     r4, r4, #0xf8000000
 add     r4, r4, #TEXT_OFFSET @ (TEXT_OFFSET == 0x8000 on most platforms)
 call cache_on
   ...
   call __armv7_mmu_cache_on
     ...
     call __setup_mmu
       sub     r3, r4, #16384          @ Page directory size

r3 becomes page table pointer.

When kernel is loaded at 0x60003000, page table is still built at
0x60004000, which destroys kernel.

This patch make extra_size a fix value (0x8000) to avoid the failure.

For the problem commit e5d6a55 tries solve, this patch uses
locate_holes() to find a place can hold initrd and dtb.

Change from v1:
 - Coding style enhancements.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
cleanup duplicate code

I accidentally add one duplicate line. Now remove it.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
zImage-arm: init modified_cmdline with zero

This patch memset modified_cmdline after it alloced.

Without this patch, the header of command line always contains random
value like following example:

kernel: 0x765fd008 kernel_size: 0x23b610
memory range: [0x60000000 - 0x6fffffff] (256M)
memory range: [0x78000000 - 0x9fffffff] (640M)
...
kernel command line: "°¥氥䐶# elfcorehdr=0x77f00000 mem=130048K"

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Geng Hui <hui.geng@huawei.com>
Signed-off-by: Simon Horman <horms@verge.net.au>