diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/process_32.c | 56 | ||||
-rw-r--r-- | arch/x86/kernel/traps_32.c | 32 |
2 files changed, 44 insertions, 44 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 097aeafce5ff..ba4b64117084 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -295,34 +295,52 @@ static int __init idle_setup(char *str) | |||
295 | } | 295 | } |
296 | early_param("idle", idle_setup); | 296 | early_param("idle", idle_setup); |
297 | 297 | ||
298 | void show_regs(struct pt_regs * regs) | 298 | void __show_registers(struct pt_regs *regs, int all) |
299 | { | 299 | { |
300 | unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; | 300 | unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; |
301 | unsigned long d0, d1, d2, d3, d6, d7; | 301 | unsigned long d0, d1, d2, d3, d6, d7; |
302 | unsigned long esp; | ||
303 | unsigned short ss, gs; | ||
304 | |||
305 | if (user_mode_vm(regs)) { | ||
306 | esp = regs->esp; | ||
307 | ss = regs->xss & 0xffff; | ||
308 | savesegment(gs, gs); | ||
309 | } else { | ||
310 | esp = (unsigned long) (®s->esp); | ||
311 | savesegment(ss, ss); | ||
312 | savesegment(gs, gs); | ||
313 | } | ||
302 | 314 | ||
303 | printk("\n"); | 315 | printk("\n"); |
304 | printk("Pid: %d, comm: %20s\n", current->pid, current->comm); | 316 | printk("Pid: %d, comm: %.*s %s (%s %.*s)\n", |
305 | printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id()); | 317 | current->pid, TASK_COMM_LEN, current->comm, |
318 | print_tainted(), init_utsname()->release, | ||
319 | (int)strcspn(init_utsname()->version, " "), | ||
320 | init_utsname()->version); | ||
321 | |||
322 | printk("EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n", | ||
323 | 0xffff & regs->xcs, regs->eip, regs->eflags, | ||
324 | smp_processor_id()); | ||
306 | print_symbol("EIP is at %s\n", regs->eip); | 325 | print_symbol("EIP is at %s\n", regs->eip); |
307 | 326 | ||
308 | if (user_mode_vm(regs)) | ||
309 | printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp); | ||
310 | printk(" EFLAGS: %08lx %s (%s %.*s)\n", | ||
311 | regs->eflags, print_tainted(), init_utsname()->release, | ||
312 | (int)strcspn(init_utsname()->version, " "), | ||
313 | init_utsname()->version); | ||
314 | printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", | 327 | printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n", |
315 | regs->eax,regs->ebx,regs->ecx,regs->edx); | 328 | regs->eax, regs->ebx, regs->ecx, regs->edx); |
316 | printk("ESI: %08lx EDI: %08lx EBP: %08lx", | 329 | printk("ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n", |
317 | regs->esi, regs->edi, regs->ebp); | 330 | regs->esi, regs->edi, regs->ebp, esp); |
318 | printk(" DS: %04x ES: %04x FS: %04x\n", | 331 | printk(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n", |
319 | 0xffff & regs->xds,0xffff & regs->xes, 0xffff & regs->xfs); | 332 | regs->xds & 0xffff, regs->xes & 0xffff, |
333 | regs->xfs & 0xffff, gs, ss); | ||
334 | |||
335 | if (!all) | ||
336 | return; | ||
320 | 337 | ||
321 | cr0 = read_cr0(); | 338 | cr0 = read_cr0(); |
322 | cr2 = read_cr2(); | 339 | cr2 = read_cr2(); |
323 | cr3 = read_cr3(); | 340 | cr3 = read_cr3(); |
324 | cr4 = read_cr4_safe(); | 341 | cr4 = read_cr4_safe(); |
325 | printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", cr0, cr2, cr3, cr4); | 342 | printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", |
343 | cr0, cr2, cr3, cr4); | ||
326 | 344 | ||
327 | get_debugreg(d0, 0); | 345 | get_debugreg(d0, 0); |
328 | get_debugreg(d1, 1); | 346 | get_debugreg(d1, 1); |
@@ -330,10 +348,16 @@ void show_regs(struct pt_regs * regs) | |||
330 | get_debugreg(d3, 3); | 348 | get_debugreg(d3, 3); |
331 | printk("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n", | 349 | printk("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n", |
332 | d0, d1, d2, d3); | 350 | d0, d1, d2, d3); |
351 | |||
333 | get_debugreg(d6, 6); | 352 | get_debugreg(d6, 6); |
334 | get_debugreg(d7, 7); | 353 | get_debugreg(d7, 7); |
335 | printk("DR6: %08lx DR7: %08lx\n", d6, d7); | 354 | printk("DR6: %08lx DR7: %08lx\n", |
355 | d6, d7); | ||
356 | } | ||
336 | 357 | ||
358 | void show_regs(struct pt_regs *regs) | ||
359 | { | ||
360 | __show_registers(regs, 1); | ||
337 | show_trace(NULL, regs, ®s->esp); | 361 | show_trace(NULL, regs, ®s->esp); |
338 | } | 362 | } |
339 | 363 | ||
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index b132d3957dfc..746fad2c504f 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c | |||
@@ -288,33 +288,9 @@ EXPORT_SYMBOL(dump_stack); | |||
288 | void show_registers(struct pt_regs *regs) | 288 | void show_registers(struct pt_regs *regs) |
289 | { | 289 | { |
290 | int i; | 290 | int i; |
291 | int in_kernel = 1; | 291 | |
292 | unsigned long esp; | ||
293 | unsigned short ss, gs; | ||
294 | |||
295 | esp = (unsigned long) (®s->esp); | ||
296 | savesegment(ss, ss); | ||
297 | savesegment(gs, gs); | ||
298 | if (user_mode_vm(regs)) { | ||
299 | in_kernel = 0; | ||
300 | esp = regs->esp; | ||
301 | ss = regs->xss & 0xffff; | ||
302 | } | ||
303 | print_modules(); | 292 | print_modules(); |
304 | printk(KERN_EMERG "CPU: %d\n" | 293 | __show_registers(regs, 0); |
305 | KERN_EMERG "EIP: %04x:[<%08lx>] %s VLI\n" | ||
306 | KERN_EMERG "EFLAGS: %08lx (%s %.*s)\n", | ||
307 | smp_processor_id(), 0xffff & regs->xcs, regs->eip, | ||
308 | print_tainted(), regs->eflags, init_utsname()->release, | ||
309 | (int)strcspn(init_utsname()->version, " "), | ||
310 | init_utsname()->version); | ||
311 | print_symbol(KERN_EMERG "EIP is at %s\n", regs->eip); | ||
312 | printk(KERN_EMERG "eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n", | ||
313 | regs->eax, regs->ebx, regs->ecx, regs->edx); | ||
314 | printk(KERN_EMERG "esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n", | ||
315 | regs->esi, regs->edi, regs->ebp, esp); | ||
316 | printk(KERN_EMERG "ds: %04x es: %04x fs: %04x gs: %04x ss: %04x\n", | ||
317 | regs->xds & 0xffff, regs->xes & 0xffff, regs->xfs & 0xffff, gs, ss); | ||
318 | printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)", | 294 | printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)", |
319 | TASK_COMM_LEN, current->comm, current->pid, | 295 | TASK_COMM_LEN, current->comm, current->pid, |
320 | current_thread_info(), current, task_thread_info(current)); | 296 | current_thread_info(), current, task_thread_info(current)); |
@@ -322,14 +298,14 @@ void show_registers(struct pt_regs *regs) | |||
322 | * When in-kernel, we also print out the stack and code at the | 298 | * When in-kernel, we also print out the stack and code at the |
323 | * time of the fault.. | 299 | * time of the fault.. |
324 | */ | 300 | */ |
325 | if (in_kernel) { | 301 | if (!user_mode_vm(regs)) { |
326 | u8 *eip; | 302 | u8 *eip; |
327 | unsigned int code_prologue = code_bytes * 43 / 64; | 303 | unsigned int code_prologue = code_bytes * 43 / 64; |
328 | unsigned int code_len = code_bytes; | 304 | unsigned int code_len = code_bytes; |
329 | unsigned char c; | 305 | unsigned char c; |
330 | 306 | ||
331 | printk("\n" KERN_EMERG "Stack: "); | 307 | printk("\n" KERN_EMERG "Stack: "); |
332 | show_stack_log_lvl(NULL, regs, (unsigned long *)esp, KERN_EMERG); | 308 | show_stack_log_lvl(NULL, regs, ®s->esp, KERN_EMERG); |
333 | 309 | ||
334 | printk(KERN_EMERG "Code: "); | 310 | printk(KERN_EMERG "Code: "); |
335 | 311 | ||