summaryrefslogtreecommitdiff
path: root/kexec/arch/i386
diff options
context:
space:
mode:
authorWANG Chao <chaowang@redhat.com>2014-04-22 10:56:45 +0800
committerSimon Horman <horms@verge.net.au>2014-04-23 09:11:03 +0900
commit02dd785100a64adff80df942a0a1e9de59279b00 (patch)
tree673bf4c70ec0decb3f673b92985e55b1d7332937 /kexec/arch/i386
parentadf854f76a2cd50f4c8db0142ac8d61a4107ff34 (diff)
x86, cleanup: kexec memory range .end to be inclusive
Later kexec and kdump memory range will be mapped to E820entry. But currently kexec memory range .end field is exclusive while crash memory range is inclusive. Given the fact that the exported proc iomem and sysfs memmap are both inclusive, change kexec memory range .end to be inclusive. Later the unified memory range of both kexec and kdump can use the same E820 filling code. Signed-off-by: WANG Chao <chaowang@redhat.com> Acked-by: Dave Young <dyoung@redhat.com> Tested-by: Linn Crosetto <linn@hp.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/i386')
-rw-r--r--kexec/arch/i386/kexec-x86-common.c3
-rw-r--r--kexec/arch/i386/x86-linux-setup.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/kexec/arch/i386/kexec-x86-common.c b/kexec/arch/i386/kexec-x86-common.c
index e416177..bc622e9 100644
--- a/kexec/arch/i386/kexec-x86-common.c
+++ b/kexec/arch/i386/kexec-x86-common.c
@@ -79,7 +79,6 @@ static int get_memory_ranges_proc_iomem(struct memory_range **range, int *ranges
if (count != 2)
continue;
str = line + consumed;
- end = end + 1;
dbgprintf("%016Lx-%016Lx : %s", start, end, str);
@@ -188,7 +187,7 @@ static int get_memory_ranges_xen(struct memory_range **range, int *ranges)
for (i = 0; i < rc; ++i) {
memory_range[i].start = e820entries[i].addr;
- memory_range[i].end = e820entries[i].addr + e820entries[i].size;
+ memory_range[i].end = e820entries[i].addr + e820entries[i].size - 1;
memory_range[i].type = xen_e820_to_kexec_type(e820entries[i].type);
}
diff --git a/kexec/arch/i386/x86-linux-setup.c b/kexec/arch/i386/x86-linux-setup.c
index 8ed36cc..9f8355f 100644
--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -784,7 +784,7 @@ void setup_linux_system_parameters(struct kexec_info *info,
real_mode->e820_map_nr = ranges;
for(i = 0; i < ranges; i++) {
real_mode->e820_map[i].addr = range[i].start;
- real_mode->e820_map[i].size = range[i].end - range[i].start;
+ real_mode->e820_map[i].size = range[i].end - range[i].start + 1;
switch (range[i].type) {
case RANGE_RAM:
real_mode->e820_map[i].type = E820_RAM;