All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 1/2] xen-gntdev: support mapping in HVM domains
Date: Wed, 08 Dec 2010 13:15:10 -0500	[thread overview]
Message-ID: <4CFFCB2E.5080309@tycho.nsa.gov> (raw)
In-Reply-To: <1291826417.13966.4576.camel@zakaz.uk.xensource.com>

On 12/08/2010 11:40 AM, Ian Campbell wrote:
> Hi Daniel,
> 
> On Fri, 2010-12-03 at 15:37 +0000, Daniel De Graaf wrote:
>> This changes the /dev/xen/gntdev device to work in HVM domains, and
>> also makes the mmap() behavior more closely match the behavior of
>> files instead of requiring an ioctl() call for each mmap/munmap.
> 
> This patch seems to contain a lot more than the above very brief
> description would suggest. As well as those two changes it looks to
> include various refactoring and code-motion, some clean up and other
> changes.

Sorry about that, I should have made a better effort to explain the reason
for the refactoring in the patch comment.

In the old gntdev device, a hypercall was made to adjust the actual page
tables of the userspace process according to the mapping set up in the
previous ioctl(). This direct page table manipulation does not work in HVM,
because the page tables refer to guest-physical addresses. The solution is
to not use the GNTMAP_contains_pte flag when making the hypercall, and instead
use guest-physical address space to contain the mapping.

Due to this change, the mmap() call is no longer the best place to do the
mapping; the eventual userspace address does not matter and the cleanup is
handled differently. This is most of the refactoring, elimination of MMU
notifier dependency, and the patch for this is probably going to be large
no matter what I do in order to keep it working before and after.

> Please can you also go into more detail in the relevant patch on the new
> ioctl/mmap semantics rather than just mentioning that you've changed
> them. Do you retain compatibility with the old behaviour? Is there a
> corresponding toolstack change which makes use of this functionality?

The change is fully backwards compatible, so the current Xen toolchain will
work with the changed API. I have a test program that uses the new ioctl, which
I could include if it would be useful; the modifications to the vchan library
that use the new ioctl() are not yet finished. The other mentioned changes
in mmap() aren't used in any code I have; they are just limitations caused by
direct PTE manipulation that no longer apply.

> The change to support HVM and the change in mmap/ioctl behaviour should
> certainly be separate patches but there seems to also be a some data
> structure refactoring going on, a change from using the mmu notifiers to
> something else, some sort of lazy mapping functionality etc these should
> all get their own individual patches with a changelog describing what
> they do and why.

I will try to strip down the patch to only support the old ioctl() API,
and then introduce the new call in another patch; same for the semantic
change in limit tracking. That will make it easier to evaluate changes that
are visible from userspace. The data structure changes, mmu notifier
elimination, and a large part of the refactoring can't be split up because
of the change from PTE to guest-physical remapping.

> Thanks,
> Ian.
> 

-- 
Daniel De Graaf
National Security Agency

  reply	other threads:[~2010-12-08 18:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03 15:36 [PATCH 0/2] Userspace grant communication Daniel De Graaf
2010-12-03 15:37 ` [PATCH 1/2] xen-gntdev: support mapping in HVM domains Daniel De Graaf
2010-12-08 16:40   ` Ian Campbell
2010-12-08 18:15     ` Daniel De Graaf [this message]
2010-12-03 15:38 ` [PATCH 2/2] xen-gntalloc: Userspace grant allocation driver Daniel De Graaf
2010-12-08 16:47   ` Ian Campbell
2010-12-08 18:15     ` Daniel De Graaf
2010-12-08 20:17       ` Daniel De Graaf
2010-12-09  1:14     ` Eamon Walsh
2010-12-03 16:30 ` [PATCH 0/2] Userspace grant communication Pasi Kärkkäinen
2010-12-03 18:27   ` Daniel De Graaf
2010-12-03 18:39     ` [PATCH 0/2] Userspace grant communication / XenClient (XCI) inter-domain communication Pasi Kärkkäinen
2010-12-04 19:54       ` Ian Pratt
2010-12-04 20:32         ` Pasi Kärkkäinen
2010-12-04 21:50         ` Vasiliy G Tolstov
2010-12-04 22:04           ` Ross Philipson
2010-12-07  0:30           ` Ian Pratt

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=4CFFCB2E.5080309@tycho.nsa.gov \
    --to=dgdegra@tycho.nsa.gov \
    --cc=Ian.Campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.