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

Re: [Xen-devel] Enable virtual memory for Mini-os on ARM








On Mon, Dec 23, 2013 at 1:21 PM, Samuel Thibault <samuel.thibault@xxxxxxxxxxxx> wrote:
karim.allah.ahmed@xxxxxxxxx, le Mon 23 Dec 2013 12:52:44 +0000, a écrit :
> On Mon, Dec 23, 2013 at 10:38 AM, Samuel Thibault <samuel.thibault@xxxxxxxxxxxx
> > wrote:
>
>     karim.allah.ahmed@xxxxxxxxx, le Mon 23 Dec 2013 10:23:01 +0000, a écrit :
>     > Why do I need to create pagetables and fill them for mini-os ?
>
>     I don't know the virtual memory of ARM, but on x86 we definitely need a
>     pagetable because very often we need to map/unmap things, like granted
>     mfns, i/o areas, foreign pages, etc.
>
> Can you please refer me to the part of the code related to any of these cases ?

Essentially everything that calls map_frames and friends.

- mini-os/gnttab.c calls gnttab_table = map_frames(frames, NR_GRANT_FRAMES);.
- I/O can be seen in mini-os/lib/sys.c: map_frames_ex(&first_mfn, n, 0, 1, 1,
DOMID_IO, NULL, _PAGE_PRESENT|_PAGE_RW);
- foreign pages can be seen in tools/libxc/xc_minios.c in
minios_privcmd_map_foreign_*

> In ARM MMU is virtualized in HW. So you've an extra level of translation that's
> controlled by the hypervisor.
> So, Is there a reason for doing map/unmap on virtual address space not on
> physical one ?

The physical one might be enough, I don't know the details of ARM
memory to be able to tell for sure.

> 1- Isolation between different entities ( processes ) - ( Is that applicable to
> mini-os ?

It is not.

> 2- creating a contiguous mapping of scattered pages.

Which can perhaps be done at the physical layer?

I think even if we can change the "guest_to_machine translation" ( maybe through XENMEM_populate_physmap ? ) that's controlled by the hypervisor, this is going to be more expensive than simply updating a memory location (page table) since all updates in the former case will have to go through the hypervisor!

For me using physical addresses directly was useful for:
1- No code for setting up pagetables.
2- No memory wasted/used as pagetables. ( it's a tiny amount of memory anyway )

So, if this [using physical addresses directly] ends up causing any performance loss, I think it's not worth it then.


Samuel



--
Karim Allah Ahmed.
_______________________________________________
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®.