ia64/xen-unstable

changeset 13795:82062701b199

[XEN] Fix perfc after 13756:56377f5ce588

64 bit guest handles can no longer be passed as parameters to
functions. Extract such parameters into a regular guest handle first.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Wed Jan 31 17:58:00 2007 +0000 (2007-01-31)
parents 5d09e6098f93
children b998ae45c076
files xen/common/perfc.c
line diff
     1.1 --- a/xen/common/perfc.c	Wed Jan 31 17:22:17 2007 +0000
     1.2 +++ b/xen/common/perfc.c	Wed Jan 31 17:58:00 2007 +0000
     1.3 @@ -136,8 +136,8 @@ static xen_sysctl_perfc_desc_t perfc_d[N
     1.4  static xen_sysctl_perfc_val_t *perfc_vals;
     1.5  static int               perfc_nbr_vals;
     1.6  static int               perfc_init = 0;
     1.7 -static int perfc_copy_info(XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc,
     1.8 -                           XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val)
     1.9 +static int perfc_copy_info(XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc,
    1.10 +                           XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val)
    1.11  {
    1.12      unsigned int i, j;
    1.13      unsigned int v = 0;
    1.14 @@ -217,20 +217,29 @@ static int perfc_copy_info(XEN_GUEST_HAN
    1.15  int perfc_control(xen_sysctl_perfc_op_t *pc)
    1.16  {
    1.17      static DEFINE_SPINLOCK(lock);
    1.18 +    XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc;
    1.19 +    XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val;
    1.20      int rc;
    1.21  
    1.22 +    /*
    1.23 +     * 64 bit guest handles cannot be passed as parameters to
    1.24 +     * functions so cast to a regular guest handle.
    1.25 +     */
    1.26 +    desc = guest_handle_cast(pc->desc, xen_sysctl_perfc_desc_t);
    1.27 +    val = guest_handle_cast(pc->val, xen_sysctl_perfc_val_t);
    1.28 +
    1.29      spin_lock(&lock);
    1.30  
    1.31      switch ( pc->cmd )
    1.32      {
    1.33      case XEN_SYSCTL_PERFCOP_reset:
    1.34 -        perfc_copy_info(pc->desc, pc->val);
    1.35 +        perfc_copy_info(desc, val);
    1.36          perfc_reset(0);
    1.37          rc = 0;
    1.38          break;
    1.39  
    1.40      case XEN_SYSCTL_PERFCOP_query:
    1.41 -        perfc_copy_info(pc->desc, pc->val);
    1.42 +        perfc_copy_info(desc, val);
    1.43          rc = 0;
    1.44          break;
    1.45