aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-09-21 15:50:45 -0400
committerIngo Molnar <mingo@kernel.org>2016-09-22 06:26:48 -0400
commit917db484dc6a69969d317b3e57add4208a8d9d42 (patch)
treeabb20c86cbbc8244d267cc4e20d3a0cfdb5d0cc6
parent1827822902cf659d60d3413fd42c7e6cbd18df4d (diff)
x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn manipulation
In commit: ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type") Christoph references the original patch I wrote implementing pmem support. The intent of the 'max_pfn' changes in that commit were to enable persistent memory ranges to be covered by the struct page memmap by default. However, that approach was abandoned when Christoph ported the patches [1], and that functionality has since been replaced by devm_memremap_pages(). In the meantime, this max_pfn manipulation is confusing kdump [2] that assumes that everything covered by the max_pfn is "System RAM". This results in kdump hanging or crashing. [1]: https://lists.01.org/pipermail/linux-nvdimm/2015-March/000348.html [2]: https://bugzilla.redhat.com/show_bug.cgi?id=1351098 So fix it. Reported-by: Zhang Yi <yizhan@redhat.com> Reported-by: Jeff Moyer <jmoyer@redhat.com> Tested-by: Zhang Yi <yizhan@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Jeff Moyer <jmoyer@redhat.com> Cc: <stable@vger.kernel.org> # v4.1 and later kernels Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Boaz Harrosh <boaz@plexistor.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-nvdimm@lists.01.org Fixes: ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type") Link: http://lkml.kernel.org/r/147448744538.34910.11287693517367139607.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/e820.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index bb8c69079c78..b85fe5f91c3f 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -350,7 +350,7 @@ int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map,
350 * continue building up new bios map based on this 350 * continue building up new bios map based on this
351 * information 351 * information
352 */ 352 */
353 if (current_type != last_type || current_type == E820_PRAM) { 353 if (current_type != last_type) {
354 if (last_type != 0) { 354 if (last_type != 0) {
355 new_bios[new_bios_entry].size = 355 new_bios[new_bios_entry].size =
356 change_point[chgidx]->addr - last_addr; 356 change_point[chgidx]->addr - last_addr;
@@ -783,7 +783,7 @@ u64 __init early_reserve_e820(u64 size, u64 align)
783/* 783/*
784 * Find the highest page frame number we have available 784 * Find the highest page frame number we have available
785 */ 785 */
786static unsigned long __init e820_end_pfn(unsigned long limit_pfn) 786static unsigned long __init e820_end_pfn(unsigned long limit_pfn, unsigned type)
787{ 787{
788 int i; 788 int i;
789 unsigned long last_pfn = 0; 789 unsigned long last_pfn = 0;
@@ -794,11 +794,7 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn)
794 unsigned long start_pfn; 794 unsigned long start_pfn;
795 unsigned long end_pfn; 795 unsigned long end_pfn;
796 796
797 /* 797 if (ei->type != type)
798 * Persistent memory is accounted as ram for purposes of
799 * establishing max_pfn and mem_map.
800 */
801 if (ei->type != E820_RAM && ei->type != E820_PRAM)
802 continue; 798 continue;
803 799
804 start_pfn = ei->addr >> PAGE_SHIFT; 800 start_pfn = ei->addr >> PAGE_SHIFT;
@@ -823,12 +819,12 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn)
823} 819}
824unsigned long __init e820_end_of_ram_pfn(void) 820unsigned long __init e820_end_of_ram_pfn(void)
825{ 821{
826 return e820_end_pfn(MAX_ARCH_PFN); 822 return e820_end_pfn(MAX_ARCH_PFN, E820_RAM);
827} 823}
828 824
829unsigned long __init e820_end_of_low_ram_pfn(void) 825unsigned long __init e820_end_of_low_ram_pfn(void)
830{ 826{
831 return e820_end_pfn(1UL << (32-PAGE_SHIFT)); 827 return e820_end_pfn(1UL << (32 - PAGE_SHIFT), E820_RAM);
832} 828}
833 829
834static void __init early_panic(char *msg) 830static void __init early_panic(char *msg)