search for: vhost_iotlb_entry

Displaying 12 results from an estimated 12 matches for "vhost_iotlb_entry".

2015 Dec 31
4
[PATCH RFC] vhost: basic device IOTLB support
...IOTLB_SIZE; i++) + dev->iotlb[i].flags.valid = VHOST_IOTLB_INVALID; } EXPORT_SYMBOL_GPL(vhost_dev_init); @@ -940,9 +956,10 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp) { struct file *eventfp, *filep = NULL; struct eventfd_ctx *ctx = NULL; + struct vhost_iotlb_entry entry; u64 p; long r; - int i, fd; + int index, i, fd; /* If you are not the owner, you can become one */ if (ioctl == VHOST_SET_OWNER) { @@ -1008,6 +1025,80 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp) if (filep) fput(filep); break; + case...
2015 Dec 31
4
[PATCH RFC] vhost: basic device IOTLB support
...IOTLB_SIZE; i++) + dev->iotlb[i].flags.valid = VHOST_IOTLB_INVALID; } EXPORT_SYMBOL_GPL(vhost_dev_init); @@ -940,9 +956,10 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp) { struct file *eventfp, *filep = NULL; struct eventfd_ctx *ctx = NULL; + struct vhost_iotlb_entry entry; u64 p; long r; - int i, fd; + int index, i, fd; /* If you are not the owner, you can become one */ if (ioctl == VHOST_SET_OWNER) { @@ -1008,6 +1025,80 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp) if (filep) fput(filep); break; + case...
2015 Dec 31
0
[PATCH RFC] vhost: basic device IOTLB support
...gs.valid = VHOST_IOTLB_INVALID; > } > EXPORT_SYMBOL_GPL(vhost_dev_init); > > @@ -940,9 +956,10 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp) > { > struct file *eventfp, *filep = NULL; > struct eventfd_ctx *ctx = NULL; > + struct vhost_iotlb_entry entry; > u64 p; > long r; > - int i, fd; > + int index, i, fd; > > /* If you are not the owner, you can become one */ > if (ioctl == VHOST_SET_OWNER) { > @@ -1008,6 +1025,80 @@ long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *argp) >...
2016 Mar 25
0
[RFC PATCH V2 2/2] vhost: device IOTLB API
...rgp) } else filep = eventfp; break; + case VHOST_SET_VRING_IOTLB_REQUEST: + r = -EFAULT; + if (copy_from_user(&e, argp, sizeof e)) + break; + if (!access_ok(VERIFY_WRITE, e.userspace_addr, + sizeof(*vq->iotlb_request))) + break; + r = 0; + vq->iotlb_request = (struct vhost_iotlb_entry __user *)e.userspace_addr; + break; + case VHOST_SET_VRING_IOTLB_CALL: + if (copy_from_user(&f, argp, sizeof f)) { + r = -EFAULT; + break; + } + eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); + if (IS_ERR(eventfp)) { + r = PTR_ERR(eventfp); + break; + } + if (eventfp != vq-&gt...
2016 Apr 27
2
[RFC PATCH V2 2/2] vhost: device IOTLB API
...> + case VHOST_SET_VRING_IOTLB_REQUEST: > + r = -EFAULT; > + if (copy_from_user(&e, argp, sizeof e)) > + break; > + if (!access_ok(VERIFY_WRITE, e.userspace_addr, > + sizeof(*vq->iotlb_request))) > + break; > + r = 0; > + vq->iotlb_request = (struct vhost_iotlb_entry __user *)e.userspace_addr; > + break; > + case VHOST_SET_VRING_IOTLB_CALL: > + if (copy_from_user(&f, argp, sizeof f)) { > + r = -EFAULT; > + break; > + } > + eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); > + if (IS_ERR(eventfp)) { > + r = PTR_ERR(event...
2016 Apr 27
2
[RFC PATCH V2 2/2] vhost: device IOTLB API
...> + case VHOST_SET_VRING_IOTLB_REQUEST: > + r = -EFAULT; > + if (copy_from_user(&e, argp, sizeof e)) > + break; > + if (!access_ok(VERIFY_WRITE, e.userspace_addr, > + sizeof(*vq->iotlb_request))) > + break; > + r = 0; > + vq->iotlb_request = (struct vhost_iotlb_entry __user *)e.userspace_addr; > + break; > + case VHOST_SET_VRING_IOTLB_CALL: > + if (copy_from_user(&f, argp, sizeof f)) { > + r = -EFAULT; > + break; > + } > + eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); > + if (IS_ERR(eventfp)) { > + r = PTR_ERR(event...
2016 Mar 25
4
[RFC PATCH V2 0/2] basic device IOTLB support
This patch tries to implement an device IOTLB for vhost. This could be used with for co-operation with userspace(qemu) implementation of iommu for a secure DMA environment (DMAR) in guest. The idea is simple. When vhost meets an IOTLB miss, it will request the assistance of userspace to do the translation, this is done through: - Fill the translation request in a preset userspace address (This
2016 Mar 25
4
[RFC PATCH V2 0/2] basic device IOTLB support
This patch tries to implement an device IOTLB for vhost. This could be used with for co-operation with userspace(qemu) implementation of iommu for a secure DMA environment (DMAR) in guest. The idea is simple. When vhost meets an IOTLB miss, it will request the assistance of userspace to do the translation, this is done through: - Fill the translation request in a preset userspace address (This
2016 Apr 28
2
[RFC PATCH V2 2/2] vhost: device IOTLB API
...+++++++++------ > >> drivers/vhost/vhost.h | 17 ++- > >> fs/eventfd.c | 3 +- > >> include/uapi/linux/vhost.h | 35 ++++++ > >> 5 files changed, 320 insertions(+), 42 deletions(-) > >> > > [...] > > >> +struct vhost_iotlb_entry { > >> + __u64 iova; > >> + __u64 size; > >> + __u64 userspace_addr; > > Alignment requirements? > > The API does not require any alignment. Will add a comment for this. > > > > >> + struct { > >> +#define VHOST_ACCESS_RO 0x1...
2016 Apr 28
2
[RFC PATCH V2 2/2] vhost: device IOTLB API
...+++++++++------ > >> drivers/vhost/vhost.h | 17 ++- > >> fs/eventfd.c | 3 +- > >> include/uapi/linux/vhost.h | 35 ++++++ > >> 5 files changed, 320 insertions(+), 42 deletions(-) > >> > > [...] > > >> +struct vhost_iotlb_entry { > >> + __u64 iova; > >> + __u64 size; > >> + __u64 userspace_addr; > > Alignment requirements? > > The API does not require any alignment. Will add a comment for this. > > > > >> + struct { > >> +#define VHOST_ACCESS_RO 0x1...
2016 Apr 28
0
[RFC PATCH V2 2/2] vhost: device IOTLB API
...t.c | 301 +++++++++++++++++++++++++++++++++++++++------ >> drivers/vhost/vhost.h | 17 ++- >> fs/eventfd.c | 3 +- >> include/uapi/linux/vhost.h | 35 ++++++ >> 5 files changed, 320 insertions(+), 42 deletions(-) >> [...] >> +struct vhost_iotlb_entry { >> + __u64 iova; >> + __u64 size; >> + __u64 userspace_addr; > Alignment requirements? The API does not require any alignment. Will add a comment for this. > >> + struct { >> +#define VHOST_ACCESS_RO 0x1 >> +#define VHOST_ACCESS_WO 0x2 >&gt...
2016 Apr 29
0
[RFC PATCH V2 2/2] vhost: device IOTLB API
...;>>> drivers/vhost/vhost.h | 17 ++- >>>> fs/eventfd.c | 3 +- >>>> include/uapi/linux/vhost.h | 35 ++++++ >>>> 5 files changed, 320 insertions(+), 42 deletions(-) >>>> >> [...] >> >>>> +struct vhost_iotlb_entry { >>>> + __u64 iova; >>>> + __u64 size; >>>> + __u64 userspace_addr; >>> Alignment requirements? >> The API does not require any alignment. Will add a comment for this. >> >>>> + struct { >>>> +#define VHOST_ACCESS_RO...