diff mbox

xen/arm: Don't dump stack when the VCPU is offline

Message ID 1380111167-17875-1-git-send-email-julien.grall@linaro.org
State Accepted, archived
Headers show

Commit Message

Julien Grall Sept. 25, 2013, 12:12 p.m. UTC
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(+)

Comments

Ian Campbell Sept. 26, 2013, 4:40 p.m. UTC | #1
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:
diff mbox

Patch

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: