Simon Horman | 1 Feb 13:10 2010
Picon

Re: [PATCH] Fix --reuse-cmdline so it is usable.

On Mon, Jan 25, 2010 at 12:14:03AM -0800, Eric W. Biederman wrote:
> Simon Horman <horms@...> writes:
> 
> > On Tue, Jan 19, 2010 at 12:05:03AM -0800, Eric W. Biederman wrote:
> >> 
> >> A colleague of mine implemented kdump and it used --reuse-cmdline
> >> with some rather interesting and unexpected results.
> >> 
> >> Update the getopt specification so that --reuse-cmdline does not
> >> attempt to take an argument that it will not use.
> >> 
> >> Update the processing of --append so that --reuse-cmdline followed
> >> by --append actually appends the parameters specified by --reuse-cmdline.
> >
> > Hi Eric,
> >
> > sorry for being slow. Been semi-offline for LCA and am now catching
> > up on things.
> 
> No problem, I am pretty out of it right now as well.
> 
> > [snip]
> >
> >> diff --git a/kexec/kexec.c b/kexec/kexec.c
> >> index a1cec86..f4c22a6 100644
> >> --- a/kexec/kexec.c
> >> +++ b/kexec/kexec.c
> >>  <at>  <at>  -994,6 +994,22  <at>  <at>  void check_reuse_initrd(void)
> >>  	free(line);
> >>  }
(Continue reading)

Simon Horman | 1 Feb 13:11 2010
Picon

[patch 03/27] sh: make zImage_head32() static

Signed-off-by: Simon Horman <horms@...>

Index: kexec-tools/kexec/arch/sh/kexec-zImage-sh.c
===================================================================
--- kexec-tools.orig/kexec/arch/sh/kexec-zImage-sh.c	2010-02-01 23:06:41.000000000 +1100
+++ kexec-tools/kexec/arch/sh/kexec-zImage-sh.c	2010-02-01 23:07:17.000000000 +1100
 <at>  <at>  -34,7 +34,7  <at>  <at>  static const int probe_debug = 0;
 #define HEAD32_INIT_SR 3
 #define HEAD32_INIT_SR_VALUE 0x400000F0

