From: Antonios Motakis Date: Fri, 17 Jun 2016 12:37:30 +0000 (+0200) Subject: core: panic_stop: print current cell only if it has been set X-Git-Url: http://rtime.felk.cvut.cz/gitweb/jailhouse.git/commitdiff_plain/11cc0e0cf21d53544bfe19977af1520981769e34?hp=49a683f3a3823a445d88a2021dc69993d6edff8b 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 --- 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;