ia64/xen-unstable

changeset 4122:62fcb87e60f6

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
author iap10@freefall.cl.cam.ac.uk
date Sun Mar 13 01:36:29 2005 +0000 (2005-03-13)
parents a0be5e5a1f37
children 108ea6682e8a d3e7dab61056
files linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h xen/common/domain.c xen/include/public/io/domain_controller.h
line diff
     1.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h	Sat Mar 12 18:01:35 2005 +0000
     1.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/hypervisor.h	Sun Mar 13 01:36:29 2005 +0000
     1.3 @@ -289,6 +289,22 @@ HYPERVISOR_suspend(
     1.4      return ret;
     1.5  }
     1.6  
     1.7 +static inline int
     1.8 +HYPERVISOR_crash(
     1.9 +    void)
    1.10 +{
    1.11 +    int ret;
    1.12 +    unsigned long ign1;
    1.13 +    __asm__ __volatile__ (
    1.14 +        TRAP_INSTR
    1.15 +        : "=a" (ret), "=b" (ign1)
    1.16 +	: "0" (__HYPERVISOR_sched_op),
    1.17 +	  "1" (SCHEDOP_shutdown | (SHUTDOWN_crash << SCHEDOP_reasonshift))
    1.18 +        : "memory" );
    1.19 +
    1.20 +    return ret;
    1.21 +}
    1.22 +
    1.23  static inline long
    1.24  HYPERVISOR_set_timer_op(
    1.25      u64 timeout)
     2.1 --- a/xen/common/domain.c	Sat Mar 12 18:01:35 2005 +0000
     2.2 +++ b/xen/common/domain.c	Sun Mar 13 01:36:29 2005 +0000
     2.3 @@ -16,6 +16,7 @@
     2.4  #include <asm/shadow.h>
     2.5  #include <public/dom0_ops.h>
     2.6  #include <asm/domain_page.h>
     2.7 +#include <public/io/domain_controller.h>
     2.8  
     2.9  /* Both these structures are protected by the domlist_lock. */
    2.10  rwlock_t domlist_lock = RW_LOCK_UNLOCKED;
    2.11 @@ -168,6 +169,9 @@ void domain_shutdown(u8 reason)
    2.12          }
    2.13      }
    2.14  
    2.15 +    if ( reason == SHUTDOWN_crash )
    2.16 +        domain_crash();  /* we will not return */  
    2.17 +
    2.18      current->shutdown_code = reason;
    2.19      set_bit(DF_SHUTDOWN, &current->flags);
    2.20  
     3.1 --- a/xen/include/public/io/domain_controller.h	Sat Mar 12 18:01:35 2005 +0000
     3.2 +++ b/xen/include/public/io/domain_controller.h	Sun Mar 13 01:36:29 2005 +0000
     3.3 @@ -19,7 +19,7 @@
     3.4  #define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
     3.5  #define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
     3.6  #define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
     3.7 -
     3.8 +#define SHUTDOWN_crash      3  /* Tell controler we've crashed.              */
     3.9  
    3.10  /*
    3.11   * CONTROLLER MESSAGING INTERFACE.