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] mlock argument to version hypercall in libxc.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] mlock argument to version hypercall in libxc.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Sep 2005 12:32:10 +0000
Delivery-date: Mon, 12 Sep 2005 12:30:41 +0000
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/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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 03b9919f655e5dce0959bfb96a08f8a3c398fd90
# Parent  05f36d13e30c2df3b40e4dce47c1e0d5c58d6022
mlock argument to version hypercall in libxc.

Signed-off-by: Ian Pratt <ian@xxxxxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 05f36d13e30c -r 03b9919f655e tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c  Mon Sep 12 12:10:43 2005
+++ b/tools/libxc/xc_private.c  Mon Sep 12 12:17:31 2005
@@ -425,23 +425,49 @@
 
 int xc_version(int xc_handle, int cmd, void *arg)
 {
-    return do_xen_version(xc_handle, cmd, arg);
-}
-
-unsigned long xc_make_page_below_4G(int xc_handle, u32 domid, 
-                                   unsigned long mfn)
+    int rc, argsize = 0;
+
+    switch ( cmd )
+    {
+    case XENVER_extraversion: argsize = sizeof(xen_extraversion_t); break;
+    case XENVER_compile_info: argsize = sizeof(xen_compile_info_t); break;
+    case XENVER_capabilities: argsize = sizeof(xen_capabilities_info_t); break;
+    case XENVER_changeset:    argsize = sizeof(xen_changeset_info_t); break;
+    case XENVER_parameters:   argsize = sizeof(xen_parameters_info_t); break;
+    }
+
+    if ( (argsize != 0) && (mlock(arg, argsize) != 0) )
+    {
+        PERROR("Could not lock memory for version hypercall");
+        return -ENOMEM;
+    }
+
+    rc = do_xen_version(xc_handle, cmd, arg);
+
+    if ( argsize != 0 )
+        safe_munlock(arg, argsize);
+
+    return rc;
+}
+
+unsigned long xc_make_page_below_4G(
+    int xc_handle, u32 domid, unsigned long mfn)
 {
     unsigned long new_mfn;
+
     if ( xc_domain_memory_decrease_reservation( 
-       xc_handle, domid, 1, 0, &mfn ) != 1 )
+       xc_handle, domid, 1, 0, &mfn) != 1 )
     {
        fprintf(stderr,"xc_make_page_below_4G decrease failed. mfn=%lx\n",mfn);
        return 0;
     }
-    if ( xc_domain_memory_increase_reservation( xc_handle, domid, 1, 0, 32, 
&new_mfn ) != 1 )
+
+    if ( xc_domain_memory_increase_reservation(
+        xc_handle, domid, 1, 0, 32, &new_mfn) != 1 )
     {
        fprintf(stderr,"xc_make_page_below_4G increase failed. mfn=%lx\n",mfn);
        return 0;
     }
+
     return new_mfn;
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] mlock argument to version hypercall in libxc., Xen patchbot -unstable <=