diff options
author | Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> | 2008-01-30 07:33:16 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:16 -0500 |
commit | 064954761254ef17fae2b84fb5a034d48a769143 (patch) | |
tree | 1b281d42a1a48e0373dbcbdc82ff9b7985ce3804 /include/asm-x86 | |
parent | 770181d99098bc141031fe0a4b1d6221258c1182 (diff) |
x86: kdump failure
kdump needs ELF_CORE_COPY_REGS in crash_save_cpu().
This lack of the macro causes the following BUG.
SysRq : Trigger a crashdump
------------[ cut here ]------------
kernel BUG at include/linux/elfcore.h:105!
invalid opcode: 0000 [1] PREEMPT SMP
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/elf.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/asm-x86/elf.h b/include/asm-x86/elf.h index dab4744f9586..d9c94e707289 100644 --- a/include/asm-x86/elf.h +++ b/include/asm-x86/elf.h | |||
@@ -106,6 +106,31 @@ extern unsigned int vdso_enabled; | |||
106 | _r->ax = 0; \ | 106 | _r->ax = 0; \ |
107 | } while (0) | 107 | } while (0) |
108 | 108 | ||
109 | /* | ||
110 | * regs is struct pt_regs, pr_reg is elf_gregset_t (which is | ||
111 | * now struct_user_regs, they are different) | ||
112 | */ | ||
113 | |||
114 | #define ELF_CORE_COPY_REGS(pr_reg, regs) do { \ | ||
115 | pr_reg[0] = regs->bx; \ | ||
116 | pr_reg[1] = regs->cx; \ | ||
117 | pr_reg[2] = regs->dx; \ | ||
118 | pr_reg[3] = regs->si; \ | ||
119 | pr_reg[4] = regs->di; \ | ||
120 | pr_reg[5] = regs->bp; \ | ||
121 | pr_reg[6] = regs->ax; \ | ||
122 | pr_reg[7] = regs->ds & 0xffff; \ | ||
123 | pr_reg[8] = regs->es & 0xffff; \ | ||
124 | pr_reg[9] = regs->fs & 0xffff; \ | ||
125 | savesegment(gs, pr_reg[10]); \ | ||
126 | pr_reg[11] = regs->orig_ax; \ | ||
127 | pr_reg[12] = regs->ip; \ | ||
128 | pr_reg[13] = regs->cs & 0xffff; \ | ||
129 | pr_reg[14] = regs->flags; \ | ||
130 | pr_reg[15] = regs->sp; \ | ||
131 | pr_reg[16] = regs->ss & 0xffff; \ | ||
132 | } while (0); | ||
133 | |||
109 | #define ELF_PLATFORM (utsname()->machine) | 134 | #define ELF_PLATFORM (utsname()->machine) |
110 | #define set_personality_64bit() do { } while (0) | 135 | #define set_personality_64bit() do { } while (0) |
111 | 136 | ||
@@ -165,6 +190,43 @@ static inline void elf_common_init(struct thread_struct *t, | |||
165 | } while (0) | 190 | } while (0) |
166 | #define COMPAT_ELF_PLATFORM ("i686") | 191 | #define COMPAT_ELF_PLATFORM ("i686") |
167 | 192 | ||
193 | /* | ||
194 | * regs is struct pt_regs, pr_reg is elf_gregset_t (which is | ||
195 | * now struct_user_regs, they are different). Assumes current is the process | ||
196 | * getting dumped. | ||
197 | */ | ||
198 | |||
199 | #define ELF_CORE_COPY_REGS(pr_reg, regs) do { \ | ||
200 | unsigned v; \ | ||
201 | (pr_reg)[0] = (regs)->r15; \ | ||
202 | (pr_reg)[1] = (regs)->r14; \ | ||
203 | (pr_reg)[2] = (regs)->r13; \ | ||
204 | (pr_reg)[3] = (regs)->r12; \ | ||
205 | (pr_reg)[4] = (regs)->bp; \ | ||
206 | (pr_reg)[5] = (regs)->bx; \ | ||
207 | (pr_reg)[6] = (regs)->r11; \ | ||
208 | (pr_reg)[7] = (regs)->r10; \ | ||
209 | (pr_reg)[8] = (regs)->r9; \ | ||
210 | (pr_reg)[9] = (regs)->r8; \ | ||
211 | (pr_reg)[10] = (regs)->ax; \ | ||
212 | (pr_reg)[11] = (regs)->cx; \ | ||
213 | (pr_reg)[12] = (regs)->dx; \ | ||
214 | (pr_reg)[13] = (regs)->si; \ | ||
215 | (pr_reg)[14] = (regs)->di; \ | ||
216 | (pr_reg)[15] = (regs)->orig_ax; \ | ||
217 | (pr_reg)[16] = (regs)->ip; \ | ||
218 | (pr_reg)[17] = (regs)->cs; \ | ||
219 | (pr_reg)[18] = (regs)->flags; \ | ||
220 | (pr_reg)[19] = (regs)->sp; \ | ||
221 | (pr_reg)[20] = (regs)->ss; \ | ||
222 | (pr_reg)[21] = current->thread.fs; \ | ||
223 | (pr_reg)[22] = current->thread.gs; \ | ||
224 | asm("movl %%ds,%0" : "=r" (v)); (pr_reg)[23] = v; \ | ||
225 | asm("movl %%es,%0" : "=r" (v)); (pr_reg)[24] = v; \ | ||
226 | asm("movl %%fs,%0" : "=r" (v)); (pr_reg)[25] = v; \ | ||
227 | asm("movl %%gs,%0" : "=r" (v)); (pr_reg)[26] = v; \ | ||
228 | } while (0); | ||
229 | |||
168 | /* I'm not sure if we can use '-' here */ | 230 | /* I'm not sure if we can use '-' here */ |
169 | #define ELF_PLATFORM ("x86_64") | 231 | #define ELF_PLATFORM ("x86_64") |
170 | extern void set_personality_64bit(void); | 232 | extern void set_personality_64bit(void); |