direct-io.hg

changeset 14437:bbda47597917

[LINUX] Update crash-kernel-32-on-64.patch with more sensible version from -mm.
The previous version had side effects outside of the crash dump code.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Mon Mar 19 14:00:07 2007 +0000 (2007-03-19)
parents 0611355e0df2
children 126a2c3c6a9d
files linux-2.6-xen-sparse/include/asm-i386/kexec.h patches/linux-2.6.18/allow-i386-crash-kernels-to-handle-x86_64-dumps-fix.patch patches/linux-2.6.18/allow-i386-crash-kernels-to-handle-x86_64-dumps.patch patches/linux-2.6.18/crash-kernel-32-on-64.patch patches/linux-2.6.18/series
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-i386/kexec.h	Mon Mar 19 13:48:00 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/kexec.h	Mon Mar 19 14:00:07 2007 +0000
     1.3 @@ -47,6 +47,9 @@
     1.4  /* The native architecture */
     1.5  #define KEXEC_ARCH KEXEC_ARCH_386
     1.6  
     1.7 +/* We can also handle crash dumps from 64 bit kernel. */
     1.8 +#define vmcore_elf_check_arch_cross(x) ((x)->e_machine == EM_X86_64)
     1.9 +
    1.10  #define MAX_NOTE_BYTES 1024
    1.11  
    1.12  /* CPU does not save ss and esp on stack if execution is already
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/patches/linux-2.6.18/allow-i386-crash-kernels-to-handle-x86_64-dumps-fix.patch	Mon Mar 19 14:00:07 2007 +0000
     2.3 @@ -0,0 +1,30 @@
     2.4 +From: Andrew Morton <akpm@linux-foundation.org>
     2.5 +
     2.6 +In file included from arch/i386/kernel/setup.c:46:
     2.7 +include/linux/crash_dump.h:19:36: warning: extra tokens at end of #ifndef directive
     2.8 +
     2.9 +Cc: "Eric W. Biederman" <ebiederm@xmission.com>
    2.10 +Cc: Andi Kleen <ak@suse.de>
    2.11 +Cc: Horms <horms@verge.net.au>
    2.12 +Cc: Ian Campbell <ian.campbell@xensource.com>
    2.13 +Cc: Magnus Damm <magnus.damm@gmail.com>
    2.14 +Cc: Vivek Goyal <vgoyal@in.ibm.com>
    2.15 +Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    2.16 +---
    2.17 +
    2.18 + include/linux/crash_dump.h |    2 +-
    2.19 + 1 file changed, 1 insertion(+), 1 deletion(-)
    2.20 +
    2.21 +diff -puN include/linux/crash_dump.h~allow-i386-crash-kernels-to-handle-x86_64-dumps-fix include/linux/crash_dump.h
    2.22 +--- a/include/linux/crash_dump.h~allow-i386-crash-kernels-to-handle-x86_64-dumps-fix
    2.23 ++++ a/include/linux/crash_dump.h
    2.24 +@@ -16,7 +16,7 @@ extern struct proc_dir_entry *proc_vmcor
    2.25 + 
    2.26 + /* Architecture code defines this if there are other possible ELF
    2.27 +  * machine types, e.g. on bi-arch capable hardware. */
    2.28 +-#ifndef vmcore_elf_check_arch_cross(x)
    2.29 ++#ifndef vmcore_elf_check_arch_cross
    2.30 + #define vmcore_elf_check_arch_cross(x) 0
    2.31 + #endif
    2.32 + 
    2.33 +_
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/patches/linux-2.6.18/allow-i386-crash-kernels-to-handle-x86_64-dumps.patch	Mon Mar 19 14:00:07 2007 +0000
     3.3 @@ -0,0 +1,66 @@
     3.4 +From: Ian Campbell <ian.campbell@xensource.com>
     3.5 +
     3.6 +The specific case I am encountering is kdump under Xen with a 64 bit
     3.7 +hypervisor and 32 bit kernel/userspace.  The dump created is 64 bit due to
     3.8 +the hypervisor but the dump kernel is 32 bit for maximum compatibility.
     3.9 +
    3.10 +It's possibly less likely to be useful in a purely native scenario but I
    3.11 +see no reason to disallow it.
    3.12 +
    3.13 +Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
    3.14 +Acked-by: Vivek Goyal <vgoyal@in.ibm.com>
    3.15 +Cc: Horms <horms@verge.net.au>
    3.16 +Cc: Magnus Damm <magnus.damm@gmail.com>
    3.17 +Cc: "Eric W. Biederman" <ebiederm@xmission.com>
    3.18 +Cc: Andi Kleen <ak@suse.de>
    3.19 +Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    3.20 +---
    3.21 +
    3.22 + fs/proc/vmcore.c           |    2 +-
    3.23 + include/asm-i386/kexec.h   |    3 +++
    3.24 + include/linux/crash_dump.h |    8 ++++++++
    3.25 + 3 files changed, 12 insertions(+), 1 deletion(-)
    3.26 +
    3.27 +diff -puN fs/proc/vmcore.c~allow-i386-crash-kernels-to-handle-x86_64-dumps fs/proc/vmcore.c
    3.28 +--- a/fs/proc/vmcore.c~allow-i386-crash-kernels-to-handle-x86_64-dumps
    3.29 ++++ a/fs/proc/vmcore.c
    3.30 +@@ -514,7 +514,7 @@ static int __init parse_crash_elf64_head
    3.31 + 	/* Do some basic Verification. */
    3.32 + 	if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0 ||
    3.33 + 		(ehdr.e_type != ET_CORE) ||
    3.34 +-		!elf_check_arch(&ehdr) ||
    3.35 ++		!vmcore_elf_check_arch(&ehdr) ||
    3.36 + 		ehdr.e_ident[EI_CLASS] != ELFCLASS64 ||
    3.37 + 		ehdr.e_ident[EI_VERSION] != EV_CURRENT ||
    3.38 + 		ehdr.e_version != EV_CURRENT ||
    3.39 +diff -puN include/asm-i386/kexec.h~allow-i386-crash-kernels-to-handle-x86_64-dumps include/asm-i386/kexec.h
    3.40 +--- a/include/asm-i386/kexec.h~allow-i386-crash-kernels-to-handle-x86_64-dumps
    3.41 ++++ a/include/asm-i386/kexec.h
    3.42 +@@ -47,6 +47,9 @@
    3.43 + /* The native architecture */
    3.44 + #define KEXEC_ARCH KEXEC_ARCH_386
    3.45 + 
    3.46 ++/* We can also handle crash dumps from 64 bit kernel. */
    3.47 ++#define vmcore_elf_check_arch_cross(x) ((x)->e_machine == EM_X86_64)
    3.48 ++
    3.49 + #define MAX_NOTE_BYTES 1024
    3.50 + 
    3.51 + /* CPU does not save ss and esp on stack if execution is already
    3.52 +diff -puN include/linux/crash_dump.h~allow-i386-crash-kernels-to-handle-x86_64-dumps include/linux/crash_dump.h
    3.53 +--- a/include/linux/crash_dump.h~allow-i386-crash-kernels-to-handle-x86_64-dumps
    3.54 ++++ a/include/linux/crash_dump.h
    3.55 +@@ -14,5 +14,13 @@ extern ssize_t copy_oldmem_page(unsigned
    3.56 + extern const struct file_operations proc_vmcore_operations;
    3.57 + extern struct proc_dir_entry *proc_vmcore;
    3.58 + 
    3.59 ++/* Architecture code defines this if there are other possible ELF
    3.60 ++ * machine types, e.g. on bi-arch capable hardware. */
    3.61 ++#ifndef vmcore_elf_check_arch_cross(x)
    3.62 ++#define vmcore_elf_check_arch_cross(x) 0
    3.63 ++#endif
    3.64 ++
    3.65 ++#define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x))
    3.66 ++
    3.67 + #endif /* CONFIG_CRASH_DUMP */
    3.68 + #endif /* LINUX_CRASHDUMP_H */
    3.69 +_
     4.1 --- a/patches/linux-2.6.18/crash-kernel-32-on-64.patch	Mon Mar 19 13:48:00 2007 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,11 +0,0 @@
     4.4 ---- pristine-linux-2.6.18/include/asm-i386/elf.h	2006-09-20 04:42:06.000000000 +0100
     4.5 -+++ linux-2.6.18-xen/include/asm-i386/elf.h	2007-03-14 16:42:30.000000000 +0000
     4.6 -@@ -36,7 +36,7 @@
     4.7 -  * This is used to ensure we don't load something for the wrong architecture.
     4.8 -  */
     4.9 - #define elf_check_arch(x) \
    4.10 --	(((x)->e_machine == EM_386) || ((x)->e_machine == EM_486))
    4.11 -+	(((x)->e_machine == EM_386) || ((x)->e_machine == EM_486) || ((x)->e_machine == EM_X86_64))
    4.12 - 
    4.13 - /*
    4.14 -  * These are used to set parameters in the core dumps.
     5.1 --- a/patches/linux-2.6.18/series	Mon Mar 19 13:48:00 2007 +0000
     5.2 +++ b/patches/linux-2.6.18/series	Mon Mar 19 14:00:07 2007 +0000
     5.3 @@ -19,4 +19,5 @@ x86-elfnote-as-preprocessor-macro.patch
     5.4  fixaddr-top.patch
     5.5  git-c06cb8b1c4d25e5b4d7a2d7c2462619de1e0dbc4.patch
     5.6  softlockup-no-idle-hz.patch
     5.7 -crash-kernel-32-on-64.patch
     5.8 +allow-i386-crash-kernels-to-handle-x86_64-dumps.patch
     5.9 +allow-i386-crash-kernels-to-handle-x86_64-dumps-fix.patch