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

[Xen-changelog] [xen-unstable] [XEN] Hypercall-init dom0_op takes GMFN, not MFN.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 2aa910eb3713cbf2e078c842fc0ed5572d0d9bd7
# Parent  d6363854fb35e8b6f6b6271d770b996ea6806111
[XEN] Hypercall-init dom0_op takes GMFN, not MFN.
Signed-off-by: Steven Smith <sos22@xxxxxxxxxxxx>
---
 tools/libxc/xc_linux_build.c  |    3 ++-
 xen/arch/x86/dom0_ops.c       |   12 +++++++-----
 xen/include/public/dom0_ops.h |    4 ++--
 3 files changed, 11 insertions(+), 8 deletions(-)

diff -r d6363854fb35 -r 2aa910eb3713 tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c      Wed Jul 05 14:31:22 2006 +0100
+++ b/tools/libxc/xc_linux_build.c      Wed Jul 05 17:16:10 2006 +0100
@@ -1053,7 +1053,8 @@ static int setup_guest(int xc_handle,
         if ( hypercall_pfn >= nr_pages )
             goto error_out;
         op.u.hypercall_init.domain = (domid_t)dom;
-        op.u.hypercall_init.mfn    = page_array[hypercall_pfn];
+        op.u.hypercall_init.gmfn   = shadow_mode_enabled ?
+            hypercall_pfn : page_array[hypercall_pfn];
         op.cmd = DOM0_HYPERCALL_INIT;
         if ( xc_dom0_op(xc_handle, &op) )
             goto error_out;
diff -r d6363854fb35 -r 2aa910eb3713 xen/arch/x86/dom0_ops.c
--- a/xen/arch/x86/dom0_ops.c   Wed Jul 05 14:31:22 2006 +0100
+++ b/xen/arch/x86/dom0_ops.c   Wed Jul 05 17:16:10 2006 +0100
@@ -407,14 +407,16 @@ long arch_do_dom0_op(struct dom0_op *op,
 
     case DOM0_HYPERCALL_INIT:
     {
-        struct domain *d; 
-        unsigned long mfn = op->u.hypercall_init.mfn;
+        struct domain *d = find_domain_by_id(op->u.hypercall_init.domain);
+        unsigned long gmfn = op->u.hypercall_init.gmfn;
+        unsigned long mfn;
         void *hypercall_page;
 
         ret = -ESRCH;
-        if ( unlikely((d = find_domain_by_id(
-            op->u.hypercall_init.domain)) == NULL) )
-            break;
+        if ( unlikely(d == NULL) )
+            break;
+
+        mfn = gmfn_to_mfn(d, gmfn);
 
         ret = -EACCES;
         if ( !mfn_valid(mfn) ||
diff -r d6363854fb35 -r 2aa910eb3713 xen/include/public/dom0_ops.h
--- a/xen/include/public/dom0_ops.h     Wed Jul 05 14:31:22 2006 +0100
+++ b/xen/include/public/dom0_ops.h     Wed Jul 05 17:16:10 2006 +0100
@@ -509,8 +509,8 @@ DEFINE_XEN_GUEST_HANDLE(dom0_iomem_permi
 
 #define DOM0_HYPERCALL_INIT   48
 struct dom0_hypercall_init {
-    domid_t  domain;          /* domain to be affected */
-    xen_pfn_t mfn;            /* machine frame to be initialised */
+    domid_t   domain;          /* domain to be affected */
+    xen_pfn_t gmfn;            /* GMFN to be initialised */
 };
 typedef struct dom0_hypercall_init dom0_hypercall_init_t;
 DEFINE_XEN_GUEST_HANDLE(dom0_hypercall_init_t);

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


 


Rackspace

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