[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 2/2] xen/m2p: use GNTTABOP_unmap_and_replace to reinstate the original mapping



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).


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.