ia64/xen-unstable

changeset 16184:183a2d6eaadf

Allow a guest to send NMIs to its VCPUs.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Mon Oct 22 11:11:04 2007 +0100 (2007-10-22)
parents c44d82f36665
children 42d8dadb5864
files xen/common/compat/domain.c xen/common/domain.c xen/include/public/vcpu.h
line diff
     1.1 --- a/xen/common/compat/domain.c	Mon Oct 22 09:42:49 2007 +0100
     1.2 +++ b/xen/common/compat/domain.c	Mon Oct 22 11:11:04 2007 +0100
     1.3 @@ -59,6 +59,7 @@ int compat_vcpu_op(int cmd, int vcpuid, 
     1.4      case VCPUOP_stop_periodic_timer:
     1.5      case VCPUOP_set_singleshot_timer:
     1.6      case VCPUOP_stop_singleshot_timer:
     1.7 +    case VCPUOP_send_nmi:
     1.8          rc = do_vcpu_op(cmd, vcpuid, arg);
     1.9          break;
    1.10  
     2.1 --- a/xen/common/domain.c	Mon Oct 22 09:42:49 2007 +0100
     2.2 +++ b/xen/common/domain.c	Mon Oct 22 11:11:04 2007 +0100
     2.3 @@ -708,11 +708,9 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
     2.4      }
     2.5  
     2.6      case VCPUOP_stop_periodic_timer:
     2.7 -    {
     2.8          v->periodic_period = 0;
     2.9          vcpu_force_reschedule(v);
    2.10          break;
    2.11 -    }
    2.12  
    2.13      case VCPUOP_set_singleshot_timer:
    2.14      {
    2.15 @@ -740,13 +738,21 @@ long do_vcpu_op(int cmd, int vcpuid, XEN
    2.16      }
    2.17  
    2.18      case VCPUOP_stop_singleshot_timer:
    2.19 -    {
    2.20          if ( v != current )
    2.21              return -EINVAL;
    2.22  
    2.23          stop_timer(&v->singleshot_timer);
    2.24 +
    2.25          break;
    2.26 -    }
    2.27 +
    2.28 +    case VCPUOP_send_nmi:
    2.29 +        if ( !guest_handle_is_null(arg) )
    2.30 +            return -EINVAL;
    2.31 +
    2.32 +        if ( !test_and_set_bool(v->nmi_pending) )
    2.33 +            vcpu_kick(v);
    2.34 +
    2.35 +        break;
    2.36  
    2.37      default:
    2.38          rc = arch_do_vcpu_op(cmd, v, arg);
     3.1 --- a/xen/include/public/vcpu.h	Mon Oct 22 09:42:49 2007 +0100
     3.2 +++ b/xen/include/public/vcpu.h	Mon Oct 22 11:11:04 2007 +0100
     3.3 @@ -179,6 +179,9 @@ struct vcpu_register_vcpu_info {
     3.4  typedef struct vcpu_register_vcpu_info vcpu_register_vcpu_info_t;
     3.5  DEFINE_XEN_GUEST_HANDLE(vcpu_register_vcpu_info_t);
     3.6  
     3.7 +/* Send an NMI to the specified VCPU. @extra_arg == NULL. */
     3.8 +#define VCPUOP_send_nmi             11
     3.9 +
    3.10  #endif /* __XEN_PUBLIC_VCPU_H__ */
    3.11  
    3.12  /*