[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v4 4/6] x86/HVM: also dump stacks from show_execution_state()
Wire up show_hvm_stack() also on this path. Move the show_guest_stack() invocation out of show_stack(), rendering dead the is-HVM check there. While separating guest and host paths, also move the show_code() invocation - the function bails immediately when guest_mode() returns "true". Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- v4: New. --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -303,10 +303,6 @@ static void show_guest_stack(struct vcpu unsigned long mask = STACK_SIZE; void *stack_page = NULL; - /* Avoid HVM as we don't know what the stack looks like. */ - if ( is_hvm_vcpu(v) ) - return; - if ( is_pv_32bit_vcpu(v) ) { compat_show_guest_stack(v, regs, debug_stack_lines); @@ -611,14 +607,11 @@ static void show_trace(const struct cpu_ printk("\n"); } -void show_stack(const struct cpu_user_regs *regs) +static void show_stack(const struct cpu_user_regs *regs) { unsigned long *stack = ESP_BEFORE_EXCEPTION(regs), *stack_bottom, addr; int i; - if ( guest_mode(regs) ) - return show_guest_stack(current, regs); - printk("Xen stack trace from "__OP"sp=%p:\n ", stack); stack_bottom = _p(get_stack_dump_bottom(regs->rsp)); @@ -687,8 +680,30 @@ void show_execution_state(const struct c unsigned long flags = console_lock_recursive_irqsave(); show_registers(regs); - show_code(regs); - show_stack(regs); + + if ( guest_mode(regs) ) + { + struct vcpu *curr = current; + + if ( is_hvm_vcpu(curr) ) + { + /* + * Stop interleaving prevention: The necessary P2M lookups + * involve locking, which has to occur with IRQs enabled. + */ + console_unlock_recursive_irqrestore(flags); + + show_hvm_stack(curr, regs); + return; + } + + show_guest_stack(curr, regs); + } + else + { + show_code(regs); + show_stack(regs); + } console_unlock_recursive_irqrestore(flags); } --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -493,7 +493,6 @@ static always_inline void rep_nop(void) #define cpu_relax() rep_nop() void show_code(const struct cpu_user_regs *regs); -void show_stack(const struct cpu_user_regs *regs); void show_stack_overflow(unsigned int cpu, const struct cpu_user_regs *regs); void show_registers(const struct cpu_user_regs *regs); void show_execution_state(const struct cpu_user_regs *regs);
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |