Skip to contentSkip to conversation

xen/arm: Panic when we receive an unexpected trap

PATCH In review Julien Grall 2 participants 4 messages Jun 17, 2014 – Jun 18, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: Panic when we receive an unexpected trap

The current implementation of do_unexpected_trap make Xen spin forever on the current physical CPU. This may lead to stall guests VCPU and print unhelpful message (RCU stall...).

Usually when Xen receives an unexpected trap, it means that something goes wrong either in the hypervisor or in the CPU. In this case we should directly panic to also stop the other CPUs.

---
 xen/arch/arm/traps.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/traps.c +1 -1
index ac3fc70..0abb6ff 100644
@@ -999,7 +999,7 @@ void do_unexpected_trap(const char *msg, struct cpu_user_regs *regs)
 {
     printk("CPU%d: Unexpected Trap: %s\n", smp_processor_id(), msg);
     show_execution_state(regs);
-    while(1);
+    panic("CPU%d: Unexpected Trap: %s\n", smp_processor_id(), msg);
 }
 
 typedef register_t (*arm_hypercall_fn_t)(
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 9 lines · Julien Grall

The current implementation of do_unexpected_trap make Xen spin forever on the current physical CPU. This may lead to stall guests VCPU and print unhelpful message (RCU stall...).

Usually when Xen receives an unexpected trap, it means that something goes wrong either in the hypervisor or in the CPU. In this case we should directly panic to also stop the other CPUs.

Ack + applied.

Quoted 17 lines
---
 xen/arch/arm/traps.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/arm/traps.c +1 -1
index ac3fc70..0abb6ff 100644
@@ -999,7 +999,7 @@ void do_unexpected_trap(const char *msg, struct cpu_user_regs *regs)
 {
     printk("CPU%d: Unexpected Trap: %s\n", smp_processor_id(), msg);
     show_execution_state(regs);
-    while(1);
+    panic("CPU%d: Unexpected Trap: %s\n", smp_processor_id(), msg);
 }
 
 typedef register_t (*arm_hypercall_fn_t)(
#2 lore raw
Quoted 5 lines · Ian Campbell
Quoted 4 lines · Julien Grall

The current implementation of do_unexpected_trap make Xen spin forever on the current physical CPU. This may lead to stall guests VCPU and print unhelpful message (RCU stall...).

Quoted 7 lines
Quoted 5 lines

Usually when Xen receives an unexpected trap, it means that something goes wrong either in the hypervisor or in the CPU. In this case we should directly panic to also stop the other CPUs.

Ack + applied.

Thanks, I think this patch is a good candidate for backporting on Xen 4.4

It will avoid Xen to try to continue running when an unexpected trap occurs.

Regards,

Signature · 1 line
Julien Grall
#3 lore raw
Quoted 10 lines · Julien Grall
Quoted 9 lines · Ian Campbell
Quoted 8 lines · Julien Grall

The current implementation of do_unexpected_trap make Xen spin forever on the current physical CPU. This may lead to stall guests VCPU and print unhelpful message (RCU stall...).

Usually when Xen receives an unexpected trap, it means that something goes wrong either in the hypervisor or in the CPU. In this case we should directly panic to also stop the other CPUs.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Ack + applied.

Thanks, I think this patch is a good candidate for backporting on Xen 4.4

Noted.

Quoted 5 lines

It will avoid Xen to try to continue running when an unexpected trap occurs.

Regards,