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

[Xen-changelog] [xen-unstable] libxc: Export xc_core_arch_map_p2m_writab

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxc: Export xc_core_arch_map_p2m_writable()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 02 Jun 2009 10:45:17 -0700
Delivery-date: Tue, 02 Jun 2009 10:46:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1243862033 -3600
# Node ID 6d6ec6f966cf49d573be366efa4d96f807b14eba
# Parent  4b2172c60a8ca8d201fae7a211af506bb91e95d6
libxc: Export xc_core_arch_map_p2m_writable()

This patch firstly change the xc_core_arch_map_p2m() to map the p2m to
be writable, then it export this function.
One notice for this patch is, caller should make sure change the p2m
in flight will not cause trouble.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@xxxxxxxxx>
---
 tools/libxc/xc_core.h     |    5 +++++
 tools/libxc/xc_core_x86.c |   28 +++++++++++++++++++++++-----
 2 files changed, 28 insertions(+), 5 deletions(-)

diff -r 4b2172c60a8c -r 6d6ec6f966cf tools/libxc/xc_core.h
--- a/tools/libxc/xc_core.h     Mon Jun 01 14:13:20 2009 +0100
+++ b/tools/libxc/xc_core.h     Mon Jun 01 14:13:53 2009 +0100
@@ -143,6 +143,11 @@ int xc_core_arch_map_p2m(int xc_handle, 
                          xc_dominfo_t *info, shared_info_any_t *live_shinfo,
                          xen_pfn_t **live_p2m, unsigned long *pfnp);
 
+int xc_core_arch_map_p2m_writable(int xc_handle, unsigned int guest_width,
+                                  xc_dominfo_t *info,
+                                  shared_info_any_t *live_shinfo,
+                                  xen_pfn_t **live_p2m, unsigned long *pfnp);
+
 
 #if defined (__i386__) || defined (__x86_64__)
 # include "xc_core_x86.h"
diff -r 4b2172c60a8c -r 6d6ec6f966cf tools/libxc/xc_core_x86.c
--- a/tools/libxc/xc_core_x86.c Mon Jun 01 14:13:20 2009 +0100
+++ b/tools/libxc/xc_core_x86.c Mon Jun 01 14:13:53 2009 +0100
@@ -75,10 +75,10 @@ xc_core_arch_memory_map_get(int xc_handl
     return 0;
 }
 
-int
-xc_core_arch_map_p2m(int xc_handle, unsigned int guest_width, xc_dominfo_t 
*info,
-                     shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
-                     unsigned long *pfnp)
+static int
+xc_core_arch_map_p2m_rw(int xc_handle, unsigned int guest_width, xc_dominfo_t 
*info,
+                        shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
+                        unsigned long *pfnp, int rw)
 {
     /* Double and single indirect references to the live P2M table */
     xen_pfn_t *live_p2m_frame_list_list = NULL;
@@ -156,7 +156,8 @@ xc_core_arch_map_p2m(int xc_handle, unsi
         for ( i = P2M_FL_ENTRIES - 1; i >= 0; i-- )
             p2m_frame_list[i] = ((uint32_t *)p2m_frame_list)[i];
 
-    *live_p2m = xc_map_foreign_pages(xc_handle, dom, PROT_READ,
+    *live_p2m = xc_map_foreign_pages(xc_handle, dom,
+                                    rw ? (PROT_READ | PROT_WRITE) : PROT_READ,
                                     p2m_frame_list,
                                     P2M_FL_ENTRIES);
 
@@ -189,6 +190,23 @@ out:
     return ret;
 }
 
+int
+xc_core_arch_map_p2m(int xc_handle, unsigned int guest_width, xc_dominfo_t 
*info,
+                        shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
+                        unsigned long *pfnp)
+{
+    return xc_core_arch_map_p2m_rw(xc_handle, guest_width, info,
+                                   live_shinfo, live_p2m, pfnp, 0);
+}
+
+int
+xc_core_arch_map_p2m_writable(int xc_handle, unsigned int guest_width, 
xc_dominfo_t *info,
+                              shared_info_any_t *live_shinfo, xen_pfn_t 
**live_p2m,
+                              unsigned long *pfnp)
+{
+    return xc_core_arch_map_p2m_rw(xc_handle, guest_width, info,
+                                   live_shinfo, live_p2m, pfnp, 1);
+}
 /*
  * Local variables:
  * mode: C

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxc: Export xc_core_arch_map_p2m_writable(), Xen patchbot-unstable <=