# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 765b7e23d979cce7e27059b71f48be0aaedb6395
# Parent 37a42856e8d99345d62171bb650d21cbe5104b39
[XEN] Improve Xen information in register dumps.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
xen/arch/x86/x86_32/traps.c | 29 +++++++++++++++++++++--------
xen/arch/x86/x86_64/traps.c | 25 +++++++++++++++++--------
2 files changed, 38 insertions(+), 16 deletions(-)
diff -r 37a42856e8d9 -r 765b7e23d979 xen/arch/x86/x86_32/traps.c
--- a/xen/arch/x86/x86_32/traps.c Fri Sep 01 01:07:45 2006 +0100
+++ b/xen/arch/x86/x86_32/traps.c Fri Sep 01 01:25:15 2006 +0100
@@ -21,11 +21,28 @@
/* All CPUs have their own IDT to allow int80 direct trap. */
idt_entry_t *idt_tables[NR_CPUS] __read_mostly;
+static void print_xen_info(void)
+{
+ char taint_str[TAINT_STRING_MAX_LEN];
+ char debug = 'n', *arch = "x86_32";
+
+#ifndef NDEBUG
+ debug = 'y';
+#endif
+
+#ifdef CONFIG_X86_PAE
+ arch = "x86_32p";
+#endif
+
+ printk("----[ Xen-%d.%d%s %s debug=%c %s ]----\n",
+ xen_major_version(), xen_minor_version(), xen_extra_version(),
+ arch, debug, print_tainted(taint_str));
+}
+
void show_registers(struct cpu_user_regs *regs)
{
struct cpu_user_regs fault_regs = *regs;
unsigned long fault_crs[8];
- char taint_str[TAINT_STRING_MAX_LEN];
const char *context;
if ( hvm_guest(current) && guest_mode(regs) )
@@ -57,9 +74,7 @@ void show_registers(struct cpu_user_regs
fault_crs[4] = read_cr4();
}
- printk("----[ Xen-%d.%d%s %s ]----\n",
- xen_major_version(), xen_minor_version(), xen_extra_version(),
- print_tainted(taint_str));
+ print_xen_info();
printk("CPU: %d\nEIP: %04x:[<%08x>]",
smp_processor_id(), fault_regs.cs, fault_regs.eip);
if ( !guest_mode(regs) )
@@ -132,7 +147,6 @@ asmlinkage void do_double_fault(void)
{
struct tss_struct *tss = &doublefault_tss;
unsigned int cpu = ((tss->back_link>>3)-__FIRST_TSS_ENTRY)>>1;
- char taint_str[TAINT_STRING_MAX_LEN];
watchdog_disable();
@@ -140,9 +154,8 @@ asmlinkage void do_double_fault(void)
/* Find information saved during fault and dump it to the console. */
tss = &init_tss[cpu];
- printk("*** DOUBLE FAULT: Xen-%d.%d%s %s\n",
- xen_major_version(), xen_minor_version(), xen_extra_version(),
- print_tainted(taint_str));
+ printk("*** DOUBLE FAULT ***\n");
+ print_xen_info();
printk("CPU: %d\nEIP: %04x:[<%08x>]",
cpu, tss->cs, tss->eip);
print_symbol(" %s\n", tss->eip);
diff -r 37a42856e8d9 -r 765b7e23d979 xen/arch/x86/x86_64/traps.c
--- a/xen/arch/x86/x86_64/traps.c Fri Sep 01 01:07:45 2006 +0100
+++ b/xen/arch/x86/x86_64/traps.c Fri Sep 01 01:25:15 2006 +0100
@@ -21,11 +21,24 @@
#include <public/callback.h>
+static void print_xen_info(void)
+{
+ char taint_str[TAINT_STRING_MAX_LEN];
+ char debug = 'n';
+
+#ifndef NDEBUG
+ debug = 'y';
+#endif
+
+ printk("----[ Xen-%d.%d%s x86_64 debug=%c %s ]----\n",
+ xen_major_version(), xen_minor_version(), xen_extra_version(),
+ debug, print_tainted(taint_str));
+}
+
void show_registers(struct cpu_user_regs *regs)
{
struct cpu_user_regs fault_regs = *regs;
unsigned long fault_crs[8];
- char taint_str[TAINT_STRING_MAX_LEN];
const char *context;
if ( hvm_guest(current) && guest_mode(regs) )
@@ -55,9 +68,7 @@ void show_registers(struct cpu_user_regs
fault_regs.gs = read_segment_register(gs);
}
- printk("----[ Xen-%d.%d%s %s ]----\n",
- xen_major_version(), xen_minor_version(), xen_extra_version(),
- print_tainted(taint_str));
+ print_xen_info();
printk("CPU: %d\nRIP: %04x:[<%016lx>]",
smp_processor_id(), fault_regs.cs, fault_regs.rip);
if ( !guest_mode(regs) )
@@ -133,7 +144,6 @@ asmlinkage void do_double_fault(struct c
asmlinkage void do_double_fault(struct cpu_user_regs *regs)
{
unsigned int cpu, tr;
- char taint_str[TAINT_STRING_MAX_LEN];
asm ( "str %0" : "=r" (tr) );
cpu = ((tr >> 3) - __FIRST_TSS_ENTRY) >> 2;
@@ -143,9 +153,8 @@ asmlinkage void do_double_fault(struct c
console_force_unlock();
/* Find information saved during fault and dump it to the console. */
- printk("*** DOUBLE FAULT: Xen-%d.%d%s %s\n",
- xen_major_version(), xen_minor_version(), xen_extra_version(),
- print_tainted(taint_str));
+ printk("*** DOUBLE FAULT ***\n");
+ print_xen_info();
printk("CPU: %d\nRIP: %04x:[<%016lx>]",
cpu, regs->cs, regs->rip);
print_symbol(" %s", regs->rip);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|