diff options
author | Andi Kleen <ak@suse.de> | 2006-11-14 10:57:46 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-11-14 10:57:46 -0500 |
commit | 5e58a02a8f6a7a1c9ae41f39286bcd3aea0d6f24 (patch) | |
tree | dc2f2a8a695a14b7360bb0870e59646b9c7fdb17 /arch/x86_64/mm/init.c | |
parent | 51d67a488b53a5cc8401460480c124eaec71e2d4 (diff) |
[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>
Diffstat (limited to 'arch/x86_64/mm/init.c')
-rw-r--r-- | arch/x86_64/mm/init.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index 971dc1181e69..f1f977aafae1 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c | |||
@@ -655,9 +655,22 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
655 | 655 | ||
656 | void __init reserve_bootmem_generic(unsigned long phys, unsigned len) | 656 | void __init reserve_bootmem_generic(unsigned long phys, unsigned len) |
657 | { | 657 | { |
658 | /* Should check here against the e820 map to avoid double free */ | ||
659 | #ifdef CONFIG_NUMA | 658 | #ifdef CONFIG_NUMA |
660 | int nid = phys_to_nid(phys); | 659 | int nid = phys_to_nid(phys); |
660 | #endif | ||
661 | unsigned long pfn = phys >> PAGE_SHIFT; | ||
662 | if (pfn >= end_pfn) { | ||
663 | /* This can happen with kdump kernels when accessing firmware | ||
664 | tables. */ | ||
665 | if (pfn < end_pfn_map) | ||
666 | return; | ||
667 | printk(KERN_ERR "reserve_bootmem: illegal reserve %lx %u\n", | ||
668 | phys, len); | ||
669 | return; | ||
670 | } | ||
671 | |||
672 | /* Should check here against the e820 map to avoid double free */ | ||
673 | #ifdef CONFIG_NUMA | ||
661 | reserve_bootmem_node(NODE_DATA(nid), phys, len); | 674 | reserve_bootmem_node(NODE_DATA(nid), phys, len); |
662 | #else | 675 | #else |
663 | reserve_bootmem(phys, len); | 676 | reserve_bootmem(phys, len); |