Linux kernel 使用KASLR内核feautre时,内核无法分配crashkernel内存
我正在centos6.2上运行的x86_64平台上使用4.19.149内核。 我的编译内核配置包含以下选项:Linux kernel 使用KASLR内核feautre时,内核无法分配crashkernel内存,linux-kernel,bootloader,Linux Kernel,Bootloader,我正在centos6.2上运行的x86_64平台上使用4.19.149内核。 我的编译内核配置包含以下选项: CONFIG_PHYSICAL_START=0x1000000 CONFIG_RELOCATABLE=y CONFIG_RANDOMIZE_BASE=y 我的内核命令行是: ?> cat /proc/cmdline ro root=LABEL=/ rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_MD
CONFIG_PHYSICAL_START=0x1000000
CONFIG_RELOCATABLE=y
CONFIG_RANDOMIZE_BASE=y
我的内核命令行是:
?> cat /proc/cmdline
ro root=LABEL=/ rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=512M@0M nompath append="nmi_watchdog=2" printk.time=1 rd_NO_LVM rd_NO_DM dm_mod.use_blk_mq=y rcutree.kthread_prio=99 intel_pstate=enable intel_idle.max_cstate=0 processor.max_cstate=1 idle=halt console=tty0 console=ttyS0,38400n8d
总结一下:
#define CRASH_ALIGN (16 << 20)
...
# define CRASH_ADDR_LOW_MAX (896UL << 20)
...
static void __init reserve_crashkernel(void)
....
if (crash_base <= 0) {
/*
* Set CRASH_ADDR_LOW_MAX upper bound for crash memory,
* as old kexec-tools loads bzImage below that, unless
* "crashkernel=size[KMG],high" is specified.
*/
crash_base = memblock_find_in_range(CRASH_ALIGN,
high ? CRASH_ADDR_HIGH_MAX
: CRASH_ADDR_LOW_MAX,
crash_size, CRASH_ALIGN);
if (!crash_base) {
pr_info("crashkernel reservation failed - No suitable area found.\n");
return;
}```
?> cat /proc/iomem
00000000-00000fff : Reserved
00001000-0009fbff : System RAM
0009fc00-0009ffff : Reserved
000a0000-000bffff : PCI Bus 0000:00
000f0000-000fffff : Reserved
000f0000-000fffff : System ROM
00100000-bfff9fff : System RAM
17000000-17c02fff : Kernel code
17c03000-183523ff : Kernel data
18883000-189fffff : Kernel bss
bfffa000-bfffffff : Reserved
c0000000-febfefff : PCI Bus 0000:00
febf7000-febf707f : 0000:00:03.0
febf8000-febf81ff : 0000:00:04.0
febf9000-febf91ff : 0000:00:05.0
febfa000-febfa1ff : 0000:00:06.0
febfb000-febfb1ff : 0000:00:07.0
febfc000-febfc1ff : 0000:00:08.0
febfd000-febfd1ff : 0000:00:09.0
febfe000-febfe03f : 0000:00:0a.0
fec00000-fec003ff : IOAPIC 0
fee00000-fee00fff : Local APIC
fffbc000-ffffffff : Reserved