From 11cc0e0cf21d53544bfe19977af1520981769e34 Mon Sep 17 00:00:00 2001 From: Antonios Motakis Date: Fri, 17 Jun 2016 14:37:30 +0200 Subject: [PATCH 1/1] core: panic_stop: print current cell only if it has been set Currently during a panic, panic_stop will print the current cell on the CPU where the panic occurred. However, if the hypervisor panics sufficiently early during initialization, we may end up in a situation where the root cell has not been initialized. This can easily cause a trap loop, making the panic output less useful. Signed-off-by: Antonios Motakis Signed-off-by: Jan Kiszka --- hypervisor/control.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hypervisor/control.c b/hypervisor/control.c index 94ed6c6..39d293e 100644 --- a/hypervisor/control.c +++ b/hypervisor/control.c @@ -814,8 +814,10 @@ long hypercall(unsigned long code, unsigned long arg1, unsigned long arg2) */ void __attribute__((noreturn)) panic_stop(void) { + struct cell *cell = this_cell(); + panic_printk("Stopping CPU %d (Cell: \"%s\")\n", this_cpu_id(), - this_cell()->config->name); + cell && cell->config ? cell->config->name : ""); if (phys_processor_id() == panic_cpu) panic_in_progress = 0; -- 2.39.2