From: "Roger Pau Monné" <roger.pau@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: dcrisan@flexiant.com, xen-devel@lists.xensource.com,
Ian.Campbell@citrix.com, alex@alex.org.uk,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v2 2/2] xen/m2p: use GNTTABOP_unmap_and_replace to reinstate the original mapping
Date: Tue, 23 Jul 2013 12:35:51 +0200 [thread overview]
Message-ID: <51EE5C87.90406@citrix.com> (raw)
In-Reply-To: <51ED65B5.1090705@citrix.com>
On 22/07/13 19:02, David Vrabel wrote:
> On 22/07/13 17:28, 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 trade pages, so we can be sure that
>> it's not going to be accessed while the mapping is not valid.
>
> This solves the problem of userspace accessing a disk image on an NFS
> mount but what would blkback talking to an iSCSI LUN? Will that need
> similar fixes to blkback? This series does not need to fix this now though.
I have not played much with iSCSI and blkback, but I guess the same
issue exists there, the only difference is that we don't perform the
grant mappings with GNTMAP_contains_pte, so less modifications are required.
Maybe the unmap and reinstate of the trade page address could be placed
somewhere more generic, so that I don't have to also code the multicall
in blkback? Adding a proper unmap and replace op that reinstates the
trade page address to grant-table.c does seem like the more logical
option IMHO. (I can do that after this patch is committed).
next prev parent reply other threads:[~2013-07-23 10:35 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 16:21 [PATCH v2 0/2] make ballooned out pages have a valid mapping at all times Stefano Stabellini
2013-07-22 16:28 ` [PATCH v2 1/2] xen/balloon: set a mapping for ballooned out pages Stefano Stabellini
2013-07-22 16:51 ` David Vrabel
2013-07-22 17:22 ` Ian Campbell
2013-07-22 17:26 ` David Vrabel
2013-07-22 17:32 ` Ian Campbell
2013-07-23 9:58 ` David Vrabel
2013-07-23 14:27 ` Ian Campbell
2013-07-23 15:03 ` David Vrabel
2013-07-23 17:04 ` Ian Campbell
2013-07-23 17:20 ` Stefano Stabellini
2013-07-23 17:33 ` David Vrabel
2013-07-23 12:49 ` Stefano Stabellini
2013-07-23 14:24 ` Ian Campbell
2013-07-23 13:58 ` Konrad Rzeszutek Wilk
2013-07-22 16:28 ` [PATCH v2 2/2] xen/m2p: use GNTTABOP_unmap_and_replace to reinstate the original mapping Stefano Stabellini
2013-07-22 17:02 ` David Vrabel
2013-07-23 10:35 ` Roger Pau Monné [this message]
2013-07-23 12:37 ` Stefano Stabellini
2013-07-23 12:47 ` Stefano Stabellini
2013-07-23 13:57 ` Konrad Rzeszutek Wilk
2013-07-23 14:23 ` Ian Campbell
2013-07-23 14:48 ` Alex Bligh
2013-07-23 14:51 ` Ian Campbell
2013-07-23 15:06 ` Alex Bligh
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=51EE5C87.90406@citrix.com \
--to=roger.pau@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=alex@alex.org.uk \
--cc=david.vrabel@citrix.com \
--cc=dcrisan@flexiant.com \
--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 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).