xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: jeremy@goop.org, xen-devel@lists.xensource.com, Ian.Campbell@citrix.com
Subject: Re: [PATCH 4/6] xen-gntdev: Support mapping in HVM domains
Date: Mon, 14 Feb 2011 13:52:33 -0500	[thread overview]
Message-ID: <20110214185233.GB11121@dumpdata.com> (raw)
In-Reply-To: <4D5969AE.6030200@tycho.nsa.gov>

On Mon, Feb 14, 2011 at 12:43:10PM -0500, Daniel De Graaf wrote:
> On 02/14/2011 10:51 AM, Konrad Rzeszutek Wilk wrote:
> >> +static int unmap_grant_pages(struct grant_map *map, int offset, int pages);
> >> +
> >>  /* ------------------------------------------------------------------ */
> >>  
> >>  static void gntdev_print_maps(struct gntdev_priv *priv,
> >> @@ -179,11 +184,34 @@ static void gntdev_put_map(struct grant_map *map)
> >>  
> >>  	atomic_sub(map->count, &pages_mapped);
> >>  
> >> -	if (map->pages)
> >> +	if (map->pages) {
> >> +		if (!use_ptemod)
> >> +			unmap_grant_pages(map, 0, map->count);
> > 
> > In the past (before this patch) the unmap_grant_pages would be called
> > on the .ioctl, .release, and .close (on VMA). This adds it now also
> > on the mmu_notifier_ops paths. Why?
> > 
> This does not actually add the unmap on the mmu_notifier path. The MMU

Duh, you are right. I misread my notes. I meant that in the past the
.ioctl, .release, and .close would just do gntdev_put_map, but now they
are also calling the unmap_grant_pages (on the HVM path).

> notifier is used only if use_ptemod is true, and unmap_grant_pages is
> only called when use_ptemod is false.

.. and that would explain it - you need to call it on, and the MMU notifier
is unavailable for you on HVM case.

Not exactly sure why that wasn't clear before.

> 
> The HVM path for map and unmap is slightly different: HVM keeps the pages
> mapped until the area is deleted, while the PV case (use_ptemod being true)
> must unmap them when userspace unmaps the range. In the normal use case,
> this makes no difference to users since unmap time is deletion time.

<nods> Let me augment the path description to contain this.

> 
> -- 
> Daniel De Graaf
> National Security Agency

  reply	other threads:[~2011-02-14 18:52 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 17:18 [PATCH v6] Userspace grant communication Daniel De Graaf
2011-02-03 17:18 ` [PATCH 1/6] xen-gntdev: Change page limit to be global instead of per-open Daniel De Graaf
2011-02-03 17:19 ` [PATCH 2/6] xen-gntdev: Use find_vma rather than iterating our vma list manually Daniel De Graaf
2011-02-03 17:19 ` [PATCH 3/6] xen-gntdev: Add reference counting to maps Daniel De Graaf
2011-02-03 17:19 ` [PATCH 4/6] xen-gntdev: Support mapping in HVM domains Daniel De Graaf
2011-02-14 15:51   ` Konrad Rzeszutek Wilk
2011-02-14 17:43     ` Daniel De Graaf
2011-02-14 18:52       ` Konrad Rzeszutek Wilk [this message]
2011-02-03 17:19 ` [PATCH 5/6] xen-gntalloc: Userspace grant allocation driver Daniel De Graaf
2011-02-08 22:48   ` Konrad Rzeszutek Wilk
2011-02-09 18:52     ` Daniel De Graaf
2011-02-03 17:19 ` [PATCH 6/6] xen/gntalloc, gntdev: Add unmap notify ioctl Daniel De Graaf
2011-02-14 15:37   ` Konrad Rzeszutek Wilk
2011-02-14 18:07     ` Daniel De Graaf
2011-02-03 19:16 ` [PATCH] xen-gntdev: Fix memory leak when mmap fails Daniel De Graaf
2011-02-07 23:14 ` [PATCH v6] Userspace grant communication Konrad Rzeszutek Wilk
2011-02-08 14:14   ` [PATCH] xen-gntdev: Fix unmap notify on PV domains Daniel De Graaf
2011-02-08 22:58     ` Konrad Rzeszutek Wilk
2011-02-09 20:33       ` [PATCH] xen-gntdev: prevent using UNMAP_NOTIFY_CLEAR_BYTE on read-only mappings Daniel De Graaf
2011-02-09 21:09         ` [PATCH v2] " Daniel De Graaf
2011-02-09 22:22         ` [PATCH] " Jeremy Fitzhardinge
2011-02-09 23:11           ` Daniel De Graaf
2011-02-09 23:15           ` [PATCH v3] " Daniel De Graaf
2011-02-08 21:49   ` [PATCH v6] Userspace grant communication Konrad Rzeszutek Wilk
2011-02-09 20:11     ` [PATCH] xen-gntdev: Use map->vma for checking map validity Daniel De Graaf
2011-02-09 20:12     ` [PATCH] xen-gntdev: Avoid unmapping ranges twice Daniel De Graaf
2011-02-09 21:11 ` [PATCH] xen-gntdev: Avoid double-mapping memory Daniel De Graaf
2011-02-14 16:14 ` [PATCH v6] Userspace grant communication Konrad Rzeszutek Wilk
2011-02-14 16:38   ` Konrad Rzeszutek Wilk
2011-02-14 17:56     ` Daniel De Graaf
2011-02-14 19:21       ` Konrad Rzeszutek Wilk
2011-02-14 20:55         ` Daniel De Graaf
2011-02-14 17:55   ` Daniel De Graaf
2011-02-14 19:04     ` Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2011-01-21 15:59 [SPAM] [PATCH v5] " Daniel De Graaf
2011-01-21 15:59 ` [PATCH 4/6] xen-gntdev: Support mapping in HVM domains Daniel De Graaf
2011-01-27 18:52   ` Konrad Rzeszutek Wilk
2011-01-27 19:26     ` Daniel De Graaf
2011-03-04 15:57     ` Ian Campbell
2011-03-04 16:34       ` Daniel De Graaf

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=20110214185233.GB11121@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=jeremy@goop.org \
    --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 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).