brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0526-x86-boot-Fix-kdump-cleanup-aborted-E820_PRAM-max_pfn.patch
1 From be7d40bc3716ddaaff3cc085f0bdd90b26b72aeb Mon Sep 17 00:00:00 2001
2 From: Dan Williams <dan.j.williams@intel.com>
3 Date: Wed, 21 Sep 2016 12:50:45 -0700
4 Subject: [PATCH] x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn
5 manipulation
6
7 commit 917db484dc6a69969d317b3e57add4208a8d9d42 upstream.
8
9 In commit:
10
11 ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type")
12
13 Christoph references the original patch I wrote implementing pmem support.
14 The intent of the 'max_pfn' changes in that commit were to enable persistent
15 memory ranges to be covered by the struct page memmap by default.
16
17 However, that approach was abandoned when Christoph ported the patches [1], and
18 that functionality has since been replaced by devm_memremap_pages().
19
20 In the meantime, this max_pfn manipulation is confusing kdump [2] that
21 assumes that everything covered by the max_pfn is "System RAM". This
22 results in kdump hanging or crashing.
23
24 [1]: https://lists.01.org/pipermail/linux-nvdimm/2015-March/000348.html
25 [2]: https://bugzilla.redhat.com/show_bug.cgi?id=1351098
26
27 So fix it.
28
29 Reported-by: Zhang Yi <yizhan@redhat.com>
30 Reported-by: Jeff Moyer <jmoyer@redhat.com>
31 Tested-by: Zhang Yi <yizhan@redhat.com>
32 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
33 Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
34 Cc: Andrew Morton <akpm@linux-foundation.org>
35 Cc: Boaz Harrosh <boaz@plexistor.com>
36 Cc: Christoph Hellwig <hch@lst.de>
37 Cc: Linus Torvalds <torvalds@linux-foundation.org>
38 Cc: Peter Zijlstra <peterz@infradead.org>
39 Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
40 Cc: Thomas Gleixner <tglx@linutronix.de>
41 Cc: linux-nvdimm@lists.01.org
42 Fixes: ec776ef6bbe1 ("x86/mm: Add support for the non-standard protected e820 type")
43 Link: http://lkml.kernel.org/r/147448744538.34910.11287693517367139607.stgit@dwillia2-desk3.amr.corp.intel.com
44 Signed-off-by: Ingo Molnar <mingo@kernel.org>
45 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
46 ---
47 arch/x86/kernel/e820.c | 2 +-
48 1 file changed, 1 insertion(+), 1 deletion(-)
49
50 --- a/arch/x86/kernel/e820.c
51 +++ b/arch/x86/kernel/e820.c
52 @@ -347,7 +347,7 @@ int __init sanitize_e820_map(struct e820
53 * continue building up new bios map based on this
54 * information
55 */
56 - if (current_type != last_type || current_type == E820_PRAM) {
57 + if (current_type != last_type) {
58 if (last_type != 0) {
59 new_bios[new_bios_entry].size =
60 change_point[chgidx]->addr - last_addr;