From: iap10@freefall.cl.cam.ac.uk Date: Sun, 13 Mar 2005 01:36:29 +0000 (+0000) Subject: bitkeeper revision 1.1159.258.52 (4233991dQspKbtD0n-C6ReG4f2lHAQ) X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~17400^2~120 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=84cc6d601f5bab8194ae3fb59edf44c785f543f6;p=xen.git bitkeeper revision 1.1159.258.52 (4233991dQspKbtD0n-C6ReG4f2lHAQ) Add hypercall to allow domains to request that they be crashed. Signed-off-by: ian@xensource.com --- diff --git a/linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h b/linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h index 2d5a88a56d..cccfae35ae 100644 --- a/linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h +++ b/linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h @@ -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) diff --git a/xen/common/domain.c b/xen/common/domain.c index 47673b21ec..f04e8bdfc7 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -16,6 +16,7 @@ #include #include #include +#include /* 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, ¤t->flags); diff --git a/xen/include/public/io/domain_controller.h b/xen/include/public/io/domain_controller.h index 61ba2d3776..8415132d45 100644 --- a/xen/include/public/io/domain_controller.h +++ b/xen/include/public/io/domain_controller.h @@ -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.