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

[Xen-changelog] [xen stable-4.10] xen/shim: crash instead of reboot in shim mode



commit c9083de0ae6b0f5b42e7f92f6d43edc3bd09d4f1
Author:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Thu Jan 11 11:41:21 2018 +0000
Commit:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
CommitDate: Fri Jan 12 15:47:32 2018 +0000

    xen/shim: crash instead of reboot in shim mode
    
    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>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    [ wei: fix arm build ]
    Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    ---
    Changes since v1:
     - Use the ternary operator.
---
 xen/arch/x86/shutdown.c    | 7 ++++++-
 xen/drivers/char/console.c | 4 ++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index 689f6f137d..a350714319 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -642,7 +642,12 @@ void machine_restart(unsigned int delay_millisecs)
             break;
 
         case BOOT_XEN:
-            xen_hypercall_shutdown(SHUTDOWN_reboot);
+            /*
+             * 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(pv_shim ? SHUTDOWN_crash : SHUTDOWN_reboot);
             break;
         }
     }
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 18f5b7f7aa..121073c8ed 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1253,7 +1253,11 @@ void panic(const char *fmt, ...)
     if ( opt_noreboot )
         printk("Manual reset required ('noreboot' specified)\n");
     else
+#ifdef CONFIG_X86
+        printk("%s in five seconds...\n", pv_shim ? "Crash" : "Reboot");
+#else
         printk("Reboot in five seconds...\n");
+#endif
 
     spin_unlock_irqrestore(&lock, flags);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.10

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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