[XenPPC] Re: [Xen-devel] [PATCH] don't use mlock() with Solaris tools

2006-10-23 Thread Keir Fraser
On 22/10/06 22:09, "Jimi Xenidis" <[EMAIL PROTECTED]> wrote:

> I cannot speak for Hollis (I think he may actually disagree with me)
> but see this as an opportunity to design something better, or at
> least have the debat (again).
> What might be a better alternative an to actually have an allocate
> call rather than an mlock call where the arches and OSes could to
> what is best for them.
> So what is done on x86 could be:
>do { x = alloca(len); mlock (x, len); } while (0)
> 
> but where solaris and other arches could do something more.

It would change the API too, since memory buffers passed in by callers to
libxc would also need to be allocated in a special way. Unless you would be
prepared to perform the hypercall on a shadow buffer and then copy to the
caller buffer, which I suppose would be a simpler API.

John's patch is fine for now.

 -- Keir



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


[XenPPC] Re: [Xen-devel] [PATCH] don't use mlock() with Solaris tools

2006-10-23 Thread John Levon
On Sun, Oct 22, 2006 at 05:09:35PM -0400, Jimi Xenidis wrote:

> Hollis and I touched on this and has been the bane of our existence  
> since we were required to have Xen interpret user level pointers,  
> thread started here:
>   http://lists.xensource.com/archives/html/xen-devel/2005-08/ 
> msg00719.html
> 
> I cannot speak for Hollis (I think he may actually disagree with me)  
> but see this as an opportunity to design something better, or at  
> least have the debat (again).

Yes, we should have something better. At the moment I'm trying to clear
out our patch queue (we only have a few hacks left really now...)

The "special pages" idea of yours sounds workable if the
xc_get_pfn_list() thing can be fixed.

> What might be a better alternative an to actually have an allocate  
> call rather than an mlock call where the arches and OSes could to  
> what is best for them.
> So what is done on x86 could be:
>   do { x = alloca(len); mlock (x, len); } while (0)

This would be a little uncomfortable, if only because it's an extra
system call every time. Also letting userspace pin translations in
memory would be troublesome.

> BTW: John, how do you solve the minor faults?!

We currently interpret the ioctl in the privcmd driver and softlock the
mappings in. Which isn't very nice for all the reasons you point out.

regards
john

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


[XenPPC] Re: [Xen-devel] [PATCH] don't use mlock() with Solaris tools

2006-10-22 Thread Jimi Xenidis


On Oct 22, 2006, at 2:16 PM, Keir Fraser wrote:


On 22/10/06 7:02 pm, "John Levon" <[EMAIL PROTECTED]> wrote:


# HG changeset patch
# User [EMAIL PROTECTED]
# Date 1161315500 25200
# Node ID ad404ee927926b8cc4a6498b180e78f0939eb2eb
# Parent  3685871c6f7930c7d35baea7cee4f51d00415796
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.


This isn't in unstable yet; I don't know if it was missed or if  
there's

some better way we could do this?

thanks,
john


Don't worry, it's in my to-apply list. I don't do FIFO. :-)


Hey, hang on a minute.
If you are gonna add this then can we abstract this to the arches and  
with somethign better than an ifdef?

The locking makes no sense in PPC (even on linux) either.

Hollis and I touched on this and has been the bane of our existence  
since we were required to have Xen interpret user level pointers,  
thread started here:
  http://lists.xensource.com/archives/html/xen-devel/2005-08/ 
msg00719.html


I cannot speak for Hollis (I think he may actually disagree with me)  
but see this as an opportunity to design something better, or at  
least have the debat (again).
What might be a better alternative an to actually have an allocate  
call rather than an mlock call where the arches and OSes could to  
what is best for them.

So what is done on x86 could be:
  do { x = alloca(len); mlock (x, len); } while (0)

but where solaris and other arches could do something more.


BTW: John, how do you solve the minor faults?!

-JX



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