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

[Xen-devel] [PATCH 05/13] xen: XENMEM_machphys_mfn_list hypercall



The XENMEM_machphys_mfn_list implementation reads 'max_extents' and
'extents_start'.  It writes to the array at 'extents_start', and writes the
number of extents written into the 'nr_extents' field.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 coregrind/m_syswrap/syswrap-xen.c |   19 +++++++++++++++++++
 include/vki/vki-xen-memory.h      |    6 ++++++
 2 files changed, 25 insertions(+)

diff --git a/coregrind/m_syswrap/syswrap-xen.c 
b/coregrind/m_syswrap/syswrap-xen.c
index 99d5e91..76e8b4a 100644
--- a/coregrind/m_syswrap/syswrap-xen.c
+++ b/coregrind/m_syswrap/syswrap-xen.c
@@ -103,6 +103,16 @@ PRE(memory_op)
                     (Addr)ARG2, sizeof(vki_xen_domid_t));
        break;
 
+   case VKI_XENMEM_machphys_mfn_list: {
+       struct vki_xen_machphys_mfn_list *arg =
+           (struct vki_xen_machphys_mfn_list *)ARG2;
+       PRE_MEM_READ("XENMEM_machphys_mfn_list max_extents",
+                    (Addr)&arg->max_extents, sizeof(arg->max_extents));
+       PRE_MEM_READ("XENMEM_machphys_mfn_list extent_start",
+                    (Addr)&arg->extent_start, sizeof(arg->extent_start));
+       break;
+   }
+
    case VKI_XENMEM_set_memory_map: {
       struct vki_xen_foreign_memory_map *arg =
              (struct vki_xen_foreign_memory_map *)ARG2;
@@ -755,6 +765,15 @@ POST(memory_op)
       break;
    }
 
+   case VKI_XENMEM_machphys_mfn_list: {
+       struct vki_xen_machphys_mfn_list *arg =
+           (struct vki_xen_machphys_mfn_list *)ARG2;
+       POST_MEM_WRITE((Addr)&arg->nr_extents, sizeof(arg->nr_extents));
+       POST_MEM_WRITE((Addr)arg->extent_start.p,
+                      sizeof(vki_xen_pfn_t) * arg->nr_extents);
+       break;
+   }
+
    case VKI_XENMEM_get_sharing_freed_pages:
    case VKI_XENMEM_get_sharing_shared_pages:
        /* No outputs */
diff --git a/include/vki/vki-xen-memory.h b/include/vki/vki-xen-memory.h
index eac7871..208d642 100644
--- a/include/vki/vki-xen-memory.h
+++ b/include/vki/vki-xen-memory.h
@@ -40,6 +40,12 @@ struct xen_memory_reservation {
     vki_xen_domid_t domid;
 };
 
+struct vki_xen_machphys_mfn_list {
+    unsigned int max_extents; /* IN */
+    VKI_XEN_GUEST_HANDLE(vki_xen_pfn_t) extent_start; /* OUT */
+    unsigned int nr_extents; /* OUT */
+};
+
 #endif // __VKI_XEN_MEMORY_H
 
 /*--------------------------------------------------------------------*/
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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