]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen/grant: Add helper gnttab_page_grant_foreign_access_ref_one
authorJulien Grall <julien.grall@citrix.com>
Fri, 19 Jun 2015 17:05:06 +0000 (18:05 +0100)
committerJoao Martins <joao.m.martins@oracle.com>
Sun, 27 Mar 2016 01:01:06 +0000 (02:01 +0100)
commit91d952247bc09eb74fbdf0de7de273f55ef924c8
tree4cbfe1488bc570e39bfc6d4b276d58f5700af699
parenta2c94220e118502c315c5600715f1043d56187a0
xen/grant: Add helper gnttab_page_grant_foreign_access_ref_one

Many PV drivers contain the idiom:

pfn = page_to_gfn(...) /* Or similar */
gnttab_grant_foreign_access_ref

Replace it by a new helper. Note that when Linux is using a different
page granularity than Xen, the helper only gives access to the first 4KB
grant.

This is useful where drivers are allocating a full Linux page for each
grant.

Also include xen/interface/grant_table.h rather than xen/grant_table.h in
asm/page.h for x86 to fix a compilation issue [1]. Only the former is
useful in order to get the structure definition.

[1] Interdependency between asm/page.h and xen/grant_table.h which result
to page_mfn not being defined when necessary.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
(cherry picked from commit 3922f32c1e6db2e096ff095a5b8af0b940b97508)
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
include/xen/grant_table.h