diff options
author | Ian Campbell <ian.campbell@xensource.com> | 2007-01-31 17:58:00 +0000 |
---|---|---|
committer | Ian Campbell <ian.campbell@xensource.com> | 2007-01-31 17:58:00 +0000 |
commit | 05e5154038b4614f4b7d6f43eb7e8b741a014608 (patch) | |
tree | 6ae8967a02b7f6f6182407850c91d6505a0b93df /xen/common/perfc.c | |
parent | f099a2a635b6a68ad1c1d975384f5ed33ad3d97c (diff) | |
download | xen-05e5154038b4614f4b7d6f43eb7e8b741a014608.tar.gz xen-05e5154038b4614f4b7d6f43eb7e8b741a014608.tar.bz2 xen-05e5154038b4614f4b7d6f43eb7e8b741a014608.zip |
[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>
Diffstat (limited to 'xen/common/perfc.c')
-rw-r--r-- | xen/common/perfc.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/xen/common/perfc.c b/xen/common/perfc.c index bbff5d7b5c..d5bcd9b2e1 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -136,8 +136,8 @@ static xen_sysctl_perfc_desc_t perfc_d[NR_PERFCTRS]; static xen_sysctl_perfc_val_t *perfc_vals; static int perfc_nbr_vals; static int perfc_init = 0; -static int perfc_copy_info(XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc, - XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val) +static int perfc_copy_info(XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc, + XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val) { unsigned int i, j; unsigned int v = 0; @@ -217,20 +217,29 @@ static int perfc_copy_info(XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc, int perfc_control(xen_sysctl_perfc_op_t *pc) { static DEFINE_SPINLOCK(lock); + XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t) desc; + XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t) val; int rc; + /* + * 64 bit guest handles cannot be passed as parameters to + * functions so cast to a regular guest handle. + */ + desc = guest_handle_cast(pc->desc, xen_sysctl_perfc_desc_t); + val = guest_handle_cast(pc->val, xen_sysctl_perfc_val_t); + spin_lock(&lock); switch ( pc->cmd ) { case XEN_SYSCTL_PERFCOP_reset: - perfc_copy_info(pc->desc, pc->val); + perfc_copy_info(desc, val); perfc_reset(0); rc = 0; break; case XEN_SYSCTL_PERFCOP_query: - perfc_copy_info(pc->desc, pc->val); + perfc_copy_info(desc, val); rc = 0; break; |