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

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

Dave Scott, le Mon 22 Sep 2014 11:01:48 +0000, a Ãcrit :
> 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?

Yes, since allocate_ondemand browses the page table directly, which is
what unmapping updates.

> I also noticed that the x86 version initialises the âdemand mapping areaâ 
> from âmax_pfnâ in mm.c.

Yes, that's the start of available virtual addresses to be used for
mapping stuff.

>  *  2. If GNTMAP_host_map is specified then a mapping will be added at
>  *     either a host virtual address in the current address space, or at
>  *     a PTE at the specified machine address.
> Iâm not totally sure what a âhost virtual addressâ refers to but I notice the 
> address weâre using in the call is the regular virtual address (the one we 
> can simply deref and read the data). As an experiment I wrapped it via the 
> to_phys macro and suddenly it worked:

I'm not sure what it is supposed to be indeed. In the arm port
create_grant_host_mapping apparently uses it as a gp address. In the x86
port, create_grant_host_mapping uses it as a virtual address.

> Of course this might be the wrong thing to doâ it might break x86 where:
> #define VIRT_START                 ((unsigned long)&_text)
> #define to_phys(x)                 ((unsigned long)(x)-VIRT_START)
> Iâve not had a chance to see whether this breaks x86. Certainly x86 worked 
> before my patch.

Actually &_text is 0 there, so it would work. We need to make sure this
isn't just by pure luck, though :)


Xen-devel mailing list



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