diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2011-09-29 11:57:56 +0100 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-09-29 10:32:58 -0400 |
commit | 0930bba674e248b921ea659b036ff02564e5a5f4 (patch) | |
tree | 52df16f477e1e63b034ee2e28f2d5c916bb53097 /include/xen | |
parent | 693394b8c3dcee1a3baa52e30fdc3323d88cd579 (diff) | |
download | linux-0930bba674e248b921ea659b036ff02564e5a5f4.tar.gz linux-0930bba674e248b921ea659b036ff02564e5a5f4.tar.bz2 linux-0930bba674e248b921ea659b036ff02564e5a5f4.zip |
xen: modify kernel mappings corresponding to granted pages
If we want to use granted pages for AIO, changing the mappings of a user
vma and the corresponding p2m is not enough, we also need to update the
kernel mappings accordingly.
Currently this is only needed for pages that are created for user usages
through /dev/xen/gntdev. As in, pages that have been in use by the
kernel and use the P2M will not need this special mapping.
However there are no guarantees that in the future the kernel won't
start accessing pages through the 1:1 even for internal usage.
In order to avoid the complexity of dealing with highmem, we allocated
the pages lowmem.
We issue a HYPERVISOR_grant_table_op right away in
m2p_add_override and we remove the mappings using another
HYPERVISOR_grant_table_op in m2p_remove_override.
Considering that m2p_add_override and m2p_remove_override are called
once per page we use multicalls and hypercall batching.
Use the kmap_op pointer directly as argument to do the mapping as it is
guaranteed to be present up until the unmapping is done.
Before issuing any unmapping multicalls, we need to make sure that the
mapping has already being done, because we need the kmap->handle to be
set correctly.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[v1: Removed GRANT_FRAME_BIT usage]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'include/xen')
-rw-r--r-- | include/xen/grant_table.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index b1fab6b5b3ef..6b99bfbd785d 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h @@ -156,6 +156,7 @@ unsigned int gnttab_max_grant_frames(void); #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, + struct gnttab_map_grant_ref *kmap_ops, struct page **pages, unsigned int count); int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, struct page **pages, unsigned int count); |