]>
Commit | Line | Data |
---|---|---|
39a3a1fe GKH |
1 | From 23446cb66c073b827779e5eb3dec301623299b32 Mon Sep 17 00:00:00 2001 |
2 | From: Dan Williams <dan.j.williams@intel.com> | |
3 | Date: Wed, 12 Oct 2016 11:01:48 -0700 | |
4 | Subject: x86/e820: Don't merge consecutive E820_PRAM ranges | |
5 | ||
6 | From: Dan Williams <dan.j.williams@intel.com> | |
7 | ||
8 | commit 23446cb66c073b827779e5eb3dec301623299b32 upstream. | |
9 | ||
10 | Commit: | |
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 | |
15 | E820_PRAM ranges. | |
16 | ||
17 | However, it also broke the sanitize_e820_map() support for not merging | |
18 | E820_PRAM ranges. | |
19 | ||
20 | Re-introduce the enabling to keep resource boundaries between | |
21 | consecutive defined ranges. Otherwise, for example, an environment that | |
22 | boots with memmap=2G!8G,2G!10G will end up with a single 4G /dev/pmem0 | |
23 | device instead of a /dev/pmem0 and /dev/pmem1 device 2G in size. | |
24 | ||
25 | Reported-by: Dave Chinner <david@fromorbit.com> | |
26 | Signed-off-by: Dan Williams <dan.j.williams@intel.com> | |
27 | Cc: Andy Lutomirski <luto@kernel.org> | |
28 | Cc: Borislav Petkov <bp@alien8.de> | |
29 | Cc: Brian Gerst <brgerst@gmail.com> | |
30 | Cc: Denys Vlasenko <dvlasenk@redhat.com> | |
31 | Cc: H. Peter Anvin <hpa@zytor.com> | |
32 | Cc: Jeff Moyer <jmoyer@redhat.com> | |
33 | Cc: Josh Poimboeuf <jpoimboe@redhat.com> | |
34 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
35 | Cc: Peter Zijlstra <peterz@infradead.org> | |
36 | Cc: Thomas Gleixner <tglx@linutronix.de> | |
37 | Cc: Zhang Yi <yizhan@redhat.com> | |
38 | Cc: linux-nvdimm@lists.01.org | |
39 | Fixes: 917db484dc6a ("x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn manipulation") | |
40 | Link: http://lkml.kernel.org/r/147629530854.10618.10383744751594021268.stgit@dwillia2-desk3.amr.corp.intel.com | |
41 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | |
42 | Signed-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; |