Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54641
b: refs/heads/master
c: 6672f76
h: refs/heads/master
i:
  54639: b543c73
v: v3
  • Loading branch information
Simon Horman authored and Linus Torvalds committed May 8, 2007
1 parent 4cd389c commit 629c43d
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 73285082745045bcd64333c1fbaa88f8490f2626
refs/heads/master: 6672f76a5a1878d42264c1deba8f1ab52b4618d9
2 changes: 1 addition & 1 deletion trunk/arch/ia64/kernel/crash.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ crash_save_this_cpu(void)
buf = (u64 *) per_cpu_ptr(crash_notes, cpu);
if (!buf)
return;
buf = append_elf_note(buf, "CORE", NT_PRSTATUS, prstatus,
buf = append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS, prstatus,
sizeof(*prstatus));
final_note(buf);
}
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-arm/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#ifndef __ASSEMBLY__

#define MAX_NOTE_BYTES 1024

struct kimage;
/* Provide a dummy definition to avoid build failures. */
static inline void crash_setup_regs(struct pt_regs *newregs,
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-i386/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
/* We can also handle crash dumps from 64 bit kernel. */
#define vmcore_elf_check_arch_cross(x) ((x)->e_machine == EM_X86_64)

#define MAX_NOTE_BYTES 1024

/* CPU does not save ss and esp on stack if execution is already
* running in kernel mode at the time of NMI occurrence. This code
* fixes it.
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-ia64/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
/* The native architecture */
#define KEXEC_ARCH KEXEC_ARCH_IA_64

#define MAX_NOTE_BYTES 1024

#define kexec_flush_icache_page(page) do { \
unsigned long page_addr = (unsigned long)page_address(page); \
flush_icache_range(page_addr, page_addr + PAGE_SIZE); \
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-mips/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
/* The native architecture */
#define KEXEC_ARCH KEXEC_ARCH_MIPS

#define MAX_NOTE_BYTES 1024

static inline void crash_setup_regs(struct pt_regs *newregs,
struct pt_regs *oldregs)
{
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-powerpc/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
struct pt_regs *oldregs) { }
#endif /* !__powerpc64 __ */

#define MAX_NOTE_BYTES 1024

extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
master to copy new code to 0 */
extern int crashing_cpu;
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-s390/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
/* The native architecture */
#define KEXEC_ARCH KEXEC_ARCH_S390

#define MAX_NOTE_BYTES 1024

/* Provide a dummy definition to avoid build failures. */
static inline void crash_setup_regs(struct pt_regs *newregs,
struct pt_regs *oldregs) { }
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-sh/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
/* The native architecture */
#define KEXEC_ARCH KEXEC_ARCH_SH

#define MAX_NOTE_BYTES 1024

static inline void crash_setup_regs(struct pt_regs *newregs,
struct pt_regs *oldregs)
{
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-x86_64/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
/* The native architecture */
#define KEXEC_ARCH KEXEC_ARCH_X86_64

#define MAX_NOTE_BYTES 1024

/*
* Saving the registers of the cpu on which panic occured in
* crash_kexec to save a valid sp. The registers of other cpus
Expand Down
17 changes: 16 additions & 1 deletion trunk/include/linux/kexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <linux/linkage.h>
#include <linux/compat.h>
#include <linux/ioport.h>
#include <linux/elfcore.h>
#include <linux/elf.h>
#include <asm/kexec.h>

/* Verify architecture specific macros are defined */
Expand All @@ -31,6 +33,19 @@
#error KEXEC_ARCH not defined
#endif

#define KEXEC_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4)
#define KEXEC_CORE_NOTE_NAME "CORE"
#define KEXEC_CORE_NOTE_NAME_BYTES ALIGN(sizeof(KEXEC_CORE_NOTE_NAME), 4)
#define KEXEC_CORE_NOTE_DESC_BYTES ALIGN(sizeof(struct elf_prstatus), 4)
/*
* The per-cpu notes area is a list of notes terminated by a "NULL"
* note header. For kdump, the code in vmcore.c runs in the context
* of the second kernel to combine them into one note.
*/
#define KEXEC_NOTE_BYTES ( (KEXEC_NOTE_HEAD_BYTES * 2) + \
KEXEC_CORE_NOTE_NAME_BYTES + \
KEXEC_CORE_NOTE_DESC_BYTES )

/*
* This structure is used to hold the arguments that are used when loading
* kernel binaries.
Expand Down Expand Up @@ -136,7 +151,7 @@ extern struct kimage *kexec_crash_image;
/* Location of a reserved region to hold the crash kernel.
*/
extern struct resource crashk_res;
typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
typedef u32 note_buf_t[KEXEC_NOTE_BYTES/4];
extern note_buf_t *crash_notes;


Expand Down
4 changes: 2 additions & 2 deletions trunk/kernel/kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,8 +1118,8 @@ void crash_save_cpu(struct pt_regs *regs, int cpu)
memset(&prstatus, 0, sizeof(prstatus));
prstatus.pr_pid = current->pid;
elf_core_copy_regs(&prstatus.pr_reg, regs);
buf = append_elf_note(buf, "CORE", NT_PRSTATUS, &prstatus,
sizeof(prstatus));
buf = append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS,
&prstatus, sizeof(prstatus));
final_note(buf);
}

Expand Down

0 comments on commit 629c43d

Please sign in to comment.