SHA256
1
0
forked from pool/kexec-tools
OBS User unknown 2008-07-08 19:14:40 +00:00 committed by Git OBS Bridge
parent 1b0ced8658
commit e00ff5aac2
4 changed files with 178 additions and 4 deletions

View File

@ -0,0 +1,163 @@
From: Sachin Sant <sachinp@in.ibm.com>
Subject: [PATCH] Fix PPC32 kexec binary to boot kdump kernel on PPC64
References: 405015
Allow 32 bit kexec binary to boot kdump kernel on ppc64 architecture.
Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
Acked-by: Bernhard Walle <bwalle@suse.de>
---
kexec/arch/ppc64/crashdump-ppc64.c | 13 +++++++------
kexec/arch/ppc64/crashdump-ppc64.h | 2 +-
kexec/arch/ppc64/fs2dt.c | 12 ++++++------
kexec/arch/ppc64/kexec-elf-ppc64.c | 2 +-
kexec/arch/ppc64/kexec-ppc64.c | 18 +++++++++---------
5 files changed, 24 insertions(+), 23 deletions(-)
--- a/kexec/arch/ppc64/crashdump-ppc64.c
+++ b/kexec/arch/ppc64/crashdump-ppc64.c
@@ -82,7 +82,7 @@ mem_rgns_t usablemem_rgns = {0, NULL};
* we can determine the RAM size unless parsing the device-tree/memoy@/reg
* property in the kernel.
*/
-unsigned long saved_max_mem = 0;
+uint64_t saved_max_mem = 0;
/* Reads the appropriate file and retrieves the SYSTEM RAM regions for whom to
* create Elf headers. Keeping it separate from get_memory_ranges() as
@@ -250,7 +250,7 @@ err:
}
/* Converts unsigned long to ascii string. */
-static void ultoa(unsigned long i, char *str)
+static void ultoa(uint64_t i, char *str)
{
int j = 0, k;
char tmp;
@@ -268,8 +268,8 @@ static void ultoa(unsigned long i, char
}
}
-static int add_cmdline_param(char *cmdline, unsigned long addr,
- char *cmdstr, char *byte)
+static int add_cmdline_param(char *cmdline, uint64_t addr, char *cmdstr,
+ char *byte)
{
int cmdlen, len, align = 1024;
char str[COMMAND_LINE_SIZE], *ptr;
@@ -306,10 +306,11 @@ static int add_cmdline_param(char *cmdli
* for crash memory image.
*/
int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
- unsigned long max_addr, unsigned long min_base)
+ uint64_t max_addr, unsigned long min_base)
{
void *tmp;
- unsigned long sz, elfcorehdr;
+ unsigned long sz;
+ uint64_t elfcorehdr;
int nr_ranges, align = 1024, i;
unsigned long long end;
struct memory_range *mem_range;
--- a/kexec/arch/ppc64/crashdump-ppc64.h
+++ b/kexec/arch/ppc64/crashdump-ppc64.h
@@ -3,7 +3,7 @@
struct kexec_info;
int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
- unsigned long max_addr, unsigned long min_base);
+ uint64_t max_addr, unsigned long min_base);
void add_usable_mem_rgns(unsigned long long base, unsigned long long size);
#define PAGE_OFFSET 0xC000000000000000ULL
--- a/kexec/arch/ppc64/fs2dt.c
+++ b/kexec/arch/ppc64/fs2dt.c
@@ -125,9 +125,9 @@ static unsigned propnum(const char *name
static void add_usable_mem_property(int fd, int len)
{
char fname[MAXPATH], *bname;
- unsigned long long buf[2];
- unsigned long ranges[2*MAX_MEMORY_RANGES];
- unsigned long long base, end, loc_base, loc_end;
+ uint64_t buf[2];
+ uint64_t ranges[2*MAX_MEMORY_RANGES];
+ uint64_t base, end, loc_base, loc_end;
int range, rlen = 0;
strcpy(fname, pathname);
@@ -137,9 +137,9 @@ static void add_usable_mem_property(int
if (strncmp(bname, "/memory@", 8))
return;
- if (len < 2 * sizeof(unsigned long long))
+ if (len < 2 * sizeof(uint64_t))
die("unrecoverable error: not enough data for mem property\n");
- len = 2 * sizeof(unsigned long long);
+ len = 2 * sizeof(uint64_t);
if (lseek(fd, 0, SEEK_SET) < 0)
die("unrecoverable error: error seeking in \"%s\": %s\n",
@@ -179,7 +179,7 @@ static void add_usable_mem_property(int
ranges[rlen++] = 0;
}
- rlen = rlen * sizeof(unsigned long);
+ rlen = rlen * sizeof(uint64_t);
/*
* No add linux,usable-memory property.
*/
--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
+++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
@@ -187,7 +187,7 @@ int elf_ppc64_load(int argc, char **argv
if (size > phdr->p_memsz)
size = phdr->p_memsz;
- hole_addr = (unsigned long)locate_hole(info, size, 0, 0,
+ hole_addr = (uint64_t)locate_hole(info, size, 0, 0,
max_addr, 1);
ehdr.e_phdr[0].p_paddr = hole_addr;
result = elf_exec_load(&ehdr, info);
--- a/kexec/arch/ppc64/kexec-ppc64.c
+++ b/kexec/arch/ppc64/kexec-ppc64.c
@@ -37,8 +37,8 @@
static struct memory_range *exclude_range = NULL;
static struct memory_range *memory_range = NULL;
static struct memory_range *base_memory_range = NULL;
-static unsigned long long rmo_top;
-unsigned long long memory_max = 0;
+static uint64_t rmo_top;
+uint64_t memory_max = 0;
static int nr_memory_ranges, nr_exclude_ranges;
uint64_t crash_base, crash_size;
unsigned int rtas_base, rtas_size;
@@ -251,12 +251,12 @@ static int sort_ranges(void)
*/
static int get_devtree_details(unsigned long kexec_flags)
{
- unsigned long long rmo_base;
- unsigned long long tce_base;
+ uint64_t rmo_base;
+ uint64_t tce_base;
unsigned int tce_size;
- unsigned long long htab_base, htab_size;
- unsigned long long kernel_end;
- unsigned long long initrd_start, initrd_end;
+ uint64_t htab_base, htab_size;
+ uint64_t kernel_end;
+ uint64_t initrd_start, initrd_end;
char buf[MAXBYTES];
char device_tree[256] = "/proc/device-tree/";
char fname[256];
@@ -465,8 +465,8 @@ static int get_devtree_details(unsigned
perror(fname);
goto error_openfile;
}
- rmo_base = ((unsigned long long *)buf)[0];
- rmo_top = rmo_base + ((unsigned long long *)buf)[1];
+ rmo_base = ((uint64_t *)buf)[0];
+ rmo_top = rmo_base + ((uint64_t *)buf)[1];
if (rmo_top > 0x30000000UL)
rmo_top = 0x30000000UL;

View File

@ -16,11 +16,13 @@ myself, the initial EDD implementation.
Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Bernhard Walle <bwalle@suse.de>
diff --git a/kexec/arch/i386/x86-linux-setup.c b/kexec/arch/i386/x86-linux-setup.c ---
index 05a087e..cbb9d30 100644 kexec/arch/i386/x86-linux-setup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/kexec/arch/i386/x86-linux-setup.c --- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c +++ b/kexec/arch/i386/x86-linux-setup.c
@@ -254,9 +254,9 @@ static int read_edd_raw_data(const char *dir, struct edd_info *edd_info) @@ -255,9 +255,9 @@ static int read_edd_raw_data(const char
len = ((uint16_t *)edd_info->edd_device_params)[0]; len = ((uint16_t *)edd_info->edd_device_params)[0];
dbgprintf("EDD raw data has length %d\n", len); dbgprintf("EDD raw data has length %d\n", len);

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Jul 3 14:39:02 CEST 2008 - bwalle@suse.de
- fix 32 bit kexec to boot on 64 bit ppc64 (bnc#405015)
------------------------------------------------------------------- -------------------------------------------------------------------
Mon May 26 23:14:15 CEST 2008 - bwalle@suse.de Mon May 26 23:14:15 CEST 2008 - bwalle@suse.de

View File

@ -23,7 +23,7 @@ Requires: %insserv_prereq %fillup_prereq
AutoReqProv: on AutoReqProv: on
Summary: Tools for fast kernel loading Summary: Tools for fast kernel loading
Version: 1.101 Version: 1.101
Release: 199 Release: 205
Source: %{name}-%{package_version}.tar.bz2 Source: %{name}-%{package_version}.tar.bz2
Source1: README.SUSE Source1: README.SUSE
Url: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ Url: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/
@ -35,6 +35,7 @@ Patch3: kexec-tools-edd-support
Patch4: kexec-tools-refactor-architecture-detection Patch4: kexec-tools-refactor-architecture-detection
Patch5: kexec-tools-fix-arch-on-unload Patch5: kexec-tools-fix-arch-on-unload
Patch6: kexec-tools-edd-fix Patch6: kexec-tools-edd-fix
Patch7: kexec-tools-32bit-kexec-with-64bit-ppc64.patch
%description %description
Kexec is a user space utility for loading another kernel and asking the Kexec is a user space utility for loading another kernel and asking the
@ -61,6 +62,7 @@ Authors:
%patch4 -p1 %patch4 -p1
%patch5 -p1 %patch5 -p1
%patch6 -p1 %patch6 -p1
%patch7 -p1
%build %build
%{?suse_update_config -f} %{?suse_update_config -f}
@ -96,6 +98,8 @@ install -c -m 0644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8
%endif %endif
%changelog %changelog
* Thu Jul 03 2008 bwalle@suse.de
- fix 32 bit kexec to boot on 64 bit ppc64 (bnc#405015)
* Tue May 27 2008 bwalle@suse.de * Tue May 27 2008 bwalle@suse.de
- fix EDD support when the BIOS-reported length is smaller than - fix EDD support when the BIOS-reported length is smaller than
the sysfs raw_data size (bnc#388754) the sysfs raw_data size (bnc#388754)