[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-ia64-devel] [PATCH] implement xencomm routine for HVMOP_track_dirty_vram.



# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1210245916 -32400
# Node ID f2d1cf8d4daf78ded03b978e2cc40360ef247fe1
# Parent  9e6566a48768ce872d6ae77208ce20be00dfe0ce
[IA64] implement xencomm routine for HVMOP_track_dirty_vram.

This patches implement xencomm routine for HVMOP_track_dirty_vram hypercall.
Without this, using vfb results in annoying messages in dom0 as
> xencomm_privcmd_hvm_op: unknown HVMOP 6
xen/ia64 doesn't implement the hypercall at this moment so that
it simply returns -ENOSYS. So the xencomm routine returns -ENOSYS
directly without issuing the useless hypercall.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff --git a/arch/ia64/xen/xcom_privcmd.c b/arch/ia64/xen/xcom_privcmd.c
--- a/arch/ia64/xen/xcom_privcmd.c
+++ b/arch/ia64/xen/xcom_privcmd.c
@@ -661,6 +661,41 @@
 }
 
 static int
+xencomm_privcmd_hvm_op_track_dirty_vram(privcmd_hypercall_t *hypercall)
+{
+#if 1
+       /*
+        * At this moment HVMOP_track_dirty_vram isn't implemented
+        * on xen/ia64 so that it just returns -ENOSYS.
+        * Don't issue hypercall to get -ENOSYS.
+        * When the hypercall is implemented, enable the following codes.
+        */
+       return -ENOSYS;
+#else
+       int cmd = hypercall->arg[0];
+       struct xen_hvm_track_dirty_vram *user_op = (void*)hypercall->arg[1];
+       struct xen_hvm_track_dirty_vram kern_op;
+       struct xencomm_handle *desc;
+       struct xencomm_handle *bitmap_desc;
+       int ret;
+
+       BUG_ON(cmd != HVMOP_track_dirty_vram);
+       if (copy_from_user(&kern_op, user_op, sizeof(kern_op)))
+               return -EFAULT;
+       desc = xencomm_map_no_alloc(&kern_op, sizeof(kern_op));
+       bitmap_desc = xencomm_map(xen_guest_handle(kern_op.dirty_bitmap),
+                                 kern_op.nr * sizeof(uint8_t));
+       if (bitmap_desc == NULL)
+               return -ENOMEM;
+       set_xen_guest_handle(kern_op.dirty_bitmap, (void*)bitmap_desc);
+       ret = xencomm_arch_hypercall_hvm_op(cmd, desc);
+       xencomm_free(bitmap_desc);
+
+       return ret;
+#endif
+}
+
+static int
 xencomm_privcmd_hvm_op(privcmd_hypercall_t *hypercall)
 {
        int cmd = hypercall->arg[0];
@@ -682,6 +717,17 @@
        case HVMOP_set_pci_link_route:
                argsize = sizeof(xen_hvm_set_pci_link_route_t);
                break;
+
+/*
+ * work around until include/xen/interface/hvm/hvm_op.h is updated.
+ * Once it is updated, this will be removed.
+ */
+#ifndef HVMOP_track_dirty_vram
+#define HVMOP_track_dirty_vram 6
+#endif
+
+       case HVMOP_track_dirty_vram:
+               return xencomm_privcmd_hvm_op_track_dirty_vram(hypercall);
 
        default:
                printk("%s: unknown HVMOP %d\n", __func__, cmd);


-- 
yamahata

Attachment: 538_f2d1cf8d4daf.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.