[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH RFC v1 65/74] xen/shim: crash instead of reboot in shim mode



From: Roger Pau Monne <roger.pau@xxxxxxxxxx>

All guest shutdown operations are forwarded to L0, so the only native
calls to machine_restart happen from crash related paths inside the
hypervisor, hence switch the reboot code to instead issue a crash
shutdown.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/shutdown.c    | 7 +++++++
 xen/drivers/char/console.c | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index 689f6f137d..d2d14ae5f8 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -642,6 +642,13 @@ void machine_restart(unsigned int delay_millisecs)
             break;
 
         case BOOT_XEN:
+            if ( pv_shim )
+                /*
+                 * When running in PV shim mode guest shutdown calls are
+                 * forwarded to L0, hence the only way to get here is if a
+                 * shim crash happens.
+                 */
+                xen_hypercall_shutdown(SHUTDOWN_crash);
             xen_hypercall_shutdown(SHUTDOWN_reboot);
             break;
         }
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 3c615a255c..5c37dfc3f6 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1230,7 +1230,7 @@ void panic(const char *fmt, ...)
     if ( opt_noreboot )
         printk("Manual reset required ('noreboot' specified)\n");
     else
-        printk("Reboot in five seconds...\n");
+        printk("%s in five seconds...\n", pv_shim ? "Crash" : "Reboot");
 
     spin_unlock_irqrestore(&lock, flags);
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.