This commit is contained in:
parent
b7abc06e11
commit
2de9d40b8f
@ -208,6 +208,13 @@ If you do not give a command line, then the default will be taken from
|
|||||||
/proc/cmdline.
|
/proc/cmdline.
|
||||||
|
|
||||||
|
|
||||||
|
- KDUMP_COMMANDLINE_APPEND
|
||||||
|
|
||||||
|
Set this variable if you only want to _append_ values to the default
|
||||||
|
command line string. The string gets also appended if KDUMP_COMMANDLINE
|
||||||
|
is set.
|
||||||
|
|
||||||
|
|
||||||
- KEXEC_OPTIONS
|
- KEXEC_OPTIONS
|
||||||
|
|
||||||
You can use this to pass additional arguments to kexec. For i386 and
|
You can use this to pass additional arguments to kexec. For i386 and
|
||||||
|
31
kdump
31
kdump
@ -160,20 +160,25 @@ load_kdump()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$KDUMP_COMMANDLINE" ]; then
|
if [ -z "$KDUMP_COMMANDLINE" ]; then
|
||||||
KDUMP_COMMANDLINE=`cat /proc/cmdline`
|
KDUMP_COMMANDLINE=`cat /proc/cmdline | \
|
||||||
KDUMP_COMMANDLINE=`echo $KDUMP_COMMANDLINE | \
|
sed -e 's/crashkernel=[0-9]\+[mM]\(@[0-9]\+[Mm]\?\)\?//g' \
|
||||||
sed -e 's/crashkernel=[0-9]\+[mM]\(@[0-9]\+[Mm]\)\?//g' \
|
-e 's/ *splash=[^ ]*/ /g' \
|
||||||
-e 's/ *splash=[^ ]* / /g' \
|
-e 's/ *BOOT_IMAGE=[^ ]* / /g' \
|
||||||
-e 's/ *showopts/ /g'`
|
-e 's/ *showopts/ /g'`
|
||||||
# Use deadline for saving the memory footprint
|
# Use deadline for saving the memory footprint
|
||||||
KDUMP_COMMANDLINE="$KDUMP_COMMANDLINE elevator=deadline sysrq=1"
|
KDUMP_COMMANDLINE="$KDUMP_COMMANDLINE elevator=deadline sysrq=1"
|
||||||
case `uname -i` in
|
case `uname -i` in
|
||||||
i?86|x86_64)
|
i?86|x86_64|ia64)
|
||||||
KDUMP_COMMANDLINE="$KDUMP_COMMANDLINE irqpoll"
|
KDUMP_COMMANDLINE="$KDUMP_COMMANDLINE irqpoll"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
KDUMP_COMMANDLINE="CRASH=1 $KDUMP_COMMANDLINE"
|
KDUMP_COMMANDLINE="CRASH=1 $KDUMP_COMMANDLINE"
|
||||||
|
|
||||||
|
if [ -n "$KDUMP_COMMANDLINE_APPEND" ] ; then
|
||||||
|
KDUMP_COMMANDLINE="$KDUMP_COMMANDLINE $KDUMP_COMMANDLINE_APPEND"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$KDUMP_RUNLEVEL" ]; then
|
if [ -n "$KDUMP_RUNLEVEL" ]; then
|
||||||
case "$KDUMP_RUNLEVEL" in
|
case "$KDUMP_RUNLEVEL" in
|
||||||
[1-5s])
|
[1-5s])
|
||||||
@ -283,14 +288,14 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
if [ ! -f /proc/vmcore ]; then
|
if [ ! -f /proc/vmcore ]; then
|
||||||
if [ "$RUNLEVEL" != "" ]; then
|
if [ "$RUNLEVEL" != "" ]; then
|
||||||
echo -n "Not unloading kdump during runlevel changes"
|
echo -n "Not unloading kdump during runlevel changes"
|
||||||
rc_status -s
|
rc_status -s
|
||||||
else
|
else
|
||||||
echo -n "Unloading kdump"
|
echo -n "Unloading kdump"
|
||||||
$KEXEC -p -u
|
$KEXEC -p -u
|
||||||
rc_status -v
|
rc_status -v
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
|
326
kexec-longer-cmdline.diff
Normal file
326
kexec-longer-cmdline.diff
Normal file
@ -0,0 +1,326 @@
|
|||||||
|
This patch increases the kernel command line size for x86_64 and i386
|
||||||
|
to 2048 characters. This is necessary because with kernel 2.6.20-rc6-mm
|
||||||
|
and newer, the kernel command line size has increased and kexec needs
|
||||||
|
lot of command line space, so this solves some "command line overflow"
|
||||||
|
problems.
|
||||||
|
|
||||||
|
To be able to warn users running older kernels that the command line
|
||||||
|
is too long (and don't wait that the kernel truncates it), the
|
||||||
|
patch tries to get the kernel command line length from the kernel
|
||||||
|
image that is loaded if possible by checking the length of the
|
||||||
|
static array that holds the kernel command line when booting.
|
||||||
|
|
||||||
|
If this is not possible or the command line is not in the range
|
||||||
|
[256; 2048], the default value is used (2048).
|
||||||
|
|
||||||
|
|
||||||
|
Signed-off-by: Bernhard Walle <bwalle@suse.de>
|
||||||
|
|
||||||
|
---
|
||||||
|
include/x86/x86-linux.h | 8 ++-----
|
||||||
|
kexec/arch/i386/crashdump-x86.c | 36 ++++++++++++++++++++++++++++++++---
|
||||||
|
kexec/arch/i386/crashdump-x86.h | 5 ++++
|
||||||
|
kexec/arch/i386/kexec-bzImage.c | 8 +++----
|
||||||
|
kexec/arch/i386/kexec-elf-x86.c | 8 +++----
|
||||||
|
kexec/arch/i386/x86-linux-setup.c | 6 +++--
|
||||||
|
kexec/arch/x86_64/crashdump-x86_64.c | 35 +++++++++++++++++++++++++++++++---
|
||||||
|
kexec/arch/x86_64/crashdump-x86_64.h | 3 ++
|
||||||
|
kexec/arch/x86_64/kexec-elf-x86_64.c | 11 ++++++----
|
||||||
|
9 files changed, 95 insertions(+), 25 deletions(-)
|
||||||
|
|
||||||
|
Index: b/include/x86/x86-linux.h
|
||||||
|
===================================================================
|
||||||
|
--- a/include/x86/x86-linux.h
|
||||||
|
+++ b/include/x86/x86-linux.h
|
||||||
|
@@ -148,14 +148,12 @@ struct x86_linux_param_header {
|
||||||
|
#endif
|
||||||
|
struct e820entry e820_map[E820MAX]; /* 0x2d0 */
|
||||||
|
/* 0x550 */
|
||||||
|
-#define COMMAND_LINE_SIZE 256
|
||||||
|
+#define COMMAND_LINE_SIZE 2048
|
||||||
|
};
|
||||||
|
|
||||||
|
struct x86_linux_faked_param_header {
|
||||||
|
- struct x86_linux_param_header hdr; /* 0x00 */
|
||||||
|
- uint8_t reserved16[688]; /* 0x550 */
|
||||||
|
- uint8_t command_line[COMMAND_LINE_SIZE]; /* 0x800 */
|
||||||
|
- uint8_t reserved17[1792]; /* 0x900 - 0x1000 */
|
||||||
|
+ struct x86_linux_param_header hdr;
|
||||||
|
+ uint8_t command_line[COMMAND_LINE_SIZE];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct x86_linux_header {
|
||||||
|
Index: b/kexec/arch/i386/crashdump-x86.c
|
||||||
|
===================================================================
|
||||||
|
--- a/kexec/arch/i386/crashdump-x86.c
|
||||||
|
+++ b/kexec/arch/i386/crashdump-x86.c
|
||||||
|
@@ -46,6 +46,36 @@ static struct memory_range crash_memory_
|
||||||
|
/* Memory region reserved for storing panic kernel and other data. */
|
||||||
|
static struct memory_range crash_reserved_mem;
|
||||||
|
|
||||||
|
+/* real length of the command line from the kernel image, needed because
|
||||||
|
+ * command line size on x86-64 was increased recently in -mm tree */
|
||||||
|
+int real_command_line_size = COMMAND_LINE_SIZE;
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+/* Tries to read the kernel command line size from the symbol table
|
||||||
|
+ * of the ELF kernel binary. */
|
||||||
|
+void set_command_line_size(struct mem_ehdr *ehdr)
|
||||||
|
+{
|
||||||
|
+ int ret;
|
||||||
|
+ struct mem_sym mem_sym;
|
||||||
|
+
|
||||||
|
+ /* > 2.6.20-rc6-mm */
|
||||||
|
+ ret = elf_rel_find_symbol(ehdr, "saved_command_line", &mem_sym);
|
||||||
|
+ if (ret != 0) {
|
||||||
|
+ /* older kernel */
|
||||||
|
+ ret = elf_rel_find_symbol(ehdr, "boot_command_line", &mem_sym);
|
||||||
|
+ if (ret != 0) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* current -mm kernel */
|
||||||
|
+ if (mem_sym.st_size >= 256 && mem_sym.st_size < COMMAND_LINE_SIZE) {
|
||||||
|
+ real_command_line_size = mem_sym.st_size;
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
/* Reads the appropriate file and retrieves the SYSTEM RAM regions for whom to
|
||||||
|
* create Elf headers. Keeping it separate from get_memory_ranges() as
|
||||||
|
* requirements are different in the case of normal kexec and crashdumps.
|
||||||
|
@@ -363,7 +393,7 @@ static int cmdline_add_memmap(char *cmdl
|
||||||
|
strcpy(str_mmap, " memmap=exactmap");
|
||||||
|
len = strlen(str_mmap);
|
||||||
|
cmdlen = strlen(cmdline) + len;
|
||||||
|
- if (cmdlen > (COMMAND_LINE_SIZE - 1))
|
||||||
|
+ if (cmdlen > (real_command_line_size - 1))
|
||||||
|
die("Command line overflow\n");
|
||||||
|
strcat(cmdline, str_mmap);
|
||||||
|
|
||||||
|
@@ -388,7 +418,7 @@ static int cmdline_add_memmap(char *cmdl
|
||||||
|
strcat (str_mmap, "K");
|
||||||
|
len = strlen(str_mmap);
|
||||||
|
cmdlen = strlen(cmdline) + len;
|
||||||
|
- if (cmdlen > (COMMAND_LINE_SIZE - 1))
|
||||||
|
+ if (cmdlen > (real_command_line_size - 1))
|
||||||
|
die("Command line overflow\n");
|
||||||
|
strcat(cmdline, str_mmap);
|
||||||
|
}
|
||||||
|
@@ -418,7 +448,7 @@ static int cmdline_add_elfcorehdr(char *
|
||||||
|
strcat(str, "K");
|
||||||
|
len = strlen(str);
|
||||||
|
cmdlen = strlen(cmdline) + len;
|
||||||
|
- if (cmdlen > (COMMAND_LINE_SIZE - 1))
|
||||||
|
+ if (cmdlen > (real_command_line_size - 1))
|
||||||
|
die("Command line overflow\n");
|
||||||
|
strcat(cmdline, str);
|
||||||
|
#if 0
|
||||||
|
Index: b/kexec/arch/i386/crashdump-x86.h
|
||||||
|
===================================================================
|
||||||
|
--- a/kexec/arch/i386/crashdump-x86.h
|
||||||
|
+++ b/kexec/arch/i386/crashdump-x86.h
|
||||||
|
@@ -2,8 +2,11 @@
|
||||||
|
#define CRASHDUMP_X86_H
|
||||||
|
|
||||||
|
struct kexec_info;
|
||||||
|
+struct mem_ehdr;
|
||||||
|
int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
|
||||||
|
unsigned long max_addr, unsigned long min_base);
|
||||||
|
+void set_command_line_size(struct mem_ehdr *ehdr);
|
||||||
|
+
|
||||||
|
|
||||||
|
#define PAGE_OFFSET 0xc0000000
|
||||||
|
#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
|
||||||
|
@@ -19,4 +22,6 @@ int load_crashdump_segments(struct kexec
|
||||||
|
#define BACKUP_SRC_END 0x0009ffff
|
||||||
|
#define BACKUP_SRC_SIZE (BACKUP_SRC_END - BACKUP_SRC_START + 1)
|
||||||
|
|
||||||
|
+extern int real_command_line_size;
|
||||||
|
+
|
||||||
|
#endif /* CRASHDUMP_X86_H */
|
||||||
|
Index: b/kexec/arch/x86_64/crashdump-x86_64.c
|
||||||
|
===================================================================
|
||||||
|
--- a/kexec/arch/x86_64/crashdump-x86_64.c
|
||||||
|
+++ b/kexec/arch/x86_64/crashdump-x86_64.c
|
||||||
|
@@ -50,6 +50,35 @@ static struct crash_elf_info elf_info =
|
||||||
|
/* Forward Declaration. */
|
||||||
|
static int exclude_crash_reserve_region(int *nr_ranges);
|
||||||
|
|
||||||
|
+/* real length of the command line from the kernel image, needed because
|
||||||
|
+ * command line size on x86-64 was increased recently in -mm tree */
|
||||||
|
+int real_command_line_size = COMMAND_LINE_SIZE;
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+/* Tries to read the kernel command line size from the symbol table
|
||||||
|
+ * of the ELF kernel binary. */
|
||||||
|
+void set_command_line_size(struct mem_ehdr *ehdr)
|
||||||
|
+{
|
||||||
|
+ int ret;
|
||||||
|
+ struct mem_sym mem_sym;
|
||||||
|
+
|
||||||
|
+ /* > 2.6.20-rc6-mm */
|
||||||
|
+ ret = elf_rel_find_symbol(ehdr, "saved_command_line", &mem_sym);
|
||||||
|
+ if (ret != 0) {
|
||||||
|
+ /* older kernel */
|
||||||
|
+ ret = elf_rel_find_symbol(ehdr, "boot_command_line", &mem_sym);
|
||||||
|
+ if (ret != 0) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* current -mm kernel */
|
||||||
|
+ if (mem_sym.st_size >= 256 && mem_sym.st_size < COMMAND_LINE_SIZE) {
|
||||||
|
+ real_command_line_size = mem_sym.st_size;
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
#define KERN_VADDR_ALIGN 0x100000 /* 1MB */
|
||||||
|
|
||||||
|
/* Read kernel physical load addr from /proc/iomem (Kernel Code) and
|
||||||
|
@@ -494,7 +523,7 @@ static int cmdline_add_memmap(char *cmdl
|
||||||
|
strcat (str_mmap, "K");
|
||||||
|
len = strlen(str_mmap);
|
||||||
|
cmdlen = strlen(cmdline) + len;
|
||||||
|
- if (cmdlen > (COMMAND_LINE_SIZE - 1))
|
||||||
|
+ if (cmdlen > (real_command_line_size - 1))
|
||||||
|
die("Command line overflow\n");
|
||||||
|
strcat(cmdline, str_mmap);
|
||||||
|
}
|
||||||
|
@@ -523,7 +552,7 @@ static int cmdline_add_elfcorehdr(char *
|
||||||
|
strcat(str, "K");
|
||||||
|
len = strlen(str);
|
||||||
|
cmdlen = strlen(cmdline) + len;
|
||||||
|
- if (cmdlen > (COMMAND_LINE_SIZE - 1))
|
||||||
|
+ if (cmdlen > (real_command_line_size - 1))
|
||||||
|
die("Command line overflow\n");
|
||||||
|
strcat(cmdline, str);
|
||||||
|
#ifdef DEBUG
|
||||||
|
@@ -555,7 +584,7 @@ static int cmdline_add_memmap_acpi(char
|
||||||
|
strcat (str_mmap, "K");
|
||||||
|
len = strlen(str_mmap);
|
||||||
|
cmdlen = strlen(cmdline) + len;
|
||||||
|
- if (cmdlen > (COMMAND_LINE_SIZE - 1))
|
||||||
|
+ if (cmdlen > (real_command_line_size - 1))
|
||||||
|
die("Command line overflow\n");
|
||||||
|
strcat(cmdline, str_mmap);
|
||||||
|
|
||||||
|
Index: b/kexec/arch/x86_64/crashdump-x86_64.h
|
||||||
|
===================================================================
|
||||||
|
--- a/kexec/arch/x86_64/crashdump-x86_64.h
|
||||||
|
+++ b/kexec/arch/x86_64/crashdump-x86_64.h
|
||||||
|
@@ -3,6 +3,7 @@
|
||||||
|
|
||||||
|
int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline,
|
||||||
|
unsigned long max_addr, unsigned long min_base);
|
||||||
|
+void set_command_line_size(struct mem_ehdr *ehdr);
|
||||||
|
|
||||||
|
#define __START_KERNEL_map 0xffffffff80000000UL
|
||||||
|
#define PAGE_OFFSET 0xffff810000000000UL
|
||||||
|
@@ -21,4 +22,6 @@ int load_crashdump_segments(struct kexec
|
||||||
|
#define BACKUP_SRC_END 0x0009ffff
|
||||||
|
#define BACKUP_SRC_SIZE (BACKUP_SRC_END - BACKUP_SRC_START + 1)
|
||||||
|
|
||||||
|
+extern int real_command_line_size;
|
||||||
|
+
|
||||||
|
#endif /* CRASHDUMP_X86_64_H */
|
||||||
|
Index: b/kexec/arch/x86_64/kexec-elf-x86_64.c
|
||||||
|
===================================================================
|
||||||
|
--- a/kexec/arch/x86_64/kexec-elf-x86_64.c
|
||||||
|
+++ b/kexec/arch/x86_64/kexec-elf-x86_64.c
|
||||||
|
@@ -166,12 +166,12 @@ int elf_x86_64_load(int argc, char **arg
|
||||||
|
* taking crash dumps.
|
||||||
|
*/
|
||||||
|
if (info->kexec_flags & KEXEC_ON_CRASH) {
|
||||||
|
- modified_cmdline = xmalloc(COMMAND_LINE_SIZE);
|
||||||
|
- memset((void *)modified_cmdline, 0, COMMAND_LINE_SIZE);
|
||||||
|
+ modified_cmdline = xmalloc(real_command_line_size);
|
||||||
|
+ memset((void *)modified_cmdline, 0, real_command_line_size);
|
||||||
|
if (command_line) {
|
||||||
|
strncpy(modified_cmdline, command_line,
|
||||||
|
- COMMAND_LINE_SIZE);
|
||||||
|
- modified_cmdline[COMMAND_LINE_SIZE - 1] = '\0';
|
||||||
|
+ real_command_line_size);
|
||||||
|
+ modified_cmdline[real_command_line_size - 1] = '\0';
|
||||||
|
}
|
||||||
|
modified_cmdline_len = strlen(modified_cmdline);
|
||||||
|
}
|
||||||
|
@@ -182,6 +182,9 @@ int elf_x86_64_load(int argc, char **arg
|
||||||
|
entry = ehdr.e_entry;
|
||||||
|
max_addr = elf_max_addr(&ehdr);
|
||||||
|
|
||||||
|
+ /* try to set the command line size correctly */
|
||||||
|
+ set_command_line_size(&ehdr);
|
||||||
|
+
|
||||||
|
/* Do we want arguments? */
|
||||||
|
if (arg_style != ARG_STYLE_NONE) {
|
||||||
|
/* Load the setup code */
|
||||||
|
Index: b/kexec/arch/i386/kexec-bzImage.c
|
||||||
|
===================================================================
|
||||||
|
--- a/kexec/arch/i386/kexec-bzImage.c
|
||||||
|
+++ b/kexec/arch/i386/kexec-bzImage.c
|
||||||
|
@@ -156,12 +156,12 @@ int do_bzImage_load(struct kexec_info *i
|
||||||
|
* taking crash dumps.
|
||||||
|
*/
|
||||||
|
if (info->kexec_flags & KEXEC_ON_CRASH) {
|
||||||
|
- modified_cmdline = xmalloc(COMMAND_LINE_SIZE);
|
||||||
|
- memset((void *)modified_cmdline, 0, COMMAND_LINE_SIZE);
|
||||||
|
+ modified_cmdline = xmalloc(real_command_line_size);
|
||||||
|
+ memset((void *)modified_cmdline, 0, real_command_line_size);
|
||||||
|
if (command_line) {
|
||||||
|
strncpy(modified_cmdline, command_line,
|
||||||
|
- COMMAND_LINE_SIZE);
|
||||||
|
- modified_cmdline[COMMAND_LINE_SIZE - 1] = '\0';
|
||||||
|
+ real_command_line_size);
|
||||||
|
+ modified_cmdline[real_command_line_size - 1] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If panic kernel is being loaded, additional segments need
|
||||||
|
Index: b/kexec/arch/i386/kexec-elf-x86.c
|
||||||
|
===================================================================
|
||||||
|
--- a/kexec/arch/i386/kexec-elf-x86.c
|
||||||
|
+++ b/kexec/arch/i386/kexec-elf-x86.c
|
||||||
|
@@ -166,12 +166,12 @@ int elf_x86_load(int argc, char **argv,
|
||||||
|
* taking crash dumps.
|
||||||
|
*/
|
||||||
|
if (info->kexec_flags & KEXEC_ON_CRASH) {
|
||||||
|
- modified_cmdline = xmalloc(COMMAND_LINE_SIZE);
|
||||||
|
- memset((void *)modified_cmdline, 0, COMMAND_LINE_SIZE);
|
||||||
|
+ modified_cmdline = xmalloc(real_command_line_size);
|
||||||
|
+ memset((void *)modified_cmdline, 0, real_command_line_size);
|
||||||
|
if (command_line) {
|
||||||
|
strncpy(modified_cmdline, command_line,
|
||||||
|
- COMMAND_LINE_SIZE);
|
||||||
|
- modified_cmdline[COMMAND_LINE_SIZE - 1] = '\0';
|
||||||
|
+ real_command_line_size);
|
||||||
|
+ modified_cmdline[real_command_line_size - 1] = '\0';
|
||||||
|
}
|
||||||
|
modified_cmdline_len = strlen(modified_cmdline);
|
||||||
|
}
|
||||||
|
Index: b/kexec/arch/i386/x86-linux-setup.c
|
||||||
|
===================================================================
|
||||||
|
--- a/kexec/arch/i386/x86-linux-setup.c
|
||||||
|
+++ b/kexec/arch/i386/x86-linux-setup.c
|
||||||
|
@@ -32,6 +32,8 @@
|
||||||
|
#include "kexec-x86.h"
|
||||||
|
#include "x86-linux-setup.h"
|
||||||
|
|
||||||
|
+extern int real_command_line_size;
|
||||||
|
+
|
||||||
|
void init_linux_parameters(struct x86_linux_param_header *real_mode)
|
||||||
|
{
|
||||||
|
/* Fill in the values that are usually provided by the kernel. */
|
||||||
|
@@ -91,8 +93,8 @@ void setup_linux_bootloader_parameters(
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fill in the command line */
|
||||||
|
- if (cmdline_len > COMMAND_LINE_SIZE) {
|
||||||
|
- cmdline_len = COMMAND_LINE_SIZE;
|
||||||
|
+ if (cmdline_len > real_command_line_size) {
|
||||||
|
+ cmdline_len = real_command_line_size;
|
||||||
|
}
|
||||||
|
cmdline_ptr = ((char *)real_mode) + cmdline_offset;
|
||||||
|
memcpy(cmdline_ptr, cmdline, cmdline_len);
|
@ -1,101 +0,0 @@
|
|||||||
* On ppc64 memory ranges in device-tree is denoted as start and size.
|
|
||||||
* While in case of other architectures like i386 it is represented as start and
|
|
||||||
* end. Because of this when loading the memory ranges in crashdump-elf.c the
|
|
||||||
* filesz calculation using start and end values of memory range goes for a toss.
|
|
||||||
*
|
|
||||||
* phdr->p_filesz = phdr->p_memsz = mend - mstart + 1;
|
|
||||||
*
|
|
||||||
* Because of the +1 in above statement the generated vmcore is not a valid
|
|
||||||
* dump file.
|
|
||||||
*
|
|
||||||
* There are different ways in which this problem can be fixed.
|
|
||||||
* A. Add a ifdef in crashdump-elf.c for elf machine type.
|
|
||||||
* if EM_PPC64 then
|
|
||||||
* filesz = end - start;
|
|
||||||
* else
|
|
||||||
* filesz = end - start + 1;
|
|
||||||
* fi
|
|
||||||
* B. Change the ppc64 specific code so as to follow the same convention when
|
|
||||||
* it comes to representing memory ranges.
|
|
||||||
* C. Create a PPC64 specific function to populate crash ranges and not use
|
|
||||||
* the generic function from crashdump-elf.c
|
|
||||||
*
|
|
||||||
* Of all these solutions B is the smallest and works well. Here is a patch
|
|
||||||
* to implement the same.
|
|
||||||
*
|
|
||||||
|
|
||||||
Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
|
|
||||||
---
|
|
||||||
|
|
||||||
diff -Naurp gittree/kexec/arch/ppc64/crashdump-ppc64.c gittree-new/kexec/arch/ppc64/crashdump-ppc64.c
|
|
||||||
--- gittree/kexec/arch/ppc64/crashdump-ppc64.c 2006-12-26 14:56:01.000000000 +0530
|
|
||||||
+++ gittree-new/kexec/arch/ppc64/crashdump-ppc64.c 2007-01-23 19:38:31.000000000 +0530
|
|
||||||
@@ -120,7 +120,7 @@ static int get_crash_memory_ranges(struc
|
|
||||||
|
|
||||||
/* create a separate program header for the backup region */
|
|
||||||
crash_memory_range[0].start = BACKUP_SRC_START;
|
|
||||||
- crash_memory_range[0].end = BACKUP_SRC_END;
|
|
||||||
+ crash_memory_range[0].end = BACKUP_SRC_END + 1;
|
|
||||||
crash_memory_range[0].type = RANGE_RAM;
|
|
||||||
memory_ranges++;
|
|
||||||
|
|
||||||
@@ -165,8 +165,8 @@ static int get_crash_memory_ranges(struc
|
|
||||||
|
|
||||||
start = ((unsigned long long *)buf)[0];
|
|
||||||
end = start + ((unsigned long long *)buf)[1];
|
|
||||||
- if (start == 0 && end >= BACKUP_SRC_END)
|
|
||||||
- start = BACKUP_SRC_END;
|
|
||||||
+ if (start == 0 && end >= (BACKUP_SRC_END + 1))
|
|
||||||
+ start = BACKUP_SRC_END + 1;
|
|
||||||
|
|
||||||
cstart = crash_base;
|
|
||||||
cend = crash_base + crash_size;
|
|
||||||
@@ -309,7 +309,8 @@ int load_crashdump_segments(struct kexec
|
|
||||||
{
|
|
||||||
void *tmp;
|
|
||||||
unsigned long sz, elfcorehdr;
|
|
||||||
- int nr_ranges, align = 1024;
|
|
||||||
+ int nr_ranges, align = 1024, i;
|
|
||||||
+ unsigned long long end;
|
|
||||||
struct memory_range *mem_range;
|
|
||||||
|
|
||||||
if (get_crash_memory_ranges(&mem_range, &nr_ranges) < 0)
|
|
||||||
@@ -323,6 +324,22 @@ int load_crashdump_segments(struct kexec
|
|
||||||
0, max_addr, 1);
|
|
||||||
reserve(info->backup_start, sz);
|
|
||||||
|
|
||||||
+ /* On ppc64 memory ranges in device-tree is denoted as start
|
|
||||||
+ * and size rather than start and end, as is the case with
|
|
||||||
+ * other architectures like i386 . Because of this when loading
|
|
||||||
+ * the memory ranges in crashdump-elf.c the filesz calculation
|
|
||||||
+ * [ end - start + 1 ] goes for a toss.
|
|
||||||
+ *
|
|
||||||
+ * To be in sync with other archs adjust the end value for
|
|
||||||
+ * every crash memory range before calling the generic function
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+ for (i = 0; i < nr_ranges; i++) {
|
|
||||||
+ end = crash_memory_range[i].end - 1;
|
|
||||||
+ crash_memory_range[i].end = end;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+
|
|
||||||
/* Create elf header segment and store crash image data. */
|
|
||||||
if (arch_options.core_header_type == CORE_TYPE_ELF64) {
|
|
||||||
if (crash_create_elf64_headers(info, &elf_info64,
|
|
||||||
diff -Naurp gittree/kexec/arch/ppc64/crashdump-ppc64.h gittree-new/kexec/arch/ppc64/crashdump-ppc64.h
|
|
||||||
--- gittree/kexec/arch/ppc64/crashdump-ppc64.h 2006-12-26 14:56:01.000000000 +0530
|
|
||||||
+++ gittree-new/kexec/arch/ppc64/crashdump-ppc64.h 2007-01-23 19:09:54.000000000 +0530
|
|
||||||
@@ -16,10 +16,10 @@ void add_usable_mem_rgns(unsigned long l
|
|
||||||
#define COMMAND_LINE_SIZE 512 /* from kernel */
|
|
||||||
/* Backup Region, First 64K of System RAM. */
|
|
||||||
#define BACKUP_SRC_START 0x0000
|
|
||||||
-#define BACKUP_SRC_END 0x10000
|
|
||||||
+#define BACKUP_SRC_END 0xffff
|
|
||||||
#define BACKUP_SRC_SIZE (BACKUP_SRC_END - BACKUP_SRC_START + 1)
|
|
||||||
|
|
||||||
-#define KDUMP_BACKUP_LIMIT BACKUP_SRC_END
|
|
||||||
+#define KDUMP_BACKUP_LIMIT BACKUP_SRC_SIZE
|
|
||||||
#define _ALIGN_UP(addr,size) (((addr)+((size)-1))&(~((size)-1)))
|
|
||||||
#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1)))
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:bdf67b1ccb092c5ed806728707bebabb28448561c552ea0d1c96d151b422b87c
|
|
||||||
size 176790
|
|
3
kexec-tools-testing-20070205.tar.bz2
Normal file
3
kexec-tools-testing-20070205.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:4a6db77bc82e051ee0a77d5152124402d279f41e0f4bb98cdd5c54ee7d912e6b
|
||||||
|
size 179664
|
@ -1,3 +1,17 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 5 12:38:11 CET 2007 - tiwai@suse.de
|
||||||
|
|
||||||
|
- updated to kexec-tools 2007.02.05:
|
||||||
|
* including last fixes
|
||||||
|
* fix for ppc64 dynamic memory range allocation (#242075)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Feb 2 16:46:35 CET 2007 - bwalle@suse.de
|
||||||
|
|
||||||
|
- fixes overflow on large IA64 systems (#241544)
|
||||||
|
- added KDUMP_COMMANDLINE_APPEND variable (#241607)
|
||||||
|
- increase the command line size (#236828)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jan 29 15:41:43 CET 2007 - olh@suse.de
|
Mon Jan 29 15:41:43 CET 2007 - olh@suse.de
|
||||||
|
|
||||||
|
@ -12,14 +12,14 @@
|
|||||||
|
|
||||||
Name: kexec-tools
|
Name: kexec-tools
|
||||||
%define helperversion 0.1.0
|
%define helperversion 0.1.0
|
||||||
%define package_version testing-20061219
|
%define package_version testing-20070205
|
||||||
License: GNU General Public License (GPL)
|
License: GNU General Public License (GPL)
|
||||||
Group: System/Kernel
|
Group: System/Kernel
|
||||||
Requires: %insserv_prereq %fillup_prereq
|
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: 67
|
Release: 68
|
||||||
Source: %{name}-%{package_version}.tar.bz2
|
Source: %{name}-%{package_version}.tar.bz2
|
||||||
Source1: kdump
|
Source1: kdump
|
||||||
Source2: sysconfig.kdump
|
Source2: sysconfig.kdump
|
||||||
@ -27,7 +27,7 @@ Source3: gdbinit.kdump
|
|||||||
Source4: gdb-kdump
|
Source4: gdb-kdump
|
||||||
Source5: README.SUSE
|
Source5: README.SUSE
|
||||||
Source6: kdump-helper-%{helperversion}.tar.bz2
|
Source6: kdump-helper-%{helperversion}.tar.bz2
|
||||||
Patch: kexec-tools-ppc64-range-fix.diff
|
Patch1: kexec-longer-cmdline.diff
|
||||||
URL: http://www.xmission.com/~ebiederm/files/kexec/
|
URL: http://www.xmission.com/~ebiederm/files/kexec/
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
BuildRequires: libelf
|
BuildRequires: libelf
|
||||||
@ -52,7 +52,7 @@ Authors:
|
|||||||
%prep
|
%prep
|
||||||
%setup -b 6 -q -n kdump-helper-%{helperversion}
|
%setup -b 6 -q -n kdump-helper-%{helperversion}
|
||||||
%setup -q -n kexec-tools
|
%setup -q -n kexec-tools
|
||||||
%patch -p1
|
%patch1 -p1
|
||||||
%{?suse_update_config -f}
|
%{?suse_update_config -f}
|
||||||
cp %{SOURCE5} .
|
cp %{SOURCE5} .
|
||||||
|
|
||||||
@ -120,6 +120,14 @@ cd -
|
|||||||
%{_sbindir}/kdump-helper
|
%{_sbindir}/kdump-helper
|
||||||
|
|
||||||
%changelog -n kexec-tools
|
%changelog -n kexec-tools
|
||||||
|
* Mon Feb 05 2007 - tiwai@suse.de
|
||||||
|
- updated to kexec-tools 2007.02.05:
|
||||||
|
* including last fixes
|
||||||
|
* fix for ppc64 dynamic memory range allocation (#242075)
|
||||||
|
* Fri Feb 02 2007 - bwalle@suse.de
|
||||||
|
- fixes overflow on large IA64 systems (#241544)
|
||||||
|
- added KDUMP_COMMANDLINE_APPEND variable (#241607)
|
||||||
|
- increase the command line size (#236828)
|
||||||
* Mon Jan 29 2007 - olh@suse.de
|
* Mon Jan 29 2007 - olh@suse.de
|
||||||
- do not unload kdump kernel during runlevel changes (#238733)
|
- do not unload kdump kernel during runlevel changes (#238733)
|
||||||
* Thu Jan 25 2007 - bwalle@suse.de
|
* Thu Jan 25 2007 - bwalle@suse.de
|
||||||
|
@ -27,6 +27,16 @@ KDUMP_KERNELVER="kdump"
|
|||||||
#
|
#
|
||||||
KDUMP_COMMANDLINE=""
|
KDUMP_COMMANDLINE=""
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: ""
|
||||||
|
## ServiceRestart: kdump
|
||||||
|
#
|
||||||
|
# Set this variable if you only want to _append_ values to the default
|
||||||
|
# command line string. The string gets also appended if KDUMP_COMMANDLINE
|
||||||
|
# is set.
|
||||||
|
#
|
||||||
|
KDUMP_COMMANDLINE_APPEND=""
|
||||||
|
|
||||||
## Type: string
|
## Type: string
|
||||||
## Default: ""
|
## Default: ""
|
||||||
## ServiceRestart: kdump
|
## ServiceRestart: kdump
|
||||||
|
Loading…
Reference in New Issue
Block a user