From: "Mark Johnson" Subject: Re: [PATCH] don't use mlock() with Solaris tools Date: Fri, 20 Oct 2006 16:11:30 -0700 Message-ID: <521a4d120610201611w78d0c236v5ce93d4b80e51b09@mail.gmail.com> References: <20061020034247.GB4480@totally.trollied.org> <20061020223527.GC28613@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20061020223527.GC28613@redhat.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: veillard@redhat.com Cc: xen-devel@lists.xensource.com, John Levon List-Id: xen-devel@lists.xenproject.org On 10/20/06, Daniel Veillard wrote: > On Fri, Oct 20, 2006 at 04:42:47AM +0100, John Levon wrote: > > on solaris: mlock requires a page aligned address and mlock doesn't ensure the pages won't minor page fault; so don't use it on solaris. > [...] > > -/* NB: arr must be mlock'ed */ > > +int lock_pages(void *addr, size_t len) > > +{ > > + int e = 0; > > +#ifndef __sun__ > > + e = mlock(addr, len); > > +#endif > > + return (e); > > +} > > + > > +void unlock_pages(void *addr, size_t len) > > +{ > > +#ifndef __sun__ > > + safe_munlock(addr, len); > > +#endif > > +} > > + > > So on Solaris you don't pin down the memory used for hypercall parameters > and results at all ? Is there really no risk associated with this strategy ? > > surprised, We have to pin it down in the privcmd driver. There is no way to ping the memory from a user app. MRJ