s390x/pci: Add routine to get the vfio dma available count

Create new files for separating out vfio-specific work for s390
pci. Add the first such routine, which issues VFIO_IOMMU_GET_INFO
ioctl to collect the current dma available count.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
[aw: Fix non-Linux build with CONFIG_LINUX]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
Matthew Rosato 2020-10-26 11:34:34 -04:00 committed by Alex Williamson
parent 7486a62845
commit cd7498d07f
3 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,24 @@
/*
* s390 vfio-pci interfaces
*
* Copyright 2020 IBM Corp.
* Author(s): Matthew Rosato <mjrosato@linux.ibm.com>
*
* This work is licensed under the terms of the GNU GPL, version 2 or (at
* your option) any later version. See the COPYING file in the top-level
* directory.
*/
#ifndef HW_S390_PCI_VFIO_H
#define HW_S390_PCI_VFIO_H
#ifdef CONFIG_LINUX
bool s390_pci_update_dma_avail(int fd, unsigned int *avail);
#else
static inline bool s390_pci_update_dma_avail(int fd, unsigned int *avail)
{
return false;
}
#endif
#endif