xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Sengul Thomas <thomas.sengul@gmail.com>
To: Xen Devel <xen-devel@lists.xen.org>
Subject: question regarding foreign memory mapping in xen
Date: Mon, 27 May 2013 22:06:13 +0900	[thread overview]
Message-ID: <CAJWjLtrnznCtgFiN3fuM5JuLZGhGTrnRLSW56Bmpv8zaZqDM-A@mail.gmail.com> (raw)

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,
Thomas

             reply	other threads:[~2013-05-27 13:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-27 13:06 Sengul Thomas [this message]
2013-05-27 13:17 ` question regarding foreign memory mapping in xen Andrew Cooper
2013-05-28 10:20 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJWjLtrnznCtgFiN3fuM5JuLZGhGTrnRLSW56Bmpv8zaZqDM-A@mail.gmail.com \
    --to=thomas.sengul@gmail.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).