summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2022-06-02 21:23:47 +0200
committerJuergen Gross <jgross@suse.com>2022-06-06 08:54:35 +0200
commit02a9e681a3f7998074f39ec265080bf934871530 (patch)
tree8cb2d7887ecc0d5a875bbebbaed870a2e45f44d7 /include
parentarm/xen: Introduce xen_setup_dma_ops() (diff)
downloadlinux-02a9e681a3f7998074f39ec265080bf934871530.tar.xz
linux-02a9e681a3f7998074f39ec265080bf934871530.zip
xen/grants: support allocating consecutive grants
For support of virtio via grant mappings in rare cases larger mappings using consecutive grants are needed. Support those by adding a bitmap of free grants. As consecutive grants will be needed only in very rare cases (e.g. when configuring a virtio device with a multi-page ring), optimize for the normal case of non-consecutive allocations. Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Link: https://lore.kernel.org/r/1654197833-25362-3-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'include')
-rw-r--r--include/xen/grant_table.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
index 527c9907f99c..e279be353e3f 100644
--- a/include/xen/grant_table.h
+++ b/include/xen/grant_table.h
@@ -127,10 +127,14 @@ int gnttab_try_end_foreign_access(grant_ref_t ref);
*/
int gnttab_alloc_grant_references(u16 count, grant_ref_t *pprivate_head);
+int gnttab_alloc_grant_reference_seq(unsigned int count, grant_ref_t *first);
+
void gnttab_free_grant_reference(grant_ref_t ref);
void gnttab_free_grant_references(grant_ref_t head);
+void gnttab_free_grant_reference_seq(grant_ref_t head, unsigned int count);
+
int gnttab_empty_grant_references(const grant_ref_t *pprivate_head);
int gnttab_claim_grant_reference(grant_ref_t *pprivate_head);