direct-io.hg
changeset 11406:765b7e23d979
[XEN] Improve Xen information in register dumps.
Signed-off-by: Keir Fraser <keir@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Fri Sep 01 01:25:15 2006 +0100 (2006-09-01) |
parents | 37a42856e8d9 |
children | 6a974a3f32a4 |
files | xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/traps.c |
line diff
1.1 --- a/xen/arch/x86/x86_32/traps.c Fri Sep 01 01:07:45 2006 +0100 1.2 +++ b/xen/arch/x86/x86_32/traps.c Fri Sep 01 01:25:15 2006 +0100 1.3 @@ -21,11 +21,28 @@ 1.4 /* All CPUs have their own IDT to allow int80 direct trap. */ 1.5 idt_entry_t *idt_tables[NR_CPUS] __read_mostly; 1.6 1.7 +static void print_xen_info(void) 1.8 +{ 1.9 + char taint_str[TAINT_STRING_MAX_LEN]; 1.10 + char debug = 'n', *arch = "x86_32"; 1.11 + 1.12 +#ifndef NDEBUG 1.13 + debug = 'y'; 1.14 +#endif 1.15 + 1.16 +#ifdef CONFIG_X86_PAE 1.17 + arch = "x86_32p"; 1.18 +#endif 1.19 + 1.20 + printk("----[ Xen-%d.%d%s %s debug=%c %s ]----\n", 1.21 + xen_major_version(), xen_minor_version(), xen_extra_version(), 1.22 + arch, debug, print_tainted(taint_str)); 1.23 +} 1.24 + 1.25 void show_registers(struct cpu_user_regs *regs) 1.26 { 1.27 struct cpu_user_regs fault_regs = *regs; 1.28 unsigned long fault_crs[8]; 1.29 - char taint_str[TAINT_STRING_MAX_LEN]; 1.30 const char *context; 1.31 1.32 if ( hvm_guest(current) && guest_mode(regs) ) 1.33 @@ -57,9 +74,7 @@ void show_registers(struct cpu_user_regs 1.34 fault_crs[4] = read_cr4(); 1.35 } 1.36 1.37 - printk("----[ Xen-%d.%d%s %s ]----\n", 1.38 - xen_major_version(), xen_minor_version(), xen_extra_version(), 1.39 - print_tainted(taint_str)); 1.40 + print_xen_info(); 1.41 printk("CPU: %d\nEIP: %04x:[<%08x>]", 1.42 smp_processor_id(), fault_regs.cs, fault_regs.eip); 1.43 if ( !guest_mode(regs) ) 1.44 @@ -132,7 +147,6 @@ asmlinkage void do_double_fault(void) 1.45 { 1.46 struct tss_struct *tss = &doublefault_tss; 1.47 unsigned int cpu = ((tss->back_link>>3)-__FIRST_TSS_ENTRY)>>1; 1.48 - char taint_str[TAINT_STRING_MAX_LEN]; 1.49 1.50 watchdog_disable(); 1.51 1.52 @@ -140,9 +154,8 @@ asmlinkage void do_double_fault(void) 1.53 1.54 /* Find information saved during fault and dump it to the console. */ 1.55 tss = &init_tss[cpu]; 1.56 - printk("*** DOUBLE FAULT: Xen-%d.%d%s %s\n", 1.57 - xen_major_version(), xen_minor_version(), xen_extra_version(), 1.58 - print_tainted(taint_str)); 1.59 + printk("*** DOUBLE FAULT ***\n"); 1.60 + print_xen_info(); 1.61 printk("CPU: %d\nEIP: %04x:[<%08x>]", 1.62 cpu, tss->cs, tss->eip); 1.63 print_symbol(" %s\n", tss->eip);
2.1 --- a/xen/arch/x86/x86_64/traps.c Fri Sep 01 01:07:45 2006 +0100 2.2 +++ b/xen/arch/x86/x86_64/traps.c Fri Sep 01 01:25:15 2006 +0100 2.3 @@ -21,11 +21,24 @@ 2.4 2.5 #include <public/callback.h> 2.6 2.7 +static void print_xen_info(void) 2.8 +{ 2.9 + char taint_str[TAINT_STRING_MAX_LEN]; 2.10 + char debug = 'n'; 2.11 + 2.12 +#ifndef NDEBUG 2.13 + debug = 'y'; 2.14 +#endif 2.15 + 2.16 + printk("----[ Xen-%d.%d%s x86_64 debug=%c %s ]----\n", 2.17 + xen_major_version(), xen_minor_version(), xen_extra_version(), 2.18 + debug, print_tainted(taint_str)); 2.19 +} 2.20 + 2.21 void show_registers(struct cpu_user_regs *regs) 2.22 { 2.23 struct cpu_user_regs fault_regs = *regs; 2.24 unsigned long fault_crs[8]; 2.25 - char taint_str[TAINT_STRING_MAX_LEN]; 2.26 const char *context; 2.27 2.28 if ( hvm_guest(current) && guest_mode(regs) ) 2.29 @@ -55,9 +68,7 @@ void show_registers(struct cpu_user_regs 2.30 fault_regs.gs = read_segment_register(gs); 2.31 } 2.32 2.33 - printk("----[ Xen-%d.%d%s %s ]----\n", 2.34 - xen_major_version(), xen_minor_version(), xen_extra_version(), 2.35 - print_tainted(taint_str)); 2.36 + print_xen_info(); 2.37 printk("CPU: %d\nRIP: %04x:[<%016lx>]", 2.38 smp_processor_id(), fault_regs.cs, fault_regs.rip); 2.39 if ( !guest_mode(regs) ) 2.40 @@ -133,7 +144,6 @@ asmlinkage void double_fault(void); 2.41 asmlinkage void do_double_fault(struct cpu_user_regs *regs) 2.42 { 2.43 unsigned int cpu, tr; 2.44 - char taint_str[TAINT_STRING_MAX_LEN]; 2.45 2.46 asm ( "str %0" : "=r" (tr) ); 2.47 cpu = ((tr >> 3) - __FIRST_TSS_ENTRY) >> 2; 2.48 @@ -143,9 +153,8 @@ asmlinkage void do_double_fault(struct c 2.49 console_force_unlock(); 2.50 2.51 /* Find information saved during fault and dump it to the console. */ 2.52 - printk("*** DOUBLE FAULT: Xen-%d.%d%s %s\n", 2.53 - xen_major_version(), xen_minor_version(), xen_extra_version(), 2.54 - print_tainted(taint_str)); 2.55 + printk("*** DOUBLE FAULT ***\n"); 2.56 + print_xen_info(); 2.57 printk("CPU: %d\nRIP: %04x:[<%016lx>]", 2.58 cpu, regs->cs, regs->rip); 2.59 print_symbol(" %s", regs->rip);