]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.8.5/x86-e820-don-t-merge-consecutive-e820_pram-ranges.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.8.5 / x86-e820-don-t-merge-consecutive-e820_pram-ranges.patch
CommitLineData
39a3a1fe
GKH
1From 23446cb66c073b827779e5eb3dec301623299b32 Mon Sep 17 00:00:00 2001
2From: Dan Williams <dan.j.williams@intel.com>
3Date: Wed, 12 Oct 2016 11:01:48 -0700
4Subject: x86/e820: Don't merge consecutive E820_PRAM ranges
5
6From: Dan Williams <dan.j.williams@intel.com>
7
8commit 23446cb66c073b827779e5eb3dec301623299b32 upstream.
9
10Commit:
11
12 917db484dc6a ("x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn manipulation")
13
14... fixed up the broken manipulations of max_pfn in the presence of
15E820_PRAM ranges.
16
17However, it also broke the sanitize_e820_map() support for not merging
18E820_PRAM ranges.
19
20Re-introduce the enabling to keep resource boundaries between
21consecutive defined ranges. Otherwise, for example, an environment that
22boots with memmap=2G!8G,2G!10G will end up with a single 4G /dev/pmem0
23device instead of a /dev/pmem0 and /dev/pmem1 device 2G in size.
24
25Reported-by: Dave Chinner <david@fromorbit.com>
26Signed-off-by: Dan Williams <dan.j.williams@intel.com>
27Cc: Andy Lutomirski <luto@kernel.org>
28Cc: Borislav Petkov <bp@alien8.de>
29Cc: Brian Gerst <brgerst@gmail.com>
30Cc: Denys Vlasenko <dvlasenk@redhat.com>
31Cc: H. Peter Anvin <hpa@zytor.com>
32Cc: Jeff Moyer <jmoyer@redhat.com>
33Cc: Josh Poimboeuf <jpoimboe@redhat.com>
34Cc: Linus Torvalds <torvalds@linux-foundation.org>
35Cc: Peter Zijlstra <peterz@infradead.org>
36Cc: Thomas Gleixner <tglx@linutronix.de>
37Cc: Zhang Yi <yizhan@redhat.com>
38Cc: linux-nvdimm@lists.01.org
39Fixes: 917db484dc6a ("x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn manipulation")
40Link: http://lkml.kernel.org/r/147629530854.10618.10383744751594021268.stgit@dwillia2-desk3.amr.corp.intel.com
41Signed-off-by: Ingo Molnar <mingo@kernel.org>
42Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
43
44---
45 arch/x86/kernel/e820.c | 2 +-
46 1 file changed, 1 insertion(+), 1 deletion(-)
47
48--- a/arch/x86/kernel/e820.c
49+++ b/arch/x86/kernel/e820.c
50@@ -348,7 +348,7 @@ int __init sanitize_e820_map(struct e820
51 * continue building up new bios map based on this
52 * information
53 */
54- if (current_type != last_type) {
55+ if (current_type != last_type || current_type == E820_PRAM) {
56 if (last_type != 0) {
57 new_bios[new_bios_entry].size =
58 change_point[chgidx]->addr - last_addr;