diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-05-30 10:45:44 +0100 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-05-30 10:45:44 +0100 |
commit | 38d075a82c6ebbe0ae4a3c185f94164aecdc9ba3 (patch) | |
tree | d5ba3de912e3f0971eae7af43c890ab2cf38e8bc /xen/common/compat | |
parent | 4cd3453855a742cb67e36a86f0938f508de656f5 (diff) | |
download | xen-38d075a82c6ebbe0ae4a3c185f94164aecdc9ba3.tar.gz xen-38d075a82c6ebbe0ae4a3c185f94164aecdc9ba3.tar.bz2 xen-38d075a82c6ebbe0ae4a3c185f94164aecdc9ba3.zip |
[XEN] gnttab: Add new op unmap_and_replace
The operation unmap_and_replace is an extension of unmap_grant_ref.
A new argument in the form of a virtual address (for PV) is given.
Instead of modifying the PTE for the mapped grant table entry to
null, we change it to the PTE for the new address. In turn we
point the new address to null.
As it stands grant table entries once mapped cannot be
remapped by the guest OS (it can however perform a new
mapping on the same entry but that is within our control).
Therefore it's safe to manipulate the mapped PTE entry to
redirect it to a normal page where we've copied the contents.
It's intended to be used as follows:
1) map_grant_ref to v1
2) ...
3) alloc page at v2
4) copy the page at v1 to v2
5) unmap_and_replace v1 with v2
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Added compat integration (PAE-on-64).
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common/compat')
-rw-r--r-- | xen/common/compat/grant_table.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c index aea0bfe78e..342e35622d 100644 --- a/xen/common/compat/grant_table.c +++ b/xen/common/compat/grant_table.c @@ -17,6 +17,10 @@ CHECK_gnttab_map_grant_ref; CHECK_gnttab_unmap_grant_ref; #undef xen_gnttab_unmap_grant_ref +#define xen_gnttab_unmap_and_replace gnttab_unmap_and_replace +CHECK_gnttab_unmap_and_replace; +#undef xen_gnttab_unmap_and_replace + DEFINE_XEN_GUEST_HANDLE(gnttab_setup_table_compat_t); DEFINE_XEN_GUEST_HANDLE(gnttab_transfer_compat_t); DEFINE_XEN_GUEST_HANDLE(gnttab_copy_compat_t); @@ -50,6 +54,10 @@ int compat_grant_table_op(unsigned int cmd, CASE(unmap_grant_ref); #endif +#ifndef CHECK_gnttab_unmap_and_replace + CASE(unmap_and_replace); +#endif + #ifndef CHECK_gnttab_setup_table CASE(setup_table); #endif |