mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 19:56:18 +00:00
[PATCH] x86-64: Handle reserve_bootmem_generic beyond end_pfn
This can happen on kexec kernels with some configurations, in particularly on Unisys ES7000 systems. Analysis by Amul Shah Cc: Amul Shah <amul.shah@unisys.com> Signed-off-by: Andi Kleen <ak@suse.de>
This commit is contained in:
parent
51d67a488b
commit
5e58a02a8f
1 changed files with 14 additions and 1 deletions
|
@ -655,9 +655,22 @@ void free_initrd_mem(unsigned long start, unsigned long end)
|
|||
|
||||
void __init reserve_bootmem_generic(unsigned long phys, unsigned len)
|
||||
{
|
||||
/* Should check here against the e820 map to avoid double free */
|
||||
#ifdef CONFIG_NUMA
|
||||
int nid = phys_to_nid(phys);
|
||||
#endif
|
||||
unsigned long pfn = phys >> PAGE_SHIFT;
|
||||
if (pfn >= end_pfn) {
|
||||
/* This can happen with kdump kernels when accessing firmware
|
||||
tables. */
|
||||
if (pfn < end_pfn_map)
|
||||
return;
|
||||
printk(KERN_ERR "reserve_bootmem: illegal reserve %lx %u\n",
|
||||
phys, len);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Should check here against the e820 map to avoid double free */
|
||||
#ifdef CONFIG_NUMA
|
||||
reserve_bootmem_node(NODE_DATA(nid), phys, len);
|
||||
#else
|
||||
reserve_bootmem(phys, len);
|
||||
|
|
Loading…
Reference in a new issue