]> git.baikalelectronics.ru Git - kernel.git/commit
vfio/type1: Prepare for batched pinning with struct vfio_batch
authorDaniel Jordan <daniel.m.jordan@oracle.com>
Fri, 19 Feb 2021 16:13:04 +0000 (11:13 -0500)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 22 Feb 2021 23:30:45 +0000 (16:30 -0700)
commit9f2f557301d2f6430c0ea6dcff311e4f1be2848d
tree82bf0d6ab4a9899bb5293ae4067a675f9e2740f9
parent6afce1cda78d411bd0f5477c6d9a6b5bd8498d66
vfio/type1: Prepare for batched pinning with struct vfio_batch

Get ready to pin more pages at once with struct vfio_batch, which
represents a batch of pinned pages.

The struct has a fallback page pointer to avoid two unlikely scenarios:
pointlessly allocating a page if disable_hugepages is enabled or failing
the whole pinning operation if the kernel can't allocate memory.

vaddr_get_pfn() becomes vaddr_get_pfns() to prepare for handling
multiple pages, though for now only one page is stored in the pages
array.

Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_iommu_type1.c