VFIO updates for v5.12-rc1
- Virtual address update handling (Steve Sistare)
- s390/zpci fixes and cleanups (Max Gurtovoy)
- Fixes for dirty bitmap handling, non-mdev page pinning,
and improved pinned dirty scope tracking (Keqian Zhu)
- Batched page pinning enhancement (Daniel Jordan)
- Page access permission fix (Alex Williamson)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iQIcBAABAgAGBQJgNpAEAAoJECObm247sIsiDEsP/1G0QJIum3KqG0+ABHgSS7ks
j3oKeLxDl2BGeDBw2yIfinif1fjtafmUWg3Q0RlVRv0S71ccu7Ee4MfAHqy8k7Gp
BM/G+2Amnrz1qWsgEV2JGw8T2wwZDG8ZJluh0sxj2KFqI99jWKftlPH4D8TTJeDj
VrsFHzQlpcILFBh9Mj5zWFkIuqm2/70O7FJF3jhyN2b0MjYG/f390k0TLQZS+Mkr
l+6pfIZ3pHYngzro8pX56B1z3c1mJEeRChMPt7IdTVruBcGkUCMXrZKZVN2WqoOf
Otj6Mxvq5Wur8Rk9VfKs2fO/oz9FJjr5/sL4Vv7xUigWe9nDXBnoy+OR4XJUwxEf
BaB4tK8f9xTJcf8MrK+eOpBvMSx7eE0qnP/7VMtykC7Cw57qdhCuzEq7ueUGKuVw
ubj+pjHcAx6T2urjL7KdzuJUMNPkafATi8hN/Bj6oshESZuhM2lSCHiqI4ZQnh5H
TPMWpb2dX/ohRkcnQdO9N2T2+Lcg6tmD4Kqigv+75zzDj+U15Ph2owtnmH5OFJIG
BCtibsX2yk6UuxBPvl8eN0X7n41G6gwJcsD6spuaoateK6UTJugjTCZtKB96YMFQ
c4eULO+hvUIiQJkWbbpFA+mXUcLwcpEoT2pWfuj3MET0FuHVtEhbGEO609gGAAWI
GMheKjGI+GRW07JFwgCV
=ei4J
-----END PGP SIGNATURE-----
Merge tag 'vfio-v5.12-rc1' of git://github.com/awilliam/linux-vfio
Pull VFIO updatesfrom Alex Williamson:
- Virtual address update handling (Steve Sistare)
- s390/zpci fixes and cleanups (Max Gurtovoy)
- Fixes for dirty bitmap handling, non-mdev page pinning, and improved
pinned dirty scope tracking (Keqian Zhu)
- Batched page pinning enhancement (Daniel Jordan)
- Page access permission fix (Alex Williamson)
* tag 'vfio-v5.12-rc1' of git://github.com/awilliam/linux-vfio: (21 commits)
vfio/type1: Batch page pinning
vfio/type1: Prepare for batched pinning with struct vfio_batch
vfio/type1: Change success value of vaddr_get_pfn()
vfio/type1: Use follow_pte()
vfio/pci: remove CONFIG_VFIO_PCI_ZDEV from Kconfig
vfio/iommu_type1: Fix duplicate included kthread.h
vfio-pci/zdev: fix possible segmentation fault issue
vfio-pci/zdev: remove unused vdev argument
vfio/pci: Fix handling of pci use accessor return codes
vfio/iommu_type1: Mantain a counter for non_pinned_groups
vfio/iommu_type1: Fix some sanity checks in detach group
vfio/iommu_type1: Populate full dirty when detach non-pinned group
vfio/type1: block on invalid vaddr
vfio/type1: implement notify callback
vfio: iommu driver notify callback
vfio/type1: implement interfaces to update vaddr
vfio/type1: massage unmap iteration
vfio: interfaces to update vaddr
vfio/type1: implement unmap all
vfio/type1: unmap cleanup
...
This commit is contained in:
commit
719bbd4a50
10 changed files with 479 additions and 194 deletions
|
|
@ -46,6 +46,12 @@
|
|||
*/
|
||||
#define VFIO_NOIOMMU_IOMMU 8
|
||||
|
||||
/* Supports VFIO_DMA_UNMAP_FLAG_ALL */
|
||||
#define VFIO_UNMAP_ALL 9
|
||||
|
||||
/* Supports the vaddr flag for DMA map and unmap */
|
||||
#define VFIO_UPDATE_VADDR 10
|
||||
|
||||
/*
|
||||
* The IOCTL interface is designed for extensibility by embedding the
|
||||
* structure length (argsz) and flags into structures passed between
|
||||
|
|
@ -1074,12 +1080,22 @@ struct vfio_iommu_type1_info_dma_avail {
|
|||
*
|
||||
* Map process virtual addresses to IO virtual addresses using the
|
||||
* provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required.
|
||||
*
|
||||
* If flags & VFIO_DMA_MAP_FLAG_VADDR, update the base vaddr for iova, and
|
||||
* unblock translation of host virtual addresses in the iova range. The vaddr
|
||||
* must have previously been invalidated with VFIO_DMA_UNMAP_FLAG_VADDR. To
|
||||
* maintain memory consistency within the user application, the updated vaddr
|
||||
* must address the same memory object as originally mapped. Failure to do so
|
||||
* will result in user memory corruption and/or device misbehavior. iova and
|
||||
* size must match those in the original MAP_DMA call. Protection is not
|
||||
* changed, and the READ & WRITE flags must be 0.
|
||||
*/
|
||||
struct vfio_iommu_type1_dma_map {
|
||||
__u32 argsz;
|
||||
__u32 flags;
|
||||
#define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */
|
||||
#define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */
|
||||
#define VFIO_DMA_MAP_FLAG_VADDR (1 << 2)
|
||||
__u64 vaddr; /* Process virtual address */
|
||||
__u64 iova; /* IO virtual address */
|
||||
__u64 size; /* Size of mapping (bytes) */
|
||||
|
|
@ -1102,6 +1118,7 @@ struct vfio_bitmap {
|
|||
* field. No guarantee is made to the user that arbitrary unmaps of iova
|
||||
* or size different from those used in the original mapping call will
|
||||
* succeed.
|
||||
*
|
||||
* VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP should be set to get the dirty bitmap
|
||||
* before unmapping IO virtual addresses. When this flag is set, the user must
|
||||
* provide a struct vfio_bitmap in data[]. User must provide zero-allocated
|
||||
|
|
@ -1111,11 +1128,21 @@ struct vfio_bitmap {
|
|||
* indicates that the page at that offset from iova is dirty. A Bitmap of the
|
||||
* pages in the range of unmapped size is returned in the user-provided
|
||||
* vfio_bitmap.data.
|
||||
*
|
||||
* If flags & VFIO_DMA_UNMAP_FLAG_ALL, unmap all addresses. iova and size
|
||||
* must be 0. This cannot be combined with the get-dirty-bitmap flag.
|
||||
*
|
||||
* If flags & VFIO_DMA_UNMAP_FLAG_VADDR, do not unmap, but invalidate host
|
||||
* virtual addresses in the iova range. Tasks that attempt to translate an
|
||||
* iova's vaddr will block. DMA to already-mapped pages continues. This
|
||||
* cannot be combined with the get-dirty-bitmap flag.
|
||||
*/
|
||||
struct vfio_iommu_type1_dma_unmap {
|
||||
__u32 argsz;
|
||||
__u32 flags;
|
||||
#define VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP (1 << 0)
|
||||
#define VFIO_DMA_UNMAP_FLAG_ALL (1 << 1)
|
||||
#define VFIO_DMA_UNMAP_FLAG_VADDR (1 << 2)
|
||||
__u64 iova; /* IO virtual address */
|
||||
__u64 size; /* Size of mapping (bytes) */
|
||||
__u8 data[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue