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

[Xen-devel] question regarding foreign memory mapping in xen

  • To: Xen Devel <xen-devel@xxxxxxxxxxxxx>
  • From: Sengul Thomas <thomas.sengul@xxxxxxxxx>
  • Date: Mon, 27 May 2013 22:06:13 +0900
  • Delivery-date: Mon, 27 May 2013 13:06:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Hello xen developers :)

I'm reading source codes of xen and got a question in tool-stack part
and got series of questions:

In file tools/libxc/xc_linux_osdep.c, function linux_privcmd_map_foreign_bulk,
I notice that mmap and ioctl IOCTL_PRIVCMD_MMAPBATCH_V2, are used
for mapping a foreign memory into dom0.

Is it because mmap is for mapping from /proc/xen/privcmd to dom0 memory and
ioctl is for mapping from foreign memory (probably domU) into /proc/xen/privcmd?

Also, I am trying to understand how ioctl IOCTL_PRIVCMD_MMAPBATCH_V2 works,
and it is quite hard.
In function privcmd_ioctl_mmap_batch, it allocates pages in dom0 side,
and I don't understand why do we need this allocation.
If we map a page from foreign domain, just changing grant table is not enough?
Please enlighten me.

Also, I see that in function mmap_batch_fn (i.e., called with the
newly allocated pages),
xen_remap_domain_mfn_range function is called.
Could you tell me what does this function (xen_remap_domain_mfn_range)
do briefly.
It would help me understand xen more!

Best regards,

Xen-devel mailing list



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