This commit is contained in:
parent
c48d6a0505
commit
0c7f273c50
158
kexec-tools-add-alignment-parameter.diff
Normal file
158
kexec-tools-add-alignment-parameter.diff
Normal file
@ -0,0 +1,158 @@
|
||||
Subject: kexec-tools: Add alignment parameter to crash_create_XXX_headers
|
||||
From: Simon Horman <horms@verge.net.au>
|
||||
To: fastboot@lists.osdl.org, Linux-IA64 <linux-ia64@vger.kernel.org>
|
||||
Cc: Cc: Bernhard Walle <bwalle@suse.de>,
|
||||
Magnus Damm <magnus.damm@gmail.com>,
|
||||
Zou, Nanhai <nanhai.zou@intel.com>
|
||||
|
||||
crash_create_XXX_headers assumes that all arhitectures need an alignment of
|
||||
1024bytes. But on ia64 at least this is not true. This patch adds an
|
||||
alignment parameter to crash_create_XXX_headers, and calls passes
|
||||
a value of 1024 for all architectures except ia64, where EFI_PAGE_SIZE (4096)
|
||||
is passed.
|
||||
|
||||
If there are problems with alignment on other architectures hopefully
|
||||
this facility will work for them too.
|
||||
|
||||
Cc: Bernhard Walle <bwalle@suse.de>
|
||||
Cc: Magnus Damm <magnus.damm@gmail.com>
|
||||
Cc: Zou, Nanhai <nanhai.zou@intel.com>
|
||||
Signed-off-by: Simon Horman <horms@verge.net.au>
|
||||
|
||||
|
||||
kexec/arch/i386/crashdump-x86.c | 4 ++--
|
||||
kexec/arch/ia64/crashdump-ia64.c | 5 +++--
|
||||
kexec/arch/ppc64/crashdump-ppc64.c | 4 ++--
|
||||
kexec/arch/x86_64/crashdump-x86_64.c | 2 +-
|
||||
kexec/crashdump-elf.c | 11 ++---------
|
||||
kexec/crashdump.h | 6 ++++--
|
||||
6 files changed, 14 insertions(+), 18 deletions(-)
|
||||
|
||||
Index: kexec-tools-bw/kexec/arch/i386/crashdump-x86.c
|
||||
===================================================================
|
||||
--- kexec-tools-bw.orig/kexec/arch/i386/crashdump-x86.c 2007-02-13 17:39:18.000000000 +0900
|
||||
+++ kexec-tools-bw/kexec/arch/i386/crashdump-x86.c 2007-02-13 17:39:26.000000000 +0900
|
||||
@@ -524,13 +524,13 @@
|
||||
if (arch_options.core_header_type == CORE_TYPE_ELF64) {
|
||||
if (crash_create_elf64_headers(info, &elf_info64,
|
||||
crash_memory_range, nr_ranges,
|
||||
- &tmp, &sz) < 0)
|
||||
+ &tmp, &sz, 1024) < 0)
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
if (crash_create_elf32_headers(info, &elf_info32,
|
||||
crash_memory_range, nr_ranges,
|
||||
- &tmp, &sz) < 0)
|
||||
+ &tmp, &sz, 1024) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
Index: kexec-tools-bw/kexec/arch/ia64/crashdump-ia64.c
|
||||
===================================================================
|
||||
--- kexec-tools-bw.orig/kexec/arch/ia64/crashdump-ia64.c 2007-02-13 17:39:18.000000000 +0900
|
||||
+++ kexec-tools-bw/kexec/arch/ia64/crashdump-ia64.c 2007-02-13 18:09:44.000000000 +0900
|
||||
@@ -232,13 +232,14 @@
|
||||
if (crash_create_elf64_headers(info, &elf_info,
|
||||
crash_memory_range,
|
||||
nr_ranges,
|
||||
- &tmp, &sz) < 0)
|
||||
+ &tmp, &sz,
|
||||
+ 4096) < 0)
|
||||
return -1;
|
||||
|
||||
elfcorehdr = add_buffer(info, tmp, sz, sz, EFI_PAGE_SIZE, min_base,
|
||||
max_addr, -1);
|
||||
loaded_segments[loaded_segments_num].start = elfcorehdr;
|
||||
- loaded_segments[loaded_segments_num].end = elfcorehdr + size;
|
||||
+ loaded_segments[loaded_segments_num].end = elfcorehdr + sz;
|
||||
loaded_segments[loaded_segments_num].reserved = 1;
|
||||
loaded_segments_num++;
|
||||
cmdline_add_elfcorehdr(cmdline, elfcorehdr);
|
||||
Index: kexec-tools-bw/kexec/arch/ppc64/crashdump-ppc64.c
|
||||
===================================================================
|
||||
--- kexec-tools-bw.orig/kexec/arch/ppc64/crashdump-ppc64.c 2007-02-13 17:39:18.000000000 +0900
|
||||
+++ kexec-tools-bw/kexec/arch/ppc64/crashdump-ppc64.c 2007-02-13 17:39:26.000000000 +0900
|
||||
@@ -344,13 +344,13 @@
|
||||
if (arch_options.core_header_type == CORE_TYPE_ELF64) {
|
||||
if (crash_create_elf64_headers(info, &elf_info64,
|
||||
crash_memory_range, nr_ranges,
|
||||
- &tmp, &sz) < 0)
|
||||
+ &tmp, &sz, 1024) < 0)
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
if (crash_create_elf32_headers(info, &elf_info32,
|
||||
crash_memory_range, nr_ranges,
|
||||
- &tmp, &sz) < 0)
|
||||
+ &tmp, &sz, 1024) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
Index: kexec-tools-bw/kexec/arch/x86_64/crashdump-x86_64.c
|
||||
===================================================================
|
||||
--- kexec-tools-bw.orig/kexec/arch/x86_64/crashdump-x86_64.c 2007-02-13 17:39:18.000000000 +0900
|
||||
+++ kexec-tools-bw/kexec/arch/x86_64/crashdump-x86_64.c 2007-02-13 17:39:26.000000000 +0900
|
||||
@@ -607,7 +607,7 @@
|
||||
/* Create elf header segment and store crash image data. */
|
||||
if (crash_create_elf64_headers(info, &elf_info,
|
||||
crash_memory_range, nr_ranges,
|
||||
- &tmp, &sz) < 0)
|
||||
+ &tmp, &sz, 1024) < 0)
|
||||
return -1;
|
||||
|
||||
/* Hack: With some ld versions (GNU ld version 2.14.90.0.4 20030523),
|
||||
Index: kexec-tools-bw/kexec/crashdump-elf.c
|
||||
===================================================================
|
||||
--- kexec-tools-bw.orig/kexec/crashdump-elf.c 2007-02-13 17:39:18.000000000 +0900
|
||||
+++ kexec-tools-bw/kexec/crashdump-elf.c 2007-02-13 17:39:26.000000000 +0900
|
||||
@@ -27,11 +27,11 @@
|
||||
int FUNC(struct kexec_info *info,
|
||||
struct crash_elf_info *elf_info,
|
||||
struct memory_range *range, int ranges,
|
||||
- void **buf, unsigned long *size)
|
||||
+ void **buf, unsigned long *size, unsigned long align)
|
||||
{
|
||||
EHDR *elf;
|
||||
PHDR *phdr;
|
||||
- int i, sz, align;
|
||||
+ int i, sz;
|
||||
char *bufp;
|
||||
long int nr_cpus = 0;
|
||||
uint64_t notes_addr, notes_len;
|
||||
@@ -72,13 +72,6 @@
|
||||
sz += sizeof(PHDR);
|
||||
}
|
||||
|
||||
- /*
|
||||
- * The kernel command line option memmap= requires 1k granularity,
|
||||
- * therefore we align the size to 1024 here.
|
||||
- */
|
||||
-
|
||||
- align = 1024;
|
||||
-
|
||||
sz += align - 1;
|
||||
sz &= ~(align - 1);
|
||||
|
||||
Index: kexec-tools-bw/kexec/crashdump.h
|
||||
===================================================================
|
||||
--- kexec-tools-bw.orig/kexec/crashdump.h 2007-02-13 17:39:18.000000000 +0900
|
||||
+++ kexec-tools-bw/kexec/crashdump.h 2007-02-13 17:39:26.000000000 +0900
|
||||
@@ -27,12 +27,14 @@
|
||||
int crash_create_elf32_headers(struct kexec_info *info,
|
||||
struct crash_elf_info *elf_info,
|
||||
struct memory_range *range, int ranges,
|
||||
- void **buf, unsigned long *size);
|
||||
+ void **buf, unsigned long *size,
|
||||
+ unsigned long align);
|
||||
|
||||
int crash_create_elf64_headers(struct kexec_info *info,
|
||||
struct crash_elf_info *elf_info,
|
||||
struct memory_range *range, int ranges,
|
||||
- void **buf, unsigned long *size);
|
||||
+ void **buf, unsigned long *size,
|
||||
+ unsigned long align);
|
||||
|
||||
int xen_present(void);
|
||||
int xen_get_nr_phys_cpus(void);
|
||||
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 13 18:38:52 CET 2007 - bwalle@suse.de
|
||||
|
||||
- align the both start and end address of the ELF core header
|
||||
to EFI_PAGE_SIZE (4096) to fix wrong EFI memory maps
|
||||
(#214865)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 12 10:57:38 CET 2007 - bwalle@suse.de
|
||||
|
||||
|
@ -19,7 +19,7 @@ Requires: %insserv_prereq %fillup_prereq
|
||||
Autoreqprov: on
|
||||
Summary: Tools for fast kernel loading
|
||||
Version: 1.101
|
||||
Release: 75
|
||||
Release: 77
|
||||
Source: %{name}-%{package_version}.tar.bz2
|
||||
Source1: kdump
|
||||
Source2: sysconfig.kdump
|
||||
@ -29,6 +29,7 @@ Source5: README.SUSE
|
||||
Source6: kdump-helper-%{helperversion}.tar.bz2
|
||||
Patch1: kexec-longer-cmdline.diff
|
||||
Patch2: kexec-help.diff
|
||||
Patch3: kexec-tools-add-alignment-parameter.diff
|
||||
URL: http://www.xmission.com/~ebiederm/files/kexec/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: libelf
|
||||
@ -54,6 +55,7 @@ Authors:
|
||||
%setup -q -n kexec-tools -b 6
|
||||
%patch1 -p1
|
||||
%patch2
|
||||
%patch3 -p1
|
||||
%{?suse_update_config -f}
|
||||
cp %{SOURCE5} .
|
||||
|
||||
@ -123,6 +125,10 @@ true # ignore errors
|
||||
%{_sbindir}/kdump-helper
|
||||
|
||||
%changelog -n kexec-tools
|
||||
* Tue Feb 13 2007 - bwalle@suse.de
|
||||
- align the both start and end address of the ELF core header
|
||||
to EFI_PAGE_SIZE (4096) to fix wrong EFI memory maps
|
||||
(#214865)
|
||||
* Mon Feb 12 2007 - bwalle@suse.de
|
||||
- fixed copying, blocksize was wrong (#243058)
|
||||
* Sat Feb 10 2007 - schwab@suse.de
|
||||
|
Loading…
Reference in New Issue
Block a user