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

[Xen-devel] [PATCH RFC 13/14] xen: tools: Introduce the set-subpage into xenctrl



From: Zhang Yi Z <yi.z.zhang@xxxxxxxxxxxxxxx>

Introduce the Xen Hypercall HVMOP_set_subpage into Xenctl.
The API is defined as flowing.

int xc_mem_set_subpage(xc_interface *handle, domid_t domid,
                       xen_pfn_t gfn, uint32_t access);

Signed-off-by: Zhang, Yi Z <yi.z.zhang@xxxxxxxxxxxxxxx>
---
 tools/libxc/include/xenctrl.h |  2 ++
 tools/libxc/xc_mem_paging.c   | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index bde8313..a13f2c7 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1956,6 +1956,8 @@ int xc_mem_paging_evict(xc_interface *xch, domid_t 
domain_id, uint64_t gfn);
 int xc_mem_paging_prep(xc_interface *xch, domid_t domain_id, uint64_t gfn);
 int xc_mem_paging_load(xc_interface *xch, domid_t domain_id,
                        uint64_t gfn, void *buffer);
+int xc_mem_set_subpage(xc_interface *handle, domid_t domid,
+                             xen_pfn_t gfn, uint32_t access);
 
 /** 
  * Access tracking operations.
diff --git a/tools/libxc/xc_mem_paging.c b/tools/libxc/xc_mem_paging.c
index 28611f4..36f7949 100644
--- a/tools/libxc/xc_mem_paging.c
+++ b/tools/libxc/xc_mem_paging.c
@@ -116,6 +116,26 @@ int xc_mem_paging_load(xc_interface *xch, domid_t 
domain_id,
     return rc;
 }
 
+int xc_mem_set_subpage(xc_interface *handle, domid_t domid,
+                             xen_pfn_t gfn, uint32_t access)
+{
+    int rc;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_subpage_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    arg->domid = domid;
+    arg->access_map = access;
+    arg->gfn = gfn;
+
+    rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_set_subpage,
+                 HYPERCALL_BUFFER_AS_ARG(arg));
+
+    xc_hypercall_buffer_free(handle, arg);
+    return rc;
+}
 
 /*
  * Local variables:
-- 
2.7.4


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

 


Rackspace

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