From e00ff5aac2ba6081346b1e10d13d11f361bf46e837392e3f4f20f1988bc08c03 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 8 Jul 2008 19:14:40 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kexec-tools?expand=0&rev=49 --- ...c-tools-32bit-kexec-with-64bit-ppc64.patch | 163 ++++++++++++++++++ kexec-tools-edd-fix | 8 +- kexec-tools.changes | 5 + kexec-tools.spec | 6 +- 4 files changed, 178 insertions(+), 4 deletions(-) create mode 100644 kexec-tools-32bit-kexec-with-64bit-ppc64.patch diff --git a/kexec-tools-32bit-kexec-with-64bit-ppc64.patch b/kexec-tools-32bit-kexec-with-64bit-ppc64.patch new file mode 100644 index 0000000..65515b4 --- /dev/null +++ b/kexec-tools-32bit-kexec-with-64bit-ppc64.patch @@ -0,0 +1,163 @@ +From: Sachin Sant +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 +Acked-by: Bernhard Walle + +--- + 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; + diff --git a/kexec-tools-edd-fix b/kexec-tools-edd-fix index f786012..9d5dfd1 100644 --- a/kexec-tools-edd-fix +++ b/kexec-tools-edd-fix @@ -16,11 +16,13 @@ myself, the initial EDD implementation. Signed-off-by: Bernhard Walle -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 +++ 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]; dbgprintf("EDD raw data has length %d\n", len); diff --git a/kexec-tools.changes b/kexec-tools.changes index 9fc4d93..964cc59 100644 --- a/kexec-tools.changes +++ b/kexec-tools.changes @@ -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 diff --git a/kexec-tools.spec b/kexec-tools.spec index 6fbcf19..ba3f57a 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -23,7 +23,7 @@ Requires: %insserv_prereq %fillup_prereq AutoReqProv: on Summary: Tools for fast kernel loading Version: 1.101 -Release: 199 +Release: 205 Source: %{name}-%{package_version}.tar.bz2 Source1: README.SUSE 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 Patch5: kexec-tools-fix-arch-on-unload Patch6: kexec-tools-edd-fix +Patch7: kexec-tools-32bit-kexec-with-64bit-ppc64.patch %description Kexec is a user space utility for loading another kernel and asking the @@ -61,6 +62,7 @@ Authors: %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 %build %{?suse_update_config -f} @@ -96,6 +98,8 @@ install -c -m 0644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8 %endif %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 - fix EDD support when the BIOS-reported length is smaller than the sysfs raw_data size (bnc#388754)