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-devel

[Xen-devel] [PATCH 06/10] Xen: Support for memory_op Hypercall

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 06/10] Xen: Support for memory_op Hypercall
From: Daniel Castro <evil.dani@xxxxxxxxx>
Date: Fri, 19 Aug 2011 01:03:23 +0900
Cc: Daniel Castro <evil.dani@xxxxxxxxx>
Delivery-date: Thu, 18 Aug 2011 09:13:20 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=a+GrgcipqHvx1MLW2QO91fx+H6KpsI6NbCmBdkzwA1w=; b=u5r6Jb7cdpCTpsc+BSRiFGjn5JHxys3jDvzLdZw1b4yvKvouMYy7HBWlXgG/E96bmD 816yTD64kuI3JSr62YNs1Alfh7yGdfFZdKl2oi0e1GkWESHbRU5x80056JhF0k6MSVyk 03Za19If11gV1GDbOMzuDkjTHaiN8CX9I6eUE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1313683408-32306-1-git-send-email-evil.dani@xxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1313683408-32306-1-git-send-email-evil.dani@xxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Adds support via hypercalls to change memory mapping,
get shared_info and get the grant table from the hypervisor.

Signed-off-by: Daniel Castro <evil.dani@xxxxxxxxx>
---
 src/xen.h |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/src/xen.h b/src/xen.h
index 9e218fc..de2b1ef 100644
--- a/src/xen.h
+++ b/src/xen.h
@@ -186,6 +186,7 @@ __DEFINE_XEN_GUEST_HANDLE(u8,  u8);
 __DEFINE_XEN_GUEST_HANDLE(u16, u16);
 __DEFINE_XEN_GUEST_HANDLE(u32, u32);
 
+#define __HYPERVISOR_memory_op            12
 #define __HYPERVISOR_xen_version          17
 #define __HYPERVISOR_event_channel_op     32
 #define __HYPERVISOR_hvm_op               34
@@ -234,6 +235,41 @@ struct evtchn_send {
 };
 typedef struct evtchn_send evtchn_send_t;
 
+/******************************************************************************
+ * memory.h
+ *
+ * Memory reservation and information.
+ *
+ * Copyright (c) 2005, Keir Fraser <keir@xxxxxxxxxxxxx>
+ */
+/*
+ * Sets the GPFN at which a particular page appears in the specified guest's
+ * pseudophysical address space.
+ * arg == addr of xen_add_to_physmap_t.
+ */
+#define XENMEM_add_to_physmap      7
+struct xen_add_to_physmap {
+    /* Which domain to change the mapping for. */
+    u64 domid;
+
+    /* Source mapping space. */
+#define XENMAPSPACE_shared_info 0 /* shared info page */
+#define XENMAPSPACE_grant_table 1 /* grant table page */
+#define XENMAPSPACE_gmfn        2 /* GMFN */
+    unsigned int space;
+
+#define XENMAPIDX_grant_table_status 0x80000000
+
+    /* Index into source mapping space. */
+    xen_ulong_t idx;
+
+    /* GPFN where the source mapping page should appear. */
+    xen_pfn_t     gpfn;
+};
+typedef struct xen_add_to_physmap xen_add_to_physmap_t;
+DEFINE_XEN_GUEST_HANDLE(xen_add_to_physmap_t);
+
+
 /*
  * Wrappers for hypercalls
  */
@@ -245,4 +281,9 @@ static inline int hypercall_event_channel_op(int cmd, void 
*arg)
 {
        return _hypercall2(int, event_channel_op, cmd, arg);
 }
+static inline int hypercall_memory_op(int cmd ,void *arg)
+{
+       return _hypercall2(int, memory_op, cmd ,arg);
+}
+
 #endif
-- 
1.7.4.1


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