WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH] xenperf

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] xenperf
From: Kouya SHIMURA <kouya@xxxxxxxxxxxxxx>
Date: Thu, 26 Oct 2006 11:18:12 +0900
Delivery-date: Wed, 25 Oct 2006 19:18:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,

xenperf became not to work due to xencomm.
This patch fixes it.

Thanks,
Kouya

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r cf05aabe6e65 linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c Wed Oct 25 15:29:00 
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/xcom_privcmd.c Thu Oct 26 11:13:33 
2006 +0900
@@ -120,25 +120,50 @@ xencomm_privcmd_sysctl(privcmd_hypercall
        case XEN_SYSCTL_sched_id:
                break;
        case XEN_SYSCTL_perfc_op:
-               ret = xencomm_create(
-                       xen_guest_handle(kern_op.u.perfc_op.desc),
-                       kern_op.u.perfc_op.nr_counters *
-                       sizeof(xen_sysctl_perfc_desc_t),
-                       &desc, GFP_KERNEL);
+       {
+               struct xencomm_handle *tmp_desc;
+               xen_sysctl_t tmp_op = {
+                       .cmd = XEN_SYSCTL_perfc_op,
+                       .interface_version = XEN_SYSCTL_INTERFACE_VERSION,
+                       .u.perfc_op = {
+                               .cmd = XEN_SYSCTL_PERFCOP_query,
+                               // .desc.p = NULL,
+                               // .val.p = NULL,
+                       },
+               };
+
+               if (xen_guest_handle(kern_op.u.perfc_op.desc) == NULL) {
+                       if (xen_guest_handle(kern_op.u.perfc_op.val) != NULL)
+                               return -EINVAL;
+                       break;
+               }
+
+               /* query the buffer size for xencomm */
+               tmp_desc = xencomm_create_inline(&tmp_op);
+               ret = xencomm_arch_hypercall_sysctl(tmp_desc);
                if (ret)
                        return ret;
-               set_xen_guest_handle(kern_op.u.perfc_op.val,
+
+               ret = xencomm_create(
+                       xen_guest_handle(kern_op.u.perfc_op.desc),
+                       tmp_op.u.perfc_op.nr_counters *
+                       sizeof(xen_sysctl_perfc_desc_t),
+                       &desc, GFP_KERNEL);
+               if (ret)
+                       return ret;
+               set_xen_guest_handle(kern_op.u.perfc_op.desc,
                                     (void *)desc);
                ret = xencomm_create(
                        xen_guest_handle(kern_op.u.perfc_op.val),
-                       kern_op.u.perfc_op.nr_vals *
-                       sizeof(xen_sysctl_perfc_desc_t),
+                       tmp_op.u.perfc_op.nr_vals *
+                       sizeof(xen_sysctl_perfc_val_t),
                        &desc1, GFP_KERNEL);
                if (ret)
                        xencomm_free(desc);
                set_xen_guest_handle(kern_op.u.perfc_op.val,
                                     (void *)desc1);
                break;
+       }
        case XEN_SYSCTL_getdomaininfolist:
                ret = xencomm_create(
                        xen_guest_handle(kern_op.u.getdomaininfolist.buffer),
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>