From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhai, Edwin" Subject: Re: [PATCH 2/8] HVM save restore: new hyper-call Date: Sat, 13 Jan 2007 00:05:17 +0800 Message-ID: <20070112160517.GL6153@edwin-srv.sh.intel.com> References: <20070111140826.GA2860@edwin-gen.sh.intel.com> <45A6740D.1010403@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="mYCpIKhGyMATD0i+" Return-path: Content-Disposition: inline In-Reply-To: <45A6740D.1010403@linux.vnet.ibm.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Anthony Liguori Cc: xen-devel@lists.xensource.com, "Zhai, Edwin" List-Id: xen-devel@lists.xenproject.org --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="hyper-call-fix.patch" 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; } --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --mYCpIKhGyMATD0i+--