rpms/kexec-tools/devel kexec-tools-1.101-kdump.patch, 1.1, 1.2 kexec-tools.spec, 1.5, 1.6
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Mon Jan 30 20:03:07 UTC 2006
Author: tgraf
Update of /cvs/dist/rpms/kexec-tools/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv24125
Modified Files:
kexec-tools-1.101-kdump.patch kexec-tools.spec
Log Message:
New kdump patch to support x86_64 userspace
kexec-tools-1.101-kdump.patch:
configure | 12
kexec/Makefile | 1
kexec/arch/i386/Makefile | 1
kexec/arch/i386/crashdump-x86.c | 724 +++++++++++++++++++++++++++++
kexec/arch/i386/crashdump-x86.h | 21
kexec/arch/i386/include/arch/options.h | 6
kexec/arch/i386/kexec-bzImage.c | 2
kexec/arch/i386/kexec-elf-x86.c | 48 +
kexec/arch/i386/kexec-multiboot-x86.c | 3
kexec/arch/i386/kexec-x86.c | 52 +-
kexec/arch/i386/kexec-x86.h | 13
kexec/arch/i386/x86-linux-setup.c | 5
kexec/arch/i386/x86-linux-setup.h | 3
kexec/arch/ia64/kexec-ia64.c | 12
kexec/arch/ppc/kexec-ppc.c | 8
kexec/arch/ppc64/Makefile | 5
kexec/arch/ppc64/fs2dt.c | 340 +++++++++++++
kexec/arch/ppc64/kexec-elf-ppc64.c | 265 +++++++++-
kexec/arch/ppc64/kexec-elf-rel-ppc64.c | 2
kexec/arch/ppc64/kexec-ppc64.c | 527 +++++++++++++++++++++
kexec/arch/ppc64/kexec-ppc64.h | 15
kexec/arch/s390/Makefile | 6
kexec/arch/s390/include/arch/options.h | 11
kexec/arch/s390/kexec-elf-rel-s390.c | 23
kexec/arch/s390/kexec-image.c | 137 +++++
kexec/arch/s390/kexec-s390.c | 104 ++++
kexec/arch/s390/kexec-s390.h | 25 +
kexec/arch/x86_64/Makefile | 1
kexec/arch/x86_64/crashdump-x86_64.c | 766 +++++++++++++++++++++++++++++++
kexec/arch/x86_64/crashdump-x86_64.h | 24
kexec/arch/x86_64/include/arch/options.h | 6
kexec/arch/x86_64/kexec-elf-x86_64.c | 37 +
kexec/arch/x86_64/kexec-x86_64.c | 45 +
kexec/crashdump.c | 65 ++
kexec/crashdump.h | 9
kexec/kexec-syscall.h | 9
kexec/kexec.c | 22
kexec/kexec.h | 10
purgatory/Makefile | 12
purgatory/arch/i386/Makefile | 1
purgatory/arch/i386/crashdump_backup.c | 46 +
purgatory/arch/i386/purgatory-x86.c | 7
purgatory/arch/i386/purgatory-x86.h | 1
purgatory/arch/ia64/purgatory-ia64.c | 6
purgatory/arch/ppc/purgatory-ppc.c | 6
purgatory/arch/ppc64/Makefile | 2
purgatory/arch/ppc64/v2wrap.S | 114 ++++
purgatory/arch/s390/Makefile | 7
purgatory/arch/s390/include/limits.h | 54 ++
purgatory/arch/s390/include/stdint.h | 24
purgatory/arch/x86_64/Makefile | 1
purgatory/arch/x86_64/purgatory-x86_64.c | 7
purgatory/include/purgatory.h | 1
purgatory/purgatory.c | 1
54 files changed, 3562 insertions(+), 93 deletions(-)
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.1 -r 1.2 kexec-tools-1.101-kdump.patch
Index: kexec-tools-1.101-kdump.patch
===================================================================
RCS file: /cvs/dist/rpms/kexec-tools/devel/kexec-tools-1.101-kdump.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- kexec-tools-1.101-kdump.patch 29 Aug 2005 20:12:47 -0000 1.1
+++ kexec-tools-1.101-kdump.patch 30 Jan 2006 20:02:21 -0000 1.2
@@ -1,7 +1,41 @@
-diff -Nurp kexec-tools-1.101-orig/kexec/arch/i386/crashdump-x86.c kexec-tools-1.101-kdump/kexec/arch/i386/crashdump-x86.c
---- kexec-tools-1.101-orig/kexec/arch/i386/crashdump-x86.c 1970-01-01 05:30:00.000000000 +0530
-+++ kexec-tools-1.101-kdump/kexec/arch/i386/crashdump-x86.c 2005-08-24 15:46:08.636240824 +0530
-@@ -0,0 +1,723 @@
+diff -urNp -X dontdiff kexec-tools-1.101/configure kexec-tools-1.101-kdump/configure
+--- kexec-tools-1.101/configure 2005-02-16 18:07:44.000000000 +0530
++++ kexec-tools-1.101-kdump/configure 2005-12-14 16:00:40.000000000 +0530
+@@ -1384,12 +1384,18 @@ case $host_cpu in
+ powerpc )
+ host_cpu="ppc"
+ ;;
++ powerpc64 )
++ host_cpu="ppc64"
++ ;;
++ s390x )
++ host_cpu="s390"
++ ;;
+ * )
+ host_cpu="$host_cpu"
+ ;;
+ esac
+ case $host_cpu in
+- i386|ppc|x86_64|alpha|ppc64|ia64)
++ i386|ppc|x86_64|alpha|ppc64|ia64|s390)
+ ;;
+ * )
+ { { echo "$as_me:$LINENO: error: unsupported architecture $host_cpu" >&5
+@@ -1421,6 +1427,10 @@ if test "${with_gamecube+set}" = set; th
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DCONFIG_GAMECUBE=1"
+ fi;
+
++# Check whether ppc64. Add -m64 for building 64-bit binary
++if test "$ARCH" = ppc64; then
++ EXTRA_CFLAGS="$EXTRA_CFLAGS -m64"
++fi;
+
+ # Check whether --with-zlib or --without-zlib was given.
+ if test "${with_zlib+set}" = set; then
+diff -urNp -X dontdiff kexec-tools-1.101/kexec/arch/i386/crashdump-x86.c kexec-tools-1.101-kdump/kexec/arch/i386/crashdump-x86.c
+--- kexec-tools-1.101/kexec/arch/i386/crashdump-x86.c 1970-01-01 05:30:00.000000000 +0530
++++ kexec-tools-1.101-kdump/kexec/arch/i386/crashdump-x86.c 2005-12-15 16:51:43.720392560 +0530
+@@ -0,0 +1,724 @@
+/*
+ * kexec: Linux boots Linux
+ *
@@ -27,15 +61,17 @@
+#include <errno.h>
+#include <limits.h>
+#include <elf.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
+#include "../../kexec.h"
+#include "../../kexec-elf.h"
+#include "../../kexec-syscall.h"
++#include "../../crashdump.h"
+#include "kexec-x86.h"
+#include "crashdump-x86.h"
+#include <x86/x86-linux.h>
+
-+#define MAX_LINE 160
-+
+extern struct arch_options_t arch_options;
+
+/* Forward Declaration. */
@@ -430,33 +466,36 @@
+ return 0;
+}
+
-+/* Returns the virtual address of start of crash notes section. */
-+static int get_crash_notes_section_addr(unsigned long *addr)
++
++/*
++ * This routine is specific to i386 architecture to maintain the
++ * backward compatibility, other architectures can use the per
++ * cpu version get_crash_notes_per_cpu() directly.
++ */
++static int get_crash_notes(int cpu, uint64_t *addr)
+{
-+ const char crash_notes[]= "/sys/kernel/crash_notes";
++ char crash_notes[PATH_MAX];
+ char line[MAX_LINE];
+ FILE *fp;
++ unsigned long vaddr;
++ int count;
+
++ sprintf(crash_notes, "/sys/kernel/crash_notes");
+ fp = fopen(crash_notes, "r");
-+ if (!fp) {
-+ fprintf(stderr, "Cannot open %s: %s\n",
-+ crash_notes, strerror(errno));
-+ fprintf(stderr, "Try mounting sysfs\n");
-+ return -1;
-+ }
-+
-+ if (fgets(line, sizeof(line), fp) != 0) {
-+ int count;
-+ count = sscanf(line, "%lx", addr);
-+ if (count != 1) {
-+ *addr = 0;
-+ return -1;
++ if (fp) {
++ if (fgets(line, sizeof(line), fp) != 0) {
++ count = sscanf(line, "%lx", &vaddr);
++ if (count != 1)
++ die("Cannot parse %s: %s\n", crash_notes,
++ strerror(errno));
+ }
++ *addr = __pa(vaddr + (cpu * MAX_NOTE_BYTES));
+#if 0
-+ printf("crash_notes addr = %lx\n", *addr);
++ printf("crash_notes addr = %Lx\n", *addr);
+#endif
-+ }
-+ return 0;
++ return 0;
++ } else
++ return get_crash_notes_per_cpu(cpu, addr);
+}
+
+/* Prepares the crash memory elf64 headers and stores in supplied buffer. */
@@ -468,7 +507,7 @@
+ int i;
+ char *bufp;
+ long int nr_cpus = 0;
-+ unsigned long notes_addr, notes_offset;
++ uint64_t notes_addr;
+
+ bufp = (char*) buf;
+
@@ -501,23 +540,20 @@
+ return -1;
+ }
+
-+ /* Need to find a better way to determine per cpu notes section size. */
-+#define MAX_NOTE_BYTES 1024
-+ if (get_crash_notes_section_addr (¬es_addr) < 0) {
-+ return -1;
-+ }
-+ notes_offset = __pa(notes_addr);
+ for (i = 0; i < nr_cpus; i++) {
++ if (get_crash_notes(i, ¬es_addr) < 0) {
++ /* This cpu is not present. Skip it. */
++ continue;
++ }
+ phdr = (Elf64_Phdr *) bufp;
+ bufp += sizeof(Elf64_Phdr);
+ phdr->p_type = PT_NOTE;
+ phdr->p_flags = 0;
-+ phdr->p_offset = notes_offset;
-+ phdr->p_vaddr = phdr->p_paddr = notes_offset;
++ phdr->p_offset = phdr->p_paddr = notes_addr;
++ phdr->p_vaddr = 0;
+ phdr->p_filesz = phdr->p_memsz = MAX_NOTE_BYTES;
+ /* Do we need any alignment of segments? */
+ phdr->p_align = 0;
-+ notes_offset += MAX_NOTE_BYTES;
+
+ /* Increment number of program headers. */
+ (elf->e_phnum)++;
@@ -564,7 +600,7 @@
+ int i;
+ char *bufp;
+ long int nr_cpus = 0;
-+ unsigned long notes_addr, notes_offset;
++ uint64_t notes_addr;
+
+ bufp = (char*) buf;
+
@@ -599,21 +635,20 @@
+
+ /* Need to find a better way to determine per cpu notes section size. */
+#define MAX_NOTE_BYTES 1024
-+ if (get_crash_notes_section_addr (¬es_addr) < 0) {
-+ return -1;
-+ }
-+ notes_offset = __pa(notes_addr);
+ for (i = 0; i < nr_cpus; i++) {
++ if (get_crash_notes(i, ¬es_addr) < 0) {
++ /* This cpu is not present. Skip it. */
++ return -1;
++ }
+ phdr = (Elf32_Phdr *) bufp;
+ bufp += sizeof(Elf32_Phdr);
+ phdr->p_type = PT_NOTE;
+ phdr->p_flags = 0;
-+ phdr->p_offset = notes_offset;
-+ phdr->p_vaddr = phdr->p_paddr = notes_offset;
++ phdr->p_offset = phdr->p_paddr = notes_addr;
++ phdr->p_vaddr = 0;
+ phdr->p_filesz = phdr->p_memsz = MAX_NOTE_BYTES;
[...3659 lines suppressed...]
++ std 6,-16(3) # send slaves back down
++ bctr # start kernel
++
++ .org 0xf0
++copied: .llong 0
++kernel: .llong 0
++ .org 0x100
++__end_stub:
++ .equ boot_block, . - start
+diff -urNp -X dontdiff kexec-tools-1.101/purgatory/arch/s390/include/limits.h kexec-tools-1.101-kdump/purgatory/arch/s390/include/limits.h
+--- kexec-tools-1.101/purgatory/arch/s390/include/limits.h 1970-01-01 05:30:00.000000000 +0530
++++ kexec-tools-1.101-kdump/purgatory/arch/s390/include/limits.h 2005-12-14 16:00:40.000000000 +0530
+@@ -0,0 +1,54 @@
++#ifndef _LIMITS_H_
++#define _LIMITS_H_
++
++/* Number of bits in a `char'. */
++# define CHAR_BIT 8
++
++/* Minimum and maximum values a `signed char' can hold. */
++# define SCHAR_MIN (-128)
++# define SCHAR_MAX 127
++
++/* Maximum value an `unsigned char' can hold. (Minimum is 0.) */
++# define UCHAR_MAX 255
++
++# define CHAR_MIN SCHAR_MIN
++# define CHAR_MAX SCHAR_MAX
++
++/* Minimum and maximum values a `signed short int' can hold. */
++# define SHRT_MIN (-32768)
++# define SHRT_MAX 32767
++
++/* Maximum value an `unsigned short int' can hold. (Minimum is 0.) */
++# define USHRT_MAX 65535
++
++/* Minimum and maximum values a `signed int' can hold. */
++# define INT_MIN (-INT_MAX - 1)
++# define INT_MAX 2147483647
++
++/* Maximum value an `unsigned int' can hold. (Minimum is 0.) */
++# define UINT_MAX 4294967295U
++
++/* Minimum and maximum values a `signed long int' can hold. */
++#ifdef __s390x__
++# define LONG_MAX 9223372036854775807L
++#else
++# define LONG_MAX 2147483647L
++#endif
++
++# define LONG_MIN (-LONG_MAX - 1L)
++
++/* Maximum value an `unsigned long int' can hold. (Minimum is 0.) */
++#ifdef __s390x__
++# define ULONG_MAX 18446744073709551615UL
++#else
++# define ULONG_MAX 4294967295UL
++#endif
++
++/* Minimum and maximum values a `signed long long int' can hold. */
++# define LLONG_MAX 9223372036854775807LL
++# define LLONG_MIN (-LLONG_MAX - 1LL)
++
++/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
++# define ULLONG_MAX 18446744073709551615ULL
++
++#endif /* !_LIMITS_H_ */
+diff -urNp -X dontdiff kexec-tools-1.101/purgatory/arch/s390/include/stdint.h kexec-tools-1.101-kdump/purgatory/arch/s390/include/stdint.h
+--- kexec-tools-1.101/purgatory/arch/s390/include/stdint.h 1970-01-01 05:30:00.000000000 +0530
++++ kexec-tools-1.101-kdump/purgatory/arch/s390/include/stdint.h 2005-12-14 16:00:40.000000000 +0530
+@@ -0,0 +1,24 @@
++#ifndef _STDINT_H
++#define _STDINT_H
++
++typedef unsigned long size_t;
++
++typedef unsigned char uint8_t;
++typedef unsigned short uint16_t;
++typedef unsigned int uint32_t;
++#ifdef __s390x__
++typedef unsigned long uint64_t;
++#else
++typedef unsigned long long uint64_t;
++#endif
++
++typedef signed char int8_t;
++typedef short int16_t;
++typedef int int32_t;
++#ifdef __s390x__
++typedef long int64_t;
++#else
++typedef long long int64_t;
++#endif
++
++#endif
+diff -urNp -X dontdiff kexec-tools-1.101/purgatory/arch/s390/Makefile kexec-tools-1.101-kdump/purgatory/arch/s390/Makefile
+--- kexec-tools-1.101/purgatory/arch/s390/Makefile 1970-01-01 05:30:00.000000000 +0530
++++ kexec-tools-1.101-kdump/purgatory/arch/s390/Makefile 2005-12-14 16:00:40.000000000 +0530
+@@ -0,0 +1,7 @@
++#
++# Purgatory s390
++#
++
++PURGATORY_C_SRCS+=
++PURGATORY_S_SRCS+=
++
+diff -urNp -X dontdiff kexec-tools-1.101/purgatory/arch/x86_64/Makefile kexec-tools-1.101-kdump/purgatory/arch/x86_64/Makefile
+--- kexec-tools-1.101/purgatory/arch/x86_64/Makefile 2004-12-21 12:43:53.000000000 +0530
++++ kexec-tools-1.101-kdump/purgatory/arch/x86_64/Makefile 2005-12-14 16:00:56.000000000 +0530
+@@ -9,6 +9,7 @@ PURGATORY_S_SRCS+= purgatory/arch/x86_64
+ PURGATORY_S_SRCS+= purgatory/arch/x86_64/setup-x86_64.S
+ PURGATORY_S_SRCS+= purgatory/arch/x86_64/stack.S
+ PURGATORY_C_SRCS+= purgatory/arch/x86_64/purgatory-x86_64.c
++PURGATORY_C_SRCS+= purgatory/arch/i386/crashdump_backup.c
+ PURGATORY_C_SRCS+= purgatory/arch/i386/console-x86.c
+ PURGATORY_C_SRCS+= purgatory/arch/i386/vga.c
+ PURGATORY_C_SRCS+= purgatory/arch/i386/pic.c
+diff -urNp -X dontdiff kexec-tools-1.101/purgatory/arch/x86_64/purgatory-x86_64.c kexec-tools-1.101-kdump/purgatory/arch/x86_64/purgatory-x86_64.c
+--- kexec-tools-1.101/purgatory/arch/x86_64/purgatory-x86_64.c 2004-12-21 22:07:41.000000000 +0530
++++ kexec-tools-1.101-kdump/purgatory/arch/x86_64/purgatory-x86_64.c 2005-12-14 16:00:56.000000000 +0530
+@@ -4,9 +4,16 @@
+
+ uint8_t reset_vga = 0;
+ uint8_t legacy_pic = 0;
++uint8_t panic_kernel = 0;
+
+ void setup_arch(void)
+ {
if (reset_vga) x86_reset_vga();
if (legacy_pic) x86_setup_legacy_pic();
}
@@ -1488,11 +4450,11 @@
+/* This function can be used to execute after the SHA256 verification. */
+void post_verification_setup_arch(void)
+{
-+ /* Nothing for now */
++ if (panic_kernel) crashdump_backup_memory();
+}
-diff -Nurp kexec-tools-1.101-orig/purgatory/include/purgatory.h kexec-tools-1.101-kdump/purgatory/include/purgatory.h
---- kexec-tools-1.101-orig/purgatory/include/purgatory.h 2004-12-18 18:42:15.000000000 +0530
-+++ kexec-tools-1.101-kdump/purgatory/include/purgatory.h 2005-08-24 15:45:28.145396368 +0530
+diff -urNp -X dontdiff kexec-tools-1.101/purgatory/include/purgatory.h kexec-tools-1.101-kdump/purgatory/include/purgatory.h
+--- kexec-tools-1.101/purgatory/include/purgatory.h 2004-12-18 18:42:15.000000000 +0530
++++ kexec-tools-1.101-kdump/purgatory/include/purgatory.h 2005-12-14 15:57:15.000000000 +0530
@@ -4,5 +4,6 @@
void putchar(int ch);
void printf(const char *fmt, ...);
@@ -1500,9 +4462,49 @@
+void post_verification_setup_arch(void);
#endif /* PURGATORY_H */
-diff -Nurp kexec-tools-1.101-orig/purgatory/purgatory.c kexec-tools-1.101-kdump/purgatory/purgatory.c
---- kexec-tools-1.101-orig/purgatory/purgatory.c 2004-12-22 00:21:03.000000000 +0530
-+++ kexec-tools-1.101-kdump/purgatory/purgatory.c 2005-08-24 15:45:28.144396520 +0530
+diff -urNp -X dontdiff kexec-tools-1.101/purgatory/Makefile kexec-tools-1.101-kdump/purgatory/Makefile
+--- kexec-tools-1.101/purgatory/Makefile 2005-01-09 04:06:32.000000000 +0530
++++ kexec-tools-1.101-kdump/purgatory/Makefile 2005-12-14 15:57:19.000000000 +0530
+@@ -6,6 +6,11 @@
+ # There is probably a cleaner way to do this but for now this
+ # should keep us from accidentially include unsafe library functions
+ # or headers.
++
++ifeq ($(ARCH),ppc64)
++LDFLAGS = -melf64ppc
++endif
++
+ PCFLAGS:=-Wall -Os \
+ -I$(shell $(CC) -print-file-name=include) \
+ -Ipurgatory/include -Ipurgatory/arch/$(ARCH)/include \
+@@ -17,9 +22,11 @@ PCFLAGS += $(call cc-option, -fnostdinc)
+ PCFLAGS += $(call cc-option, -fno-zero-initialized-in-bss)
+
+ PURGATORY_C_SRCS:=
++ifneq ($(ARCH),ppc64)
+ PURGATORY_C_SRCS += purgatory/purgatory.c
+ PURGATORY_C_SRCS += purgatory/printf.c
+ PURGATORY_C_SRCS += purgatory/string.c
++endif
+ PURGATORY_S_OBJS:=
+
+ include purgatory/arch/$(ARCH)/Makefile
+@@ -54,7 +61,12 @@ $(PURGATORY_S_OBJS): $(OBJDIR)/%.o: %.S
+
+ $(PURGATORY): $(PURGATORY_OBJS) $(UTIL_LIB)
+ $(MKDIR) -p $(@D)
++ifneq ($(ARCH),ppc64)
+ $(LD) $(LDFLAGS) --no-undefined -e purgatory_start -r -o $@ $(PURGATORY_OBJS) $(UTIL_LIB)
++else
++ $(LD) -Ttext=0 -e 0 -o $(OBJDIR)/purgatory/v2wrap.elf $(PURGATORY_OBJS)
++ objcopy -O binary $(OBJDIR)/purgatory/v2wrap.elf $@
++endif
+
+ echo::
+ @echo "PURGATORY_C_SRCS $(PURGATORY_C_SRCS)"
+diff -urNp -X dontdiff kexec-tools-1.101/purgatory/purgatory.c kexec-tools-1.101-kdump/purgatory/purgatory.c
+--- kexec-tools-1.101/purgatory/purgatory.c 2004-12-22 00:21:03.000000000 +0530
++++ kexec-tools-1.101-kdump/purgatory/purgatory.c 2005-12-14 15:57:15.000000000 +0530
@@ -44,4 +44,5 @@ void purgatory(void)
printf("I'm in purgatory\n");
setup_arch();
Index: kexec-tools.spec
===================================================================
RCS file: /cvs/dist/rpms/kexec-tools/devel/kexec-tools.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- kexec-tools.spec 16 Dec 2005 23:20:48 -0000 1.5
+++ kexec-tools.spec 30 Jan 2006 20:02:36 -0000 1.6
@@ -1,6 +1,6 @@
Name: kexec-tools
Version: 1.101
-Release: 5.1
+Release: 6
License: GPL
Group: Applications/System
Summary: The kexec/kdump userspace component.
@@ -104,6 +104,9 @@
%doc TODO
%changelog
+* Mon Jan 30 2006 Thomas Graf <tgraf at redhat.com>
+- New kdump patch to support x86_64 userspace
+
* Fri Dec 16 2005 Jesse Keating <jkeating at redhat.com>
- rebuilt for new gcj
More information about the fedora-cvs-commits
mailing list