Re: [PATCH 4 of 7] lguest: Config and headers

2007-02-10 Thread Rusty Russell
On Fri, 2007-02-09 at 22:45 -0500, James Morris wrote: > On Sat, 10 Feb 2007, Rusty Russell wrote: > > > Well it was the use of get_order() which triggered Andi's alarm bells, > > so I went back to deriving it. This code is correct, however. > > + hype_pages = alloc_pages(GFP_KERNEL|__GFP_

Re: [PATCH 4 of 7] lguest: Config and headers

2007-02-09 Thread James Morris
On Sat, 10 Feb 2007, Rusty Russell wrote: > Well it was the use of get_order() which triggered Andi's alarm bells, > so I went back to deriving it. This code is correct, however. + hype_pages = alloc_pages(GFP_KERNEL|__GFP_ZERO, HYPERVISOR_MAP_ORDER); + if (!hype_pages) +

Re: [PATCH 4 of 7] lguest: Config and headers

2007-02-09 Thread Rusty Russell
On Fri, 2007-02-09 at 13:15 -0500, James Morris wrote: > On Sat, 10 Feb 2007, Rusty Russell wrote: > > > +/* 64k ought to be enough for anybody! */ > > +#define HYPERVISOR_MAP_ORDER 16 > > +#define HYPERVISOR_PAGES ((1 << HYPERVISOR_MAP_ORDER)/PAGE_SIZE) > > I think it'd be better to go back to d

Re: [PATCH 4 of 7] lguest: Config and headers

2007-02-09 Thread James Morris
On Sat, 10 Feb 2007, Rusty Russell wrote: > +/* 64k ought to be enough for anybody! */ > +#define HYPERVISOR_MAP_ORDER 16 > +#define HYPERVISOR_PAGES ((1 << HYPERVISOR_MAP_ORDER)/PAGE_SIZE) I think it'd be better to go back to defining HYPERVISOR_SIZE then derive the map order from that via get_

[PATCH 4 of 7] lguest: Config and headers

2007-02-09 Thread Rusty Russell
[ This is the previous 6a, with the following Andi-inspired changes: 1) use HYPERVISOR_MAP_ORDER instead of HYPERVISOR_SIZE for clarity 2) mutex instead of a semaphore ] Unfortunately, we don't have the build infrastructure for "private" asm-offsets.h files, so there's a not-so-neat include in ar