All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhai, Edwin" <edwin.zhai@intel.com>
To: Anthony Liguori <aliguori@linux.vnet.ibm.com>
Cc: xen-devel@lists.xensource.com, "Zhai, Edwin" <edwin.zhai@intel.com>
Subject: Re: [PATCH 2/8] HVM save restore: new hyper-call
Date: Sat, 13 Jan 2007 00:05:17 +0800	[thread overview]
Message-ID: <20070112160517.GL6153@edwin-srv.sh.intel.com> (raw)
In-Reply-To: <45A6740D.1010403@linux.vnet.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 956 bytes --]

On Thu, Jan 11, 2007 at 11:29:49AM -0600, Anthony Liguori wrote:
> Zhai, Edwin wrote:
> >+
> >+/* set info to hvm guest for restore */
> >+int xc_domain_hvm_setcontext(int xc_handle,
> >+                             uint32_t domid,
> >+                             hvm_domain_context_t *hvm_ctxt)
> >+{
> >+    int rc;
> >+    DECLARE_DOMCTL;
> >+
> >+    domctl.cmd = XEN_DOMCTL_sethvmcontext;
> >+    domctl.domain = domid;
> >+    set_xen_guest_handle(domctl.u.hvmcontext.ctxt, hvm_ctxt);
> >+
> >+    if ( (rc = mlock(hvm_ctxt, sizeof(*hvm_ctxt))) != 0 )
> >+        return rc;
> >+
> >+    rc = do_domctl(xc_handle, &domctl);
> >+
> >+    safe_munlock(hvm_ctxt, sizeof(*hvm_ctxt));
> >+
> >+    return rc;
> > }
> 
> Perhaps these should be lock_pages instead of calling mlock() directly?

yes, you are right. i forgot to refresh old patch when rebase.
attached minor fix is okay.

thanks,

> 
> Regards,
> 
> Anthony Liguori
> 

-- 
best rgds,
edwin

[-- Attachment #2: hyper-call-fix.patch --]
[-- Type: text/plain, Size: 1098 bytes --]

diff -r bc8f03bef99f tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Thu Jan 11 21:06:24 2007 +0800
+++ b/tools/libxc/xc_domain.c	Fri Jan 12 23:20:55 2007 +0800
@@ -247,12 +247,12 @@ int xc_domain_hvm_getcontext(int xc_hand
     domctl.domain = (domid_t)domid;
     set_xen_guest_handle(domctl.u.hvmcontext.ctxt, hvm_ctxt);
 
-    if ( (rc = mlock(hvm_ctxt, sizeof(*hvm_ctxt))) != 0 )
+    if ( (rc = lock_pages(hvm_ctxt, sizeof(*hvm_ctxt))) != 0 )
         return rc;
 
     rc = do_domctl(xc_handle, &domctl);
 
-    safe_munlock(hvm_ctxt, sizeof(*hvm_ctxt));
+    unlock_pages(hvm_ctxt, sizeof(*hvm_ctxt));
 
     return rc;
 }
@@ -269,12 +269,12 @@ int xc_domain_hvm_setcontext(int xc_hand
     domctl.domain = domid;
     set_xen_guest_handle(domctl.u.hvmcontext.ctxt, hvm_ctxt);
 
-    if ( (rc = mlock(hvm_ctxt, sizeof(*hvm_ctxt))) != 0 )
+    if ( (rc = lock_pages(hvm_ctxt, sizeof(*hvm_ctxt))) != 0 )
         return rc;
 
     rc = do_domctl(xc_handle, &domctl);
 
-    safe_munlock(hvm_ctxt, sizeof(*hvm_ctxt));
+    unlock_pages(hvm_ctxt, sizeof(*hvm_ctxt));
 
     return rc;
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

      reply	other threads:[~2007-01-12 16:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-11 14:08 [PATCH 2/8] HVM save restore: new hyper-call Zhai, Edwin
2007-01-11 17:29 ` Anthony Liguori
2007-01-12 16:05   ` Zhai, Edwin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070112160517.GL6153@edwin-srv.sh.intel.com \
    --to=edwin.zhai@intel.com \
    --cc=aliguori@linux.vnet.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.