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] [XEN] Hypercall-init dom0_op takes GMFN,

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Hypercall-init dom0_op takes GMFN, not MFN.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 05 Jul 2006 18:20:28 +0000
Delivery-date: Wed, 05 Jul 2006 11:22:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] Hypercall-init dom0_op takes GMFN, not MFN., Xen patchbot-unstable <=