All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
	dcrisan@flexiant.com, alex@alex.org.uk, ian.campbell@citrix.com
Subject: Re: [PATCH v4 2/2] xen/m2p: use GNTTABOP_unmap_and_replace to reinstate the original mapping
Date: Tue, 13 Aug 2013 09:11:31 -0400	[thread overview]
Message-ID: <20130813131131.GA6359@phenom.dumpdata.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1308131212040.4893@kaball.uk.xensource.com>

On Tue, Aug 13, 2013 at 12:17:18PM +0100, Stefano Stabellini wrote:
> On Fri, 9 Aug 2013, Konrad Rzeszutek Wilk wrote:
> > On Sun, Aug 04, 2013 at 03:39:41PM +0100, Stefano Stabellini wrote:
> > > GNTTABOP_unmap_grant_ref unmaps a grant and replaces it with a 0
> > > mapping instead of reinstating the original mapping.
> > > Doing so separately would be racy.
> > > 
> > > To unmap a grant and reinstate the original mapping atomically we use
> > > GNTTABOP_unmap_and_replace.
> > > GNTTABOP_unmap_and_replace doesn't work with GNTMAP_contains_pte, so
> > > don't use it for kmaps.  GNTTABOP_unmap_and_replace zeroes the mapping
> > > passed in new_addr so we have to reinstate it, however that is a
> > > per-cpu mapping only used for balloon scratch pages, so we can be sure that
> > > it's not going to be accessed while the mapping is not valid.
> > 
> > This looks to be depend on a new structure, which is not in Linux kernel?
> > Are you missing a dependency patch?
> 
> Nope, GNTTABOP_unmap_and_replace and struct gnttab_unmap_and_replace are
> already present in include/xen/interface/grant_table.h.
> 
> 
> > Shouldn't we use some logic to figure out which hypercall to use if the
> > hypervisor does not support it?
> 
> GNTTABOP_unmap_and_replace is not a new hypercall, it has been supported
> by Xen for a very long time.
> 
> In a previous iteration of this patch series, I did introduce a new
> hypercall, but then I dropped it because I figured out that I could
> achieve the same thing with the existing hypercall.

OK, Please tack on:

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

P.S.
If you could stick it on devel/for-linus-3.12 that would be super. Thanks!

  reply	other threads:[~2013-08-13 13:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-04 14:38 [PATCH v4 0/2] make ballooned out pages have a valid mapping at all times Stefano Stabellini
2013-08-04 14:39 ` [PATCH v4 1/2] xen/balloon: set a mapping for ballooned out pages Stefano Stabellini
2013-08-04 14:39   ` Stefano Stabellini
2013-08-04 14:39 ` [PATCH v4 2/2] xen/m2p: use GNTTABOP_unmap_and_replace to reinstate the original mapping Stefano Stabellini
2013-08-04 14:39   ` Stefano Stabellini
2013-08-09 15:26   ` Konrad Rzeszutek Wilk
2013-08-13 11:17     ` Stefano Stabellini
2013-08-13 11:17       ` Stefano Stabellini
2013-08-13 13:11       ` Konrad Rzeszutek Wilk [this message]
2013-08-13 15:38         ` Stefano Stabellini
2013-08-13 15:38           ` Stefano Stabellini
2013-08-05 14:53 ` [PATCH v4 0/2] make ballooned out pages have a valid mapping at all times David Vrabel

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=20130813131131.GA6359@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=alex@alex.org.uk \
    --cc=dcrisan@flexiant.com \
    --cc=ian.campbell@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefano.stabellini@eu.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.