ia64/xen-unstable

changeset 12006:5cd95a6f8412

[IA64] fix xenperf

xenperf became not to work due to xencomm.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Sun Oct 29 11:13:30 2006 -0700 (2006-10-29)
parents 01b257e72d5e
children 622bb65e2011
files linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c	Sun Oct 29 11:05:53 2006 -0700
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c	Sun Oct 29 11:13:30 2006 -0700
     1.3 @@ -120,25 +120,49 @@ xencomm_privcmd_sysctl(privcmd_hypercall
     1.4  	case XEN_SYSCTL_sched_id:
     1.5  		break;
     1.6  	case XEN_SYSCTL_perfc_op:
     1.7 -		ret = xencomm_create(
     1.8 -			xen_guest_handle(kern_op.u.perfc_op.desc),
     1.9 -			kern_op.u.perfc_op.nr_counters *
    1.10 -			sizeof(xen_sysctl_perfc_desc_t),
    1.11 -			&desc, GFP_KERNEL);
    1.12 +	{
    1.13 +		struct xencomm_handle *tmp_desc;
    1.14 +		xen_sysctl_t tmp_op = {
    1.15 +			.cmd = XEN_SYSCTL_perfc_op,
    1.16 +			.interface_version = XEN_SYSCTL_INTERFACE_VERSION,
    1.17 +			.u.perfc_op = {
    1.18 +				.cmd = XEN_SYSCTL_PERFCOP_query,
    1.19 +				// .desc.p = NULL,
    1.20 +				// .val.p = NULL,
    1.21 +			},
    1.22 +		};
    1.23 +
    1.24 +		if (xen_guest_handle(kern_op.u.perfc_op.desc) == NULL) {
    1.25 +			if (xen_guest_handle(kern_op.u.perfc_op.val) != NULL)
    1.26 +				return -EINVAL;
    1.27 +			break;
    1.28 +		}
    1.29 +
    1.30 +		/* query the buffer size for xencomm */
    1.31 +		tmp_desc = xencomm_create_inline(&tmp_op);
    1.32 +		ret = xencomm_arch_hypercall_sysctl(tmp_desc);
    1.33  		if (ret)
    1.34  			return ret;
    1.35 -		set_xen_guest_handle(kern_op.u.perfc_op.val,
    1.36 -				     (void *)desc);
    1.37 -		ret = xencomm_create(
    1.38 -			xen_guest_handle(kern_op.u.perfc_op.val),
    1.39 -			kern_op.u.perfc_op.nr_vals *
    1.40 -			sizeof(xen_sysctl_perfc_desc_t),
    1.41 -			&desc1, GFP_KERNEL);
    1.42 +
    1.43 +		ret = xencomm_create(xen_guest_handle(kern_op.u.perfc_op.desc),
    1.44 +		                     tmp_op.u.perfc_op.nr_counters *
    1.45 +		                     sizeof(xen_sysctl_perfc_desc_t),
    1.46 +		                     &desc, GFP_KERNEL);
    1.47 +		if (ret)
    1.48 +			return ret;
    1.49 +
    1.50 +		set_xen_guest_handle(kern_op.u.perfc_op.desc, (void *)desc);
    1.51 +
    1.52 +		ret = xencomm_create(xen_guest_handle(kern_op.u.perfc_op.val),
    1.53 +		                     tmp_op.u.perfc_op.nr_vals *
    1.54 +		                     sizeof(xen_sysctl_perfc_val_t),
    1.55 +		                     &desc1, GFP_KERNEL);
    1.56  		if (ret)
    1.57  			xencomm_free(desc);
    1.58 -		set_xen_guest_handle(kern_op.u.perfc_op.val,
    1.59 -				     (void *)desc1);
    1.60 +
    1.61 +		set_xen_guest_handle(kern_op.u.perfc_op.val, (void *)desc1);
    1.62  		break;
    1.63 +	}
    1.64  	case XEN_SYSCTL_getdomaininfolist:
    1.65  		ret = xencomm_create(
    1.66  			xen_guest_handle(kern_op.u.getdomaininfolist.buffer),