-unsigned long zImage_head32(const char *buf, off_t len, int offs)
+static unsigned long zImage_head32(const char *buf, off_t len, int offs)
 {
 	unsigned long *values = (void *)buf;
 	int k;
Simon Horman | 1 Feb 13:12 2010
Picon

[patch 04/27] sh: Remove unused len parameter from zImage_head32()

Signed-off-by: Simon Horman <horms@...>

Index: kexec-tools/kexec/arch/sh/kexec-zImage-sh.c
===================================================================
--- kexec-tools.orig/kexec/arch/sh/kexec-zImage-sh.c	2010-02-01 23:07:17.000000000 +1100
+++ kexec-tools/kexec/arch/sh/kexec-zImage-sh.c	2010-02-01 23:07:17.000000000 +1100
 <at>  <at>  -34,7 +34,7  <at>  <at>  static const int probe_debug = 0;
 #define HEAD32_INIT_SR 3
 #define HEAD32_INIT_SR_VALUE 0x400000F0

-static unsigned long zImage_head32(const char *buf, off_t len, int offs)
+static unsigned long zImage_head32(const char *buf, int offs)
 {
 	unsigned long *values = (void *)buf;
 	int k;
 <at>  <at>  -56,7 +56,7  <at>  <at>  int zImage_sh_probe(const char *buf, off
 	if (memcmp(&buf[0x202], "HdrS", 4) != 0)
 	        return -1;

-	if (zImage_head32(buf, len, HEAD32_INIT_SR) != HEAD32_INIT_SR_VALUE)
+	if (zImage_head32(buf, HEAD32_INIT_SR) != HEAD32_INIT_SR_VALUE)
 	        return -1;

 	return 0;
 <at>  <at>  -112,7 +112,7  <at>  <at>  int zImage_sh_load(int argc, char **argv
 	 * all combinations.
 	 */

-	empty_zero = zImage_head32(buf, len, HEAD32_KERNEL_START_ADDR);
+	empty_zero = zImage_head32(buf, HEAD32_KERNEL_START_ADDR);
(Continue reading)

Simon Horman | 1 Feb 13:11 2010
Picon

[patch 01/27] Mark unused parameters

Signed-off-by: Simon Horman <horms@...>

Index: kexec-tools/kexec/kexec.h
===================================================================
--- kexec-tools.orig/kexec/kexec.h	2010-02-01 23:07:15.000000000 +1100
+++ kexec-tools/kexec/kexec.h	2010-02-01 23:07:16.000000000 +1100
 <at>  <at>  -13,6 +13,7  <at>  <at> 
 #define _GNU_SOURCE

 #include "kexec-elf.h"
+#include "unused.h"

 #ifndef BYTE_ORDER
 #error BYTE_ORDER not defined
 <at>  <at>  -258,7 +259,7  <at>  <at>  extern int add_backup_segments(struct ke
 #define dbgprintf(_args...) do {printf(_args);} while(0)
 #else
 static inline int __attribute__ ((format (printf, 1, 2)))
-	dbgprintf(const char *fmt, ...) {return 0;}
+	dbgprintf(const char *UNUSED(fmt), ...) {return 0;}
 #endif

 char *concat_cmdline(const char *base, const char *append);
Index: kexec-tools/include/unused.h
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ kexec-tools/include/unused.h	2010-02-01 23:07:16.000000000 +1100
 <at>  <at>  -0,0 +1,15  <at>  <at> 
+#ifndef UNUSED_H
+#define UNUSED_H
(Continue reading)

Simon Horman | 1 Feb 13:11 2010
Picon

[patch 00/27] -Wextra cleanups

These patches clean up the code so that it compiles cleanly
with -Wextra on all architectures except CRIS. The compiler that
I have for CRIS doesn't support -Wextra.
Simon Horman | 1 Feb 13:12 2010
Picon

[patch 05/27] i386: Remove unused kexec_flags parameter from setup_edd_info()

Signed-off-by: Simon Horman <horms@...>

Index: kexec-tools/kexec/arch/i386/x86-linux-setup.c
===================================================================
--- kexec-tools.orig/kexec/arch/i386/x86-linux-setup.c	2010-02-01 23:06:41.000000000 +1100
+++ kexec-tools/kexec/arch/i386/x86-linux-setup.c	2010-02-01 23:07:17.000000000 +1100
 <at>  <at>  -353,8 +353,7  <at>  <at>  static void zero_edd(struct x86_linux_pa
 		EDD_MBR_SIG_MAX * sizeof(uint32_t));
 }

-void setup_edd_info(struct x86_linux_param_header *real_mode,
-					unsigned long kexec_flags)
+void setup_edd_info(struct x86_linux_param_header *real_mode)
 {
 	DIR *edd_dir;
 	struct dirent *cursor;
 <at>  <at>  -482,5 +481,5  <at>  <at>  void setup_linux_system_parameters(struc
 	}

 	/* fill the EDD information */
-	setup_edd_info(real_mode, kexec_flags);
+	setup_edd_info(real_mode);
 }
Simon Horman | 1 Feb 13:12 2010
Picon

[patch 06/27] ia64: Remove unused info parameter from {move, update}_loaded_segments()

Signed-off-by: Simon Horman <horms@...>

/bin/bash: 0001-add-kexec-tools-support-for-armv7l-processors.patch: コマンドが見つかりません
差分に失敗しました。異常終了します
Index: kexec-tools/kexec/arch/ia64/kexec-elf-ia64.c
===================================================================
--- kexec-tools.orig/kexec/arch/ia64/kexec-elf-ia64.c	2010-02-01 23:06:40.000000000 +1100
+++ kexec-tools/kexec/arch/ia64/kexec-elf-ia64.c	2010-02-01 23:07:17.000000000 +1100
 <at>  <at>  -96,8 +96,7  <at>  <at>  void elf_ia64_usage(void)

 /* Move the crash kerenl physical offset to reserved region
  */
-void move_loaded_segments(struct kexec_info *info, struct mem_ehdr *ehdr,
-			  unsigned long addr)
+void move_loaded_segments(struct mem_ehdr *ehdr, unsigned long addr)
 {
 	int i;
 	long offset;
 <at>  <at>  -198,8 +197,8  <at>  <at>  int elf_ia64_load(int argc, char **argv,
 			free_elf_info(&ehdr);
 			return -1;
 		}
-		move_loaded_segments(info, &ehdr, mem_min);
-	} else if (update_loaded_segments(info, &ehdr) < 0) {
+		move_loaded_segments(&ehdr, mem_min);
+	} else if (update_loaded_segments(&ehdr) < 0) {
 		fprintf(stderr, "Failed to place kernel\n");
 		return -1;
 	}
Index: kexec-tools/kexec/arch/ia64/kexec-ia64.c
(Continue reading)

Simon Horman | 1 Feb 13:12 2010
Picon

[patch 20/27] Cast 64bit pointer to a 64bit int then a 32bit int

The two-stage cast is because we really do want a 32bit integer value
from a 64bit pointer, and gcc assumes that we're making a mistake
if there is just one cast.

# powerpc64-unknown-linux-gnu-gcc --version
powerpc64-unknown-linux-gnu-gcc (GCC) 4.1.1
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# make
kexec/arch/ppc64/kexec-elf-rel-ppc64.c: In function 'machine_apply_elf_rel':
kexec/arch/ppc64/kexec-elf-rel-ppc64.c:66: warning: cast from pointer to integer of different size

Signed-off-by: Simon Horman <horms@...>

Index: kexec-tools/kexec/arch/ppc64/kexec-elf-rel-ppc64.c
===================================================================
--- kexec-tools.orig/kexec/arch/ppc64/kexec-elf-rel-ppc64.c	2010-02-01 23:06:38.000000000 +1100
+++ kexec-tools/kexec/arch/ppc64/kexec-elf-rel-ppc64.c	2010-02-01 23:07:21.000000000 +1100
 <at>  <at>  -63,7 +63,7  <at>  <at>  void machine_apply_elf_rel(struct mem_eh
 		break;

 	case R_PPC64_REL32:
-		*(uint32_t *)location = value - (uint32_t)location;
+		*(uint32_t *)location = value - (uint32_t)(uint64_t)location;
 		break;

 	case R_PPC64_TOC:
(Continue reading)

Simon Horman | 1 Feb 13:11 2010
Picon

[patch 02/27] Remove unused parameters from build_mem() and related functions

Signed-off-by: Simon Horman <horms@...>

Index: kexec-tools/kexec/kexec-elf.c
===================================================================
--- kexec-tools.orig/kexec/kexec-elf.c	2010-02-01 23:06:41.000000000 +1100
+++ kexec-tools/kexec/kexec-elf.c	2010-02-01 23:07:16.000000000 +1100
 <at>  <at>  -302,8 +302,7  <at>  <at>  static int build_mem_ehdr(const char *bu
 	return 0;
 }

-static int build_mem_elf32_phdr(const char *buf, off_t len,
-	struct mem_ehdr *ehdr, int idx)
+static int build_mem_elf32_phdr(const char *buf, struct mem_ehdr *ehdr, int idx)
 {
 	struct mem_phdr *phdr;
 	const char *pbuf;
 <at>  <at>  -335,8 +334,7  <at>  <at>  static int build_mem_elf32_phdr(const ch
 	return 0;
 }

-static int build_mem_elf64_phdr(const char *buf, off_t len,
-	struct mem_ehdr *ehdr, int idx)
+static int build_mem_elf64_phdr(const char *buf, struct mem_ehdr *ehdr, int idx)
 {
 	struct mem_phdr *phdr;
 	const char *pbuf;
 <at>  <at>  -407,11 +405,11  <at>  <at>  static int build_mem_phdrs(const char *b
 		int result;
 		result = -1;
 		if (ehdr->ei_class == ELFCLASS32) {
(Continue reading)

Simon Horman | 1 Feb 13:12 2010
Picon

[patch 08/27] ia64: Remove unused range parameter from get_crash_memory_ranges()

Signed-off-by: Simon Horman <horms@...>

Index: kexec-tools/kexec/arch/ia64/crashdump-ia64.c
===================================================================
--- kexec-tools.orig/kexec/arch/ia64/crashdump-ia64.c	2010-02-01 23:07:18.000000000 +1100
+++ kexec-tools/kexec/arch/ia64/crashdump-ia64.c	2010-02-01 23:07:18.000000000 +1100
 <at>  <at>  -152,7 +152,7  <at>  <at>  static int exclude_crash_reserve_region(
 	return 0;
 }

-static int get_crash_memory_ranges(struct memory_range **range, int *ranges)
+static int get_crash_memory_ranges(int *ranges)
 {
 	const char *iomem = proc_iomem();
         char line[MAX_LINE];
 <at>  <at>  -236,7 +236,7  <at>  <at>  int load_crashdump_segments(struct kexec
 	size_t size;
 	void *tmp;
 	if (info->kexec_flags & KEXEC_ON_CRASH &&
-	    get_crash_memory_ranges(&mem_range, &nr_ranges) == 0) {
+	    get_crash_memory_ranges(&nr_ranges) == 0) {
 		int i;

 		info->kern_paddr_start = kernel_code_start;

Gmane