OSDN Git Service

xen/grants: support allocating consecutive grants
authorJuergen Gross <jgross@suse.com>
Thu, 2 Jun 2022 19:23:47 +0000 (22:23 +0300)
committerJuergen Gross <jgross@suse.com>
Mon, 6 Jun 2022 06:54:35 +0000 (08:54 +0200)
commit02a9e681a3f7998074f39ec265080bf934871530
tree8cb2d7887ecc0d5a875bbebbaed870a2e45f44d7
parent9bf22421dc8a69cade3c994771637e9693ff0216
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>
drivers/xen/grant-table.c
include/xen/grant_table.h