Stefano Stabellini ee0726407f xen/m2p: use GNTTABOP_unmap_and_replace to reinstate the original mapping
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.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: alex@alex.org.uk
CC: dcrisan@flexiant.com

[v1: Konrad fixed up the conflicts]
Conflicts:
	arch/x86/xen/p2m.c
2013-08-20 10:25:35 -04:00
..
2013-07-31 11:37:43 -07:00
2013-06-28 11:19:58 -04:00
2013-08-20 10:23:09 -04:00
2013-06-28 11:19:58 -04:00
2013-07-29 09:35:11 -04:00
2013-06-28 11:19:58 -04:00
2013-06-28 11:19:58 -04:00
2013-06-28 11:19:58 -04:00
2011-12-16 13:29:31 -05:00
2013-07-03 13:12:42 -07:00
2013-06-28 11:19:58 -04:00