]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: panic_stop: print current cell only if it has been set
authorAntonios Motakis <antonios.motakis@huawei.com>
Fri, 17 Jun 2016 12:37:30 +0000 (14:37 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Sun, 26 Jun 2016 07:16:27 +0000 (09:16 +0200)
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 <antonios.motakis@huawei.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/control.c

index 94ed6c6fe9618cfafe30fdd0c43aea3da4c0c286..39d293e7fadd04f648437008a0f0716f20caaf79 100644 (file)
@@ -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 : "<UNSET>");
 
        if (phys_processor_id() == panic_cpu)
                panic_in_progress = 0;