[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] mini-os: arm: grant mapping



On Mon, 2014-09-22 at 11:01 +0000, Dave Scott wrote:
> Hi,
> 
> Iâve been playing with grant mapping on arm mini-os. Specifically Iâve made 
> vchan âclients' (which act as backends, mapping frontend aka âserverâ pages) 
> work with some extremely hacky patches and Iâm curious to know what you think 
> and especially, how it should really be done.
> 
> Current arch/arm/mm.c has a missing populate_ondemand function:
> 
> unsigned long allocate_ondemand(unsigned long n, unsigned long alignment)
> {
>     // FIXME
>     BUG();
> } 
> 
> I notice the arch/x86/mm.c version looks for runs of free frames in
> the page table. I notice that gntmap_munmap doesnât have any
> corresponding call to free so I assume the act of unmapping the grant
> causes Xen to mark the pages as free for you â is this correct? Would
> a similar trick work on arm or would we have to manage the memory
> explicitly ourselves?

Pages which are grant mapped are owned by the other end, so I don't know
about them being marked as free as you suggest.

Maybe the difference between x86 PV and ARM is the fact that on x86 the
map/unmap calls gnttab act on the page tables directly (which if minios
is using the present bit for "allocated", might have a useful side
effect from this pov), whereas on ARM they act on the p2m and it is up
to the guest to create the first stage page table entries.

> I also noticed that the x86 version initialises the âdemand mapping
> areaâ from âmax_pfnâ in mm.c. Iâm a bit suspicious about this on arm
> since the grant table is being mapped in somewhere pre-ordained in the
> device tree (If Iâm reading it correctly) and there could be an
> overlap (if weâre unlucky).

AIUI the demand mapping is for the domains own allocated memory (similar
to COW/allocate-OW memory on a normal Unix process), not for grant
mappings, but I may be confused.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.