This commit is contained in:
parent
4f56a39589
commit
05234f6e4e
100
kexec-tools-exclude-gart.diff
Normal file
100
kexec-tools-exclude-gart.diff
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
Signed-off-by: Chandru S <chandru@in.ibm.com>
|
||||||
|
---
|
||||||
|
|
||||||
|
---
|
||||||
|
kexec/arch/x86_64/crashdump-x86_64.c | 39 ++++++++++++++++++++---------------
|
||||||
|
1 file changed, 23 insertions(+), 16 deletions(-)
|
||||||
|
|
||||||
|
--- a/kexec/arch/x86_64/crashdump-x86_64.c
|
||||||
|
+++ b/kexec/arch/x86_64/crashdump-x86_64.c
|
||||||
|
@@ -47,7 +47,7 @@ static struct crash_elf_info elf_info =
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Forward Declaration. */
|
||||||
|
-static int exclude_crash_reserve_region(int *nr_ranges);
|
||||||
|
+static int exclude_region(int *nr_ranges, uint64_t start, uint64_t end);
|
||||||
|
|
||||||
|
#define KERN_VADDR_ALIGN 0x100000 /* 1MB */
|
||||||
|
|
||||||
|
@@ -164,10 +164,11 @@ static struct memory_range crash_reserve
|
||||||
|
static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
|
||||||
|
{
|
||||||
|
const char *iomem= proc_iomem();
|
||||||
|
- int memory_ranges = 0;
|
||||||
|
+ int memory_ranges = 0, gart = 0;
|
||||||
|
char line[MAX_LINE];
|
||||||
|
FILE *fp;
|
||||||
|
unsigned long long start, end;
|
||||||
|
+ uint64_t gart_start = 0, gart_end = 0;
|
||||||
|
|
||||||
|
fp = fopen(iomem, "r");
|
||||||
|
if (!fp) {
|
||||||
|
@@ -219,6 +220,11 @@ static int get_crash_memory_ranges(struc
|
||||||
|
type = RANGE_ACPI;
|
||||||
|
} else if(memcmp(str,"ACPI Non-volatile Storage\n",26) == 0 ) {
|
||||||
|
type = RANGE_ACPI_NVS;
|
||||||
|
+ } else if (memcmp(str, "GART\n", 5) == 0) {
|
||||||
|
+ gart_start = start;
|
||||||
|
+ gart_end = end;
|
||||||
|
+ gart = 1;
|
||||||
|
+ continue;
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
@@ -233,8 +239,14 @@ static int get_crash_memory_ranges(struc
|
||||||
|
memory_ranges++;
|
||||||
|
}
|
||||||
|
fclose(fp);
|
||||||
|
- if (exclude_crash_reserve_region(&memory_ranges) < 0)
|
||||||
|
+ if (exclude_region(&memory_ranges, crash_reserved_mem.start,
|
||||||
|
+ crash_reserved_mem.end) < 0)
|
||||||
|
return -1;
|
||||||
|
+ if (gart) {
|
||||||
|
+ /* exclude GART region if the system has one */
|
||||||
|
+ if (exclude_region(&memory_ranges, gart_start, gart_end) < 0)
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
*range = crash_memory_range;
|
||||||
|
*ranges = memory_ranges;
|
||||||
|
#ifdef DEBUG
|
||||||
|
@@ -252,32 +264,27 @@ static int get_crash_memory_ranges(struc
|
||||||
|
/* Removes crash reserve region from list of memory chunks for whom elf program
|
||||||
|
* headers have to be created. Assuming crash reserve region to be a single
|
||||||
|
* continuous area fully contained inside one of the memory chunks */
|
||||||
|
-static int exclude_crash_reserve_region(int *nr_ranges)
|
||||||
|
+static int exclude_region(int *nr_ranges, uint64_t start, uint64_t end)
|
||||||
|
{
|
||||||
|
int i, j, tidx = -1;
|
||||||
|
- unsigned long long cstart, cend;
|
||||||
|
struct memory_range temp_region;
|
||||||
|
|
||||||
|
- /* Crash reserved region. */
|
||||||
|
- cstart = crash_reserved_mem.start;
|
||||||
|
- cend = crash_reserved_mem.end;
|
||||||
|
-
|
||||||
|
for (i = 0; i < (*nr_ranges); i++) {
|
||||||
|
unsigned long long mstart, mend;
|
||||||
|
mstart = crash_memory_range[i].start;
|
||||||
|
mend = crash_memory_range[i].end;
|
||||||
|
- if (cstart < mend && cend > mstart) {
|
||||||
|
- if (cstart != mstart && cend != mend) {
|
||||||
|
+ if (start < mend && end > mstart) {
|
||||||
|
+ if (start != mstart && end != mend) {
|
||||||
|
/* Split memory region */
|
||||||
|
- crash_memory_range[i].end = cstart - 1;
|
||||||
|
- temp_region.start = cend + 1;
|
||||||
|
+ crash_memory_range[i].end = start - 1;
|
||||||
|
+ temp_region.start = end + 1;
|
||||||
|
temp_region.end = mend;
|
||||||
|
temp_region.type = RANGE_RAM;
|
||||||
|
tidx = i+1;
|
||||||
|
- } else if (cstart != mstart)
|
||||||
|
- crash_memory_range[i].end = cstart - 1;
|
||||||
|
+ } else if (start != mstart)
|
||||||
|
+ crash_memory_range[i].end = start - 1;
|
||||||
|
else
|
||||||
|
- crash_memory_range[i].start = cend + 1;
|
||||||
|
+ crash_memory_range[i].start = end + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Insert split memory region, if any. */
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 09 17:10:10 CET 2008 - bwalle@suse.de
|
||||||
|
|
||||||
|
- Exclude GART memory from regions that must be written to the
|
||||||
|
dump file (bnc #457612).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Nov 26 10:05:49 CET 2008 - bwalle@suse.de
|
Wed Nov 26 10:05:49 CET 2008 - bwalle@suse.de
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ PreReq: %insserv_prereq %fillup_prereq
|
|||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
Summary: Tools for fast kernel loading
|
Summary: Tools for fast kernel loading
|
||||||
Version: 2.0.0
|
Version: 2.0.0
|
||||||
Release: 47
|
Release: 48
|
||||||
Source: %{name}-%{version}.tar.bz2
|
Source: %{name}-%{version}.tar.bz2
|
||||||
Source1: kexec-bootloader
|
Source1: kexec-bootloader
|
||||||
Source2: kexec-bootloader.8.txt
|
Source2: kexec-bootloader.8.txt
|
||||||
@ -51,6 +51,7 @@ Patch12: %{name}-spell.diff
|
|||||||
Patch13: %{name}-xen-static.diff
|
Patch13: %{name}-xen-static.diff
|
||||||
Patch14: %{name}-proc-iomem-xen.diff
|
Patch14: %{name}-proc-iomem-xen.diff
|
||||||
Patch15: %{name}-parse-iomem-single-warning.diff
|
Patch15: %{name}-parse-iomem-single-warning.diff
|
||||||
|
Patch16: %{name}-exclude-gart.diff
|
||||||
Url: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/
|
Url: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
@ -96,6 +97,7 @@ Authors:
|
|||||||
%patch13 -p1
|
%patch13 -p1
|
||||||
%patch14 -p1
|
%patch14 -p1
|
||||||
%patch15 -p1
|
%patch15 -p1
|
||||||
|
%patch16 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%{?suse_update_config -f}
|
%{?suse_update_config -f}
|
||||||
@ -163,6 +165,9 @@ install -m 0755 kexec.init ${RPM_BUILD_ROOT}/etc/init.d/kexec
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Dec 09 2008 bwalle@suse.de
|
||||||
|
- Exclude GART memory from regions that must be written to the
|
||||||
|
dump file (bnc #457612).
|
||||||
* Wed Nov 26 2008 bwalle@suse.de
|
* Wed Nov 26 2008 bwalle@suse.de
|
||||||
- Fix compile warning.
|
- Fix compile warning.
|
||||||
* Mon Nov 24 2008 bwalle@suse.de
|
* Mon Nov 24 2008 bwalle@suse.de
|
||||||
|
Loading…
Reference in New Issue
Block a user