mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-06-29 23:43:21 -04:00
vduse: Support registering userspace memory for IOVA regions
Introduce two ioctls: VDUSE_IOTLB_REG_UMEM and VDUSE_IOTLB_DEREG_UMEM to support registering and de-registering userspace memory for IOVA regions. Now it only supports registering userspace memory for bounce buffer region in virtio-vdpa case. Signed-off-by: Xie Yongji <xieyongji@bytedance.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20220803045523.23851-5-xieyongji@bytedance.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
6c77ed2288
commit
79a463be9e
2 changed files with 164 additions and 0 deletions
|
@ -210,6 +210,29 @@ struct vduse_vq_eventfd {
|
|||
*/
|
||||
#define VDUSE_VQ_INJECT_IRQ _IOW(VDUSE_BASE, 0x17, __u32)
|
||||
|
||||
/**
|
||||
* struct vduse_iova_umem - userspace memory configuration for one IOVA region
|
||||
* @uaddr: start address of userspace memory, it must be aligned to page size
|
||||
* @iova: start of the IOVA region
|
||||
* @size: size of the IOVA region
|
||||
* @reserved: for future use, needs to be initialized to zero
|
||||
*
|
||||
* Structure used by VDUSE_IOTLB_REG_UMEM and VDUSE_IOTLB_DEREG_UMEM
|
||||
* ioctls to register/de-register userspace memory for IOVA regions
|
||||
*/
|
||||
struct vduse_iova_umem {
|
||||
__u64 uaddr;
|
||||
__u64 iova;
|
||||
__u64 size;
|
||||
__u64 reserved[3];
|
||||
};
|
||||
|
||||
/* Register userspace memory for IOVA regions */
|
||||
#define VDUSE_IOTLB_REG_UMEM _IOW(VDUSE_BASE, 0x18, struct vduse_iova_umem)
|
||||
|
||||
/* De-register the userspace memory. Caller should set iova and size field. */
|
||||
#define VDUSE_IOTLB_DEREG_UMEM _IOW(VDUSE_BASE, 0x19, struct vduse_iova_umem)
|
||||
|
||||
/* The control messages definition for read(2)/write(2) on /dev/vduse/$NAME */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue