Julien Grall
2013-Sep-25 12:12 UTC
[PATCH] xen/arm: Don''t dump stack when the VCPU is offline
When a VCPU is not yet online, the registers contain garbagge. This will result to call randomly BUG() in show_guest_stack. Signed-off-by: Julien Grall <julien.grall@linaro.org> --- xen/arch/arm/traps.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index 02c7e28..36fd411 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -614,6 +614,12 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs) void *mapped; unsigned long *stack, addr; + if ( test_bit(_VPF_down, &v->pause_flags) ) + { + printk("No stack trace, VCPU offline\n"); + return; + } + switch ( regs->cpsr & PSR_MODE_MASK ) { case PSR_MODE_USR: -- 1.7.10.4
Ian Campbell
2013-Sep-26 16:40 UTC
Re: [PATCH] xen/arm: Don''t dump stack when the VCPU is offline
On Wed, 2013-09-25 at 13:12 +0100, Julien Grall wrote:> When a VCPU is not yet online, the registers contain garbagge. This will result > to call randomly BUG() in show_guest_stack. > > Signed-off-by: Julien Grall <julien.grall@linaro.org>Acked + applied, thanks.> --- > xen/arch/arm/traps.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c > index 02c7e28..36fd411 100644 > --- a/xen/arch/arm/traps.c > +++ b/xen/arch/arm/traps.c > @@ -614,6 +614,12 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs) > void *mapped; > unsigned long *stack, addr; > > + if ( test_bit(_VPF_down, &v->pause_flags) ) > + { > + printk("No stack trace, VCPU offline\n"); > + return; > + } > + > switch ( regs->cpsr & PSR_MODE_MASK ) > { > case PSR_MODE_USR: