Skip to contentSkip to conversation

reserved crash memory above #define DEFAULT_BZIMAGE_ADDR_MAX 0x37FFFFFF

PATCH Thomas Renninger 2 participants 2 messages Apr 17, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,

while trying to switch to kvm setup with a latest kernel I realized that blank:
crashkernel=64M
param will reserve this memory area:
7b000000-7effffff : Crash kernel

and kexec does not successfully load the kernel due to (hole_max output added myself):
Could not find a free area of memory of 4c1000 bytes, hole_max: 0x37ffffff... locate_hole failed

Defining the place where to set crashmemory area:
crashkernel=64M@32M
02000000-05ffffff : Crash kernel

works.

I finally found out that in kexec-tools include/x86/x86-linux.h:
#define DEFAULT_BZIMAGE_ADDR_MAX 0x37FFFFFF
is defined and it looks like new kernels try to place the crashmemory area too high.

So the kexec-tools max physical address seem to be 0x37FFFFFF while the kernel seem to search a free region for crash kernel reservation up to MAX_MEM.
Damn, after doing a git pull, I run into an other unrelated bug and I could not quickly test below which I think could fix this (copy and pasted):

arch/x86/kernel/setup.c +0 -0
@@ -511,7 +511,8 @@ static void __init 

memblock_x86_reserve_range_setup_data(void)
#ifdef CONFIG_X86_32

 # define CRASH_KERNEL_ADDR_MAX (512 << 20)
 #else
-# define CRASH_KERNEL_ADDR_MAX MAXMEM
+# define KEXEC_BZIMAGE_MAX_ADDR 0x37FFFFFF
+# define CRASH_KERNEL_ADDR_MAX KEXEC_BZIMAGE_MAX_ADDR
 #endif

So I see no error/warning when crashkernel area is reserved in dmesg:
Reserving 64MB of memory at 1968MB for crashkernel (System RAM: 2047MB) but it won't work.

Thomas

kexec backtrace from the error message in add_buffer.
(gdb) bt
#0 locate_hole (info=0x7fffffffe0b0, hole_size=4984832, hole_align=16777216,

    hole_min=1048576, hole_max=939524095, hole_end=1) at kexec/kexec.c:290
#1  0x0000000000402d40 in add_buffer_phys_virt (info=0x7fffffffe0b0, 
    buf=0x7ffff6a19410, bufsz=4982070, memsz=4984832, buf_align=16777216, 
    buf_min=1048576, buf_max=939524095, buf_end=1, phys=0) at 
kexec/kexec.c:372
#2  0x0000000000402dee in add_buffer_virt (info=0x7fffffffe0b0, 
    buf=0x7ffff6a19410, bufsz=4982070, memsz=4982070, buf_align=16777216, 
    buf_min=1048576, buf_max=939524095, buf_end=1) at kexec/kexec.c:386
#3  0x000000000040ae7d in add_buffer (info=0x7fffffffe0b0, buf=0x7ffff6a19410, 
    bufsz=4982070, memsz=4982070, buf_align=16777216, buf_min=1048576, 
    buf_max=939524095, buf_end=1) at kexec/add_buffer.c:12
#4  0x000000000040bfb8 in do_bzImage_load (info=0x7fffffffe0b0, 
    kernel=0x7ffff6a15010 "MZ\352\a", kernel_len=4999478, 
    command_line=0x63d120 " root=UUID=f998139a-57d9-422d-af05-159d4e1187ab 
sysrq_always_enabled panic=10 console=ttyS0,115200 resume=/dev/vda1  quiet  
rd_NO_PLYMOUTH transparent_hugepage=never elevator=deadline sysrq=1 
reset_de"..., 
    command_line_len=276, initrd=0x7ffff4b34010 "\037\213\b", 
    initrd_len=32374921, real_mode_entry=0)
    at kexec/arch/i386/kexec-bzImage.c:286
#5  0x000000000040c5ca in bzImage_load (argc=6, argv=0x7fffffffe318, 
    buf=0x7ffff6a15010 "MZ\352\a", len=4999478, info=0x7fffffffe0b0)
    at kexec/arch/i386/kexec-bzImage.c:447
#6  0x0000000000403cf1 in my_load (type=0x0, fileind=5, argc=6, 
    argv=0x7fffffffe318, kexec_flags=1, entry=0x0) at kexec/kexec.c:725
#7  0x0000000000404b7a in main (argc=6, argv=0x7fffffffe318)
    at kexec/kexec.c:1223

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw
Quoted 8 lines · Thomas Renninger

Hi,

while trying to switch to kvm setup with a latest kernel I realized that blank:
crashkernel=64M
param will reserve this memory area:
7b000000-7effffff : Crash kernel

Quoted 4 lines

and kexec does not successfully load the kernel due to (hole_max output added myself):
Could not find a free area of memory of 4c1000 bytes, hole_max: 0x37ffffff... locate_hole failed

https://patchwork.kernel.org/patch/2447581/
https://patchwork.kernel.org/patch/2447561/
https://patchwork.kernel.org/patch/2447571/
https://patchwork.kernel.org/patch/2447591/

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec