diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-02-15 13:32:21 +0000 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-02-15 13:32:21 +0000 |
commit | 650ae1580c48498693513fa04df56a4b97bb5539 (patch) | |
tree | 527d4dae90fb3543caf67deaca4d97aa167cc557 /xen/include/asm-arm/grant_table.h | |
parent | 096578b4e489f87e2a66b213108d511d15b4d9be (diff) | |
download | xen-650ae1580c48498693513fa04df56a4b97bb5539.tar.gz xen-650ae1580c48498693513fa04df56a4b97bb5539.tar.bz2 xen-650ae1580c48498693513fa04df56a4b97bb5539.zip |
xen/arm: implement gnttab_create_shared_page and gnttab_shared_gmfn
Introduce a simple pfn array, grant_table_gpfn, to keep track of the
grant table pages mapped in guest gpfn space.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen/include/asm-arm/grant_table.h')
-rw-r--r-- | xen/include/asm-arm/grant_table.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h index e49aa8d115..3fa270d859 100644 --- a/xen/include/asm-arm/grant_table.h +++ b/xen/include/asm-arm/grant_table.h @@ -15,8 +15,6 @@ int replace_grant_host_mapping(unsigned long gpaddr, unsigned long mfn, unsigned long new_gpaddr, unsigned int flags); void gnttab_mark_dirty(struct domain *d, unsigned long l); #define gnttab_create_status_page(d, t, i) do {} while (0) -#define gnttab_create_shared_page(d, t, i) do {} while (0) -#define gnttab_shared_gmfn(d, t, i) (0) #define gnttab_status_gmfn(d, t, i) (0) #define gnttab_release_host_mappings(domain) 1 static inline int replace_grant_supported(void) @@ -24,6 +22,17 @@ static inline int replace_grant_supported(void) return 1; } +#define gnttab_create_shared_page(d, t, i) \ + do { \ + share_xen_page_with_guest( \ + virt_to_page((char *)(t)->shared_raw[i]), \ + (d), XENSHARE_writable); \ + } while ( 0 ) + +#define gnttab_shared_gmfn(d, t, i) \ + ( ((i >= nr_grant_frames(d->grant_table)) && \ + (i < max_nr_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i])) + #endif /* __ASM_GRANT_TABLE_H__ */ /* * Local variables: |