]> xenbits.xensource.com Git - xen.git/commitdiff
bitkeeper revision 1.1159.258.52 (4233991dQspKbtD0n-C6ReG4f2lHAQ)
authoriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>
Sun, 13 Mar 2005 01:36:29 +0000 (01:36 +0000)
committeriap10@freefall.cl.cam.ac.uk <iap10@freefall.cl.cam.ac.uk>
Sun, 13 Mar 2005 01:36:29 +0000 (01:36 +0000)
Add hypercall to allow domains to request that they be crashed.
Signed-off-by: ian@xensource.com
linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h
xen/common/domain.c
xen/include/public/io/domain_controller.h

index 2d5a88a56d4defe8641b29c07b751efe70ac7f8e..cccfae35aebd490ad77235098e2880385b8466df 100644 (file)
@@ -289,6 +289,22 @@ HYPERVISOR_suspend(
     return ret;
 }
 
+static inline int
+HYPERVISOR_crash(
+    void)
+{
+    int ret;
+    unsigned long ign1;
+    __asm__ __volatile__ (
+        TRAP_INSTR
+        : "=a" (ret), "=b" (ign1)
+       : "0" (__HYPERVISOR_sched_op),
+         "1" (SCHEDOP_shutdown | (SHUTDOWN_crash << SCHEDOP_reasonshift))
+        : "memory" );
+
+    return ret;
+}
+
 static inline long
 HYPERVISOR_set_timer_op(
     u64 timeout)
index 47673b21ec92aa0983b8bcfb8e279efcbd3e7d66..f04e8bdfc77f565b10382a11cf4242c9ccce8514 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/shadow.h>
 #include <public/dom0_ops.h>
 #include <asm/domain_page.h>
+#include <public/io/domain_controller.h>
 
 /* Both these structures are protected by the domlist_lock. */
 rwlock_t domlist_lock = RW_LOCK_UNLOCKED;
@@ -168,6 +169,9 @@ void domain_shutdown(u8 reason)
         }
     }
 
+    if ( reason == SHUTDOWN_crash )
+        domain_crash();  /* we will not return */  
+
     current->shutdown_code = reason;
     set_bit(DF_SHUTDOWN, &current->flags);
 
index 61ba2d3776b69cafeb9cd6e0f58c90567e07db5a..8415132d45d864bd7f7b4388d9044c6e4cc3d90d 100644 (file)
@@ -19,7 +19,7 @@
 #define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
 #define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
 #define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
-
+#define SHUTDOWN_crash      3  /* Tell controler we've crashed.              */
 
 /*
  * CONTROLLER MESSAGING INTERFACE.