[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86: also show event upcall mask when dumping guest state
# HG changeset patch # User Keir Fraser <keir.fraser@xxxxxxxxxx> # Date 1218204001 -3600 # Node ID a189e68441fe8f63838e303899afbbb829b1143f # Parent c386106f9638e58fd0120d7e95205b56564416ab x86: also show event upcall mask when dumping guest state Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx> Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx> --- xen/arch/x86/x86_32/traps.c | 36 ++++++++++++++++++++++++------------ xen/arch/x86/x86_64/traps.c | 36 ++++++++++++++++++++++++------------ 2 files changed, 48 insertions(+), 24 deletions(-) diff -r c386106f9638 -r a189e68441fe xen/arch/x86/x86_32/traps.c --- a/xen/arch/x86/x86_32/traps.c Fri Aug 08 12:08:09 2008 +0100 +++ b/xen/arch/x86/x86_32/traps.c Fri Aug 08 15:00:01 2008 +0100 @@ -32,14 +32,26 @@ static void print_xen_info(void) arch, debug, print_tainted(taint_str)); } -static void _show_registers(const struct cpu_user_regs *regs, - unsigned long crs[8], int guest_mode, - const char *context) -{ +enum context { CTXT_hypervisor, CTXT_pv_guest, CTXT_hvm_guest }; + +static void _show_registers( + const struct cpu_user_regs *regs, unsigned long crs[8], + enum context context, const struct vcpu *v) +{ + const static char *context_names[] = { + [CTXT_hypervisor] = "hypervisor", + [CTXT_pv_guest] = "pv guest", + [CTXT_hvm_guest] = "hvm guest" + }; + printk("EIP: %04x:[<%08x>]", regs->cs, regs->eip); - if ( !guest_mode ) + if ( context == CTXT_hypervisor ) print_symbol(" %s", regs->eip); - printk("\nEFLAGS: %08x CONTEXT: %s\n", regs->eflags, context); + printk("\nEFLAGS: %08x ", regs->eflags); + if ( (context == CTXT_pv_guest) && v && v->vcpu_info ) + printk("EM: %d ", !!v->vcpu_info->evtchn_upcall_mask); + printk("CONTEXT: %s\n", context_names[context]); + printk("eax: %08x ebx: %08x ecx: %08x edx: %08x\n", regs->eax, regs->ebx, regs->ecx, regs->edx); printk("esi: %08x edi: %08x ebp: %08x esp: %08x\n", @@ -56,13 +68,13 @@ void show_registers(struct cpu_user_regs { struct cpu_user_regs fault_regs = *regs; unsigned long fault_crs[8]; - const char *context; + enum context context; struct vcpu *v = current; if ( is_hvm_vcpu(v) && guest_mode(regs) ) { struct segment_register sreg; - context = "hvm"; + context = CTXT_hvm_guest; fault_crs[0] = v->arch.hvm_vcpu.guest_cr[0]; fault_crs[2] = v->arch.hvm_vcpu.guest_cr[2]; fault_crs[3] = v->arch.hvm_vcpu.guest_cr[3]; @@ -84,7 +96,7 @@ void show_registers(struct cpu_user_regs { if ( !guest_mode(regs) ) { - context = "hypervisor"; + context = CTXT_hypervisor; fault_regs.esp = (unsigned long)®s->esp; fault_regs.ss = read_segment_register(ss); fault_regs.ds = read_segment_register(ds); @@ -95,7 +107,7 @@ void show_registers(struct cpu_user_regs } else { - context = "guest"; + context = CTXT_pv_guest; fault_crs[2] = v->vcpu_info->arch.cr2; } @@ -106,7 +118,7 @@ void show_registers(struct cpu_user_regs print_xen_info(); printk("CPU: %d\n", smp_processor_id()); - _show_registers(&fault_regs, fault_crs, guest_mode(regs), context); + _show_registers(&fault_regs, fault_crs, context, v); if ( this_cpu(ler_msr) && !guest_mode(regs) ) { @@ -130,7 +142,7 @@ void vcpu_show_registers(const struct vc crs[3] = pagetable_get_paddr(v->arch.guest_table); crs[4] = v->arch.guest_context.ctrlreg[4]; - _show_registers(&v->arch.guest_context.user_regs, crs, 1, "guest"); + _show_registers(&v->arch.guest_context.user_regs, crs, CTXT_pv_guest, v); } void show_page_walk(unsigned long addr) diff -r c386106f9638 -r a189e68441fe xen/arch/x86/x86_64/traps.c --- a/xen/arch/x86/x86_64/traps.c Fri Aug 08 12:08:09 2008 +0100 +++ b/xen/arch/x86/x86_64/traps.c Fri Aug 08 15:00:01 2008 +0100 @@ -40,14 +40,26 @@ static void print_xen_info(void) debug, print_tainted(taint_str)); } -static void _show_registers(const struct cpu_user_regs *regs, - unsigned long crs[8], int guest_mode, - const char *context) -{ +enum context { CTXT_hypervisor, CTXT_pv_guest, CTXT_hvm_guest }; + +static void _show_registers( + const struct cpu_user_regs *regs, unsigned long crs[8], + enum context context, const struct vcpu *v) +{ + const static char *context_names[] = { + [CTXT_hypervisor] = "hypervisor", + [CTXT_pv_guest] = "pv guest", + [CTXT_hvm_guest] = "hvm guest" + }; + printk("RIP: %04x:[<%016lx>]", regs->cs, regs->rip); - if ( !guest_mode ) + if ( context == CTXT_hypervisor ) print_symbol(" %s", regs->rip); - printk("\nRFLAGS: %016lx CONTEXT: %s\n", regs->rflags, context); + printk("\nRFLAGS: %016lx ", regs->rflags); + if ( (context == CTXT_pv_guest) && v && v->vcpu_info ) + printk("EM: %d ", !!vcpu_info(v, evtchn_upcall_mask)); + printk("CONTEXT: %s\n", context_names[context]); + printk("rax: %016lx rbx: %016lx rcx: %016lx\n", regs->rax, regs->rbx, regs->rcx); printk("rdx: %016lx rsi: %016lx rdi: %016lx\n", @@ -71,13 +83,13 @@ void show_registers(struct cpu_user_regs { struct cpu_user_regs fault_regs = *regs; unsigned long fault_crs[8]; - const char *context; + enum context context; struct vcpu *v = current; if ( is_hvm_vcpu(v) && guest_mode(regs) ) { struct segment_register sreg; - context = "hvm"; + context = CTXT_hvm_guest; fault_crs[0] = v->arch.hvm_vcpu.guest_cr[0]; fault_crs[2] = v->arch.hvm_vcpu.guest_cr[2]; fault_crs[3] = v->arch.hvm_vcpu.guest_cr[3]; @@ -99,12 +111,12 @@ void show_registers(struct cpu_user_regs { if ( guest_mode(regs) ) { - context = "guest"; + context = CTXT_pv_guest; fault_crs[2] = arch_get_cr2(v); } else { - context = "hypervisor"; + context = CTXT_hypervisor; fault_crs[2] = read_cr2(); } @@ -119,7 +131,7 @@ void show_registers(struct cpu_user_regs print_xen_info(); printk("CPU: %d\n", smp_processor_id()); - _show_registers(&fault_regs, fault_crs, guest_mode(regs), context); + _show_registers(&fault_regs, fault_crs, context, v); if ( this_cpu(ler_msr) && !guest_mode(regs) ) { @@ -146,7 +158,7 @@ void vcpu_show_registers(const struct vc v->arch.guest_table_user); crs[4] = v->arch.guest_context.ctrlreg[4]; - _show_registers(regs, crs, 1, "guest"); + _show_registers(regs, crs, CTXT_pv_guest, v); } void show_page_walk(unsigned long addr) _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |