Displaying 20 results from an estimated 87 matches for "desc_user_addr".
2009 Nov 22
1
[PATCH] vhost: Fix warnings and bad type handling
...ivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -322,6 +322,8 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
r = -EOPNOTSUPP;
break;
}
+ /* For 32bit, verify that the top 32bits of the user
+ data are set to zero. */
if ((u64)(unsigned long)a.desc_user_addr != a.desc_user_addr ||
(u64)(unsigned long)a.used_user_addr != a.used_user_addr ||
(u64)(unsigned long)a.avail_user_addr != a.avail_user_addr) {
@@ -334,7 +336,8 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
r = -EINVAL;
break;
}
- r = i...
2009 Nov 22
1
[PATCH] vhost: Fix warnings and bad type handling
...ivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -322,6 +322,8 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
r = -EOPNOTSUPP;
break;
}
+ /* For 32bit, verify that the top 32bits of the user
+ data are set to zero. */
if ((u64)(unsigned long)a.desc_user_addr != a.desc_user_addr ||
(u64)(unsigned long)a.used_user_addr != a.used_user_addr ||
(u64)(unsigned long)a.avail_user_addr != a.avail_user_addr) {
@@ -334,7 +336,8 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
r = -EINVAL;
break;
}
- r = i...
2019 Apr 23
7
[RFC PATCH V3 0/6] vhost: accelerate metadata access
This series tries to access virtqueue metadata through kernel virtual
address instead of copy_user() friends since they had too much
overheads like checks, spec barriers or even hardware feature
toggling. This is done through setup kernel address through direct
mapping and co-opreate VM management with MMU notifiers.
Test shows about 23% improvement on TX PPS. TCP_STREAM doesn't see
obvious
2019 May 24
10
[PATCH net-next 0/6] vhost: accelerate metadata access
Hi:
This series tries to access virtqueue metadata through kernel virtual
address instead of copy_user() friends since they had too much
overheads like checks, spec barriers or even hardware feature
toggling like SMAP. This is done through setup kernel address through
direct mapping and co-opreate VM management with MMU notifiers.
Test shows about 23% improvement on TX PPS. TCP_STREAM
2019 May 24
10
[PATCH net-next 0/6] vhost: accelerate metadata access
Hi:
This series tries to access virtqueue metadata through kernel virtual
address instead of copy_user() friends since they had too much
overheads like checks, spec barriers or even hardware feature
toggling like SMAP. This is done through setup kernel address through
direct mapping and co-opreate VM management with MMU notifiers.
Test shows about 23% improvement on TX PPS. TCP_STREAM
2010 May 18
2
[PATCH] vhost-net: utilize PUBLISH_USED_IDX feature
...ost_dev *d, int ioctl, void __user *argp)
* If it is not, we don't as size might not have been setup.
* We will verify when backend is configured. */
if (vq->private_data) {
- if (!vq_access_ok(vq->num,
+ if (!vq_access_ok(d, vq->num,
(void __user *)(unsigned long)a.desc_user_addr,
(void __user *)(unsigned long)a.avail_user_addr,
(void __user *)(unsigned long)a.used_user_addr)) {
@@ -473,6 +474,7 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
vq->log_used = !!(a.flags & (0x1 << VHOST_VRING_F_LOG));
vq->desc =...
2010 May 18
2
[PATCH] vhost-net: utilize PUBLISH_USED_IDX feature
...ost_dev *d, int ioctl, void __user *argp)
* If it is not, we don't as size might not have been setup.
* We will verify when backend is configured. */
if (vq->private_data) {
- if (!vq_access_ok(vq->num,
+ if (!vq_access_ok(d, vq->num,
(void __user *)(unsigned long)a.desc_user_addr,
(void __user *)(unsigned long)a.avail_user_addr,
(void __user *)(unsigned long)a.used_user_addr)) {
@@ -473,6 +474,7 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
vq->log_used = !!(a.flags & (0x1 << VHOST_VRING_F_LOG));
vq->desc =...
2011 Jun 16
1
[PATCH] vhost: set dirty log when updating flags of used ring
...;
+ int r;
+ vq->used = used;
+ r = vhost_update_used_flags(vq);
if (r)
return r;
return get_user(vq->last_used_idx, &used->idx);
@@ -700,7 +702,6 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
vq->desc = (void __user *)(unsigned long)a.desc_user_addr;
vq->avail = (void __user *)(unsigned long)a.avail_user_addr;
vq->log_addr = a.log_guest_addr;
- vq->used = (void __user *)(unsigned long)a.used_user_addr;
break;
case VHOST_SET_VRING_KICK:
if (copy_from_user(&f, argp, sizeof f)) {
@@ -1375,6 +1376,23 @@ void vhost_add_u...
2011 Jun 16
1
[PATCH] vhost: set dirty log when updating flags of used ring
...;
+ int r;
+ vq->used = used;
+ r = vhost_update_used_flags(vq);
if (r)
return r;
return get_user(vq->last_used_idx, &used->idx);
@@ -700,7 +702,6 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
vq->desc = (void __user *)(unsigned long)a.desc_user_addr;
vq->avail = (void __user *)(unsigned long)a.avail_user_addr;
vq->log_addr = a.log_guest_addr;
- vq->used = (void __user *)(unsigned long)a.used_user_addr;
break;
case VHOST_SET_VRING_KICK:
if (copy_from_user(&f, argp, sizeof f)) {
@@ -1375,6 +1376,23 @@ void vhost_add_u...
2010 May 18
2
[PATCHv2] vhost-net: utilize PUBLISH_USED_IDX feature
...ost_dev *d, int ioctl, void __user *argp)
* If it is not, we don't as size might not have been setup.
* We will verify when backend is configured. */
if (vq->private_data) {
- if (!vq_access_ok(vq->num,
+ if (!vq_access_ok(d, vq->num,
(void __user *)(unsigned long)a.desc_user_addr,
(void __user *)(unsigned long)a.avail_user_addr,
(void __user *)(unsigned long)a.used_user_addr)) {
@@ -473,6 +474,7 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
vq->log_used = !!(a.flags & (0x1 << VHOST_VRING_F_LOG));
vq->desc =...
2010 May 18
2
[PATCHv2] vhost-net: utilize PUBLISH_USED_IDX feature
...ost_dev *d, int ioctl, void __user *argp)
* If it is not, we don't as size might not have been setup.
* We will verify when backend is configured. */
if (vq->private_data) {
- if (!vq_access_ok(vq->num,
+ if (!vq_access_ok(d, vq->num,
(void __user *)(unsigned long)a.desc_user_addr,
(void __user *)(unsigned long)a.avail_user_addr,
(void __user *)(unsigned long)a.used_user_addr)) {
@@ -473,6 +474,7 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp)
vq->log_used = !!(a.flags & (0x1 << VHOST_VRING_F_LOG));
vq->desc =...
2016 Apr 28
2
[RFC PATCH V2 2/2] vhost: device IOTLB API
...vhost.
> > There's one problem here, and that is that VQs still do not undergo
> > translation. In theory VQ could be mapped in such a way
> > that it's not contigious in userspace memory.
>
> I'm not sure I get the issue, current vhost API support setting
> desc_user_addr, used_user_addr and avail_user_addr independently. So
> looks ok? If not, looks not a problem to device IOTLB API itself.
The problem is that addresses are all HVA.
Without an iommu, we ask for them to be contigious and
since bus address == GPA, this means contigious GPA =>
contigious HVA....
2016 Apr 28
2
[RFC PATCH V2 2/2] vhost: device IOTLB API
...vhost.
> > There's one problem here, and that is that VQs still do not undergo
> > translation. In theory VQ could be mapped in such a way
> > that it's not contigious in userspace memory.
>
> I'm not sure I get the issue, current vhost API support setting
> desc_user_addr, used_user_addr and avail_user_addr independently. So
> looks ok? If not, looks not a problem to device IOTLB API itself.
The problem is that addresses are all HVA.
Without an iommu, we ask for them to be contigious and
since bus address == GPA, this means contigious GPA =>
contigious HVA....
2018 Dec 13
0
[PATCH net-next 3/3] vhost: access vq metadata through kernel virtual address
...+ return 0;
+ }
+
return vhost_copy_from_user(vq, desc, vq->desc + idx, sizeof(*desc));
}
@@ -1551,6 +1722,13 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg
}
}
+ if (!vq->iotlb && vhost_setup_vmaps(vq, a.avail_user_addr,
+ a.desc_user_addr,
+ a.used_user_addr)) {
+ r = -EINVAL;
+ break;
+ }
+
vq->log_used = !!(a.flags & (0x1 << VHOST_VRING_F_LOG));
vq->desc = (void __user *)(unsigned long)a.desc_user_addr;
vq->avail = (void __user *)(unsigned long)a.avail_user_addr;
diff --git a/drivers/vhost/vh...
2020 Sep 28
0
[PATCH] vhost: Don't call vq_access_ok() when using IOTLB
...{
> - if (!vq_access_ok(vq, vq->num,
> + /* If an IOTLB device is present, the vring addresses are
> + * GIOVAs. Access will be validated during IOTLB prefetch. */
> + if (!vq->iotlb &&
> + !vq_access_ok(vq, vq->num,
> (void __user *)(unsigned long)a.desc_user_addr,
> (void __user *)(unsigned long)a.avail_user_addr,
> (void __user *)(unsigned long)a.used_user_addr))
>
2020 Sep 29
0
[PATCH] vhost: Don't call vq_access_ok() when using IOTLB
...{
> - if (!vq_access_ok(vq, vq->num,
> + /* If an IOTLB device is present, the vring addresses are
> + * GIOVAs. Access will be validated during IOTLB prefetch. */
> + if (!vq->iotlb &&
> + !vq_access_ok(vq, vq->num,
> (void __user *)(unsigned long)a.desc_user_addr,
> (void __user *)(unsigned long)a.avail_user_addr,
> (void __user *)(unsigned long)a.used_user_addr))
OK I think you are right here.
Jason, can you ack pls?
However, I think a cleaner way to check this is by moving
the following check from vhost_vq_access_ok to vq_access_ok:...
2015 Feb 20
0
[PATCH 1/3] vhost: add VHOST_VRING_F_LEGACY_BIG_ENDIAN flag
...t_vring_addr {
/* Flag values: */
/* Whether log address is valid. If set enables logging. */
#define VHOST_VRING_F_LOG 0
+ /* Whether we have a big-endian legacy virtio device. */
+#define VHOST_VRING_F_LEGACY_BIG_ENDIAN 1
/* Start of array of descriptors (virtually contiguous) */
__u64 desc_user_addr;
2015 Feb 20
0
[PATCH 1/3] vhost: add VHOST_VRING_F_LEGACY_BIG_ENDIAN flag
...t_vring_addr {
/* Flag values: */
/* Whether log address is valid. If set enables logging. */
#define VHOST_VRING_F_LOG 0
+ /* Whether we have a big-endian legacy virtio device. */
+#define VHOST_VRING_F_LEGACY_BIG_ENDIAN 1
/* Start of array of descriptors (virtually contiguous) */
__u64 desc_user_addr;
2019 Jul 03
0
[RFC v2] vhost: introduce mdev based hardware vhost backend
...mdev_get_drvdata(mdev);
> + if (!vdpa)
> + return -ENODEV;
> +
> + if (qid >= vdpa->max_vrings)
> + return -EINVAL;
> +
> + if (qid >= vdpa->nr_vring)
> + vdpa->nr_vring = qid + 1;
> +
> + vring = &vdpa->vring_info[qid];
> +
> + vring->desc_user_addr = addr->desc_user_addr;
> + vring->used_user_addr = addr->used_user_addr;
> + vring->avail_user_addr = addr->avail_user_addr;
> + vring->log_guest_addr = addr->log_guest_addr;
> +
> + return 0;
> +}
> +
> +static int vhost_set_vring_num(struct mdev_devic...
2019 Jul 03
4
[RFC v2] vhost: introduce mdev based hardware vhost backend
...addr->index;
+ struct vdpa_vring_info *vring;
+
+ vdpa = mdev_get_drvdata(mdev);
+ if (!vdpa)
+ return -ENODEV;
+
+ if (qid >= vdpa->max_vrings)
+ return -EINVAL;
+
+ if (qid >= vdpa->nr_vring)
+ vdpa->nr_vring = qid + 1;
+
+ vring = &vdpa->vring_info[qid];
+
+ vring->desc_user_addr = addr->desc_user_addr;
+ vring->used_user_addr = addr->used_user_addr;
+ vring->avail_user_addr = addr->avail_user_addr;
+ vring->log_guest_addr = addr->log_guest_addr;
+
+ return 0;
+}
+
+static int vhost_set_vring_num(struct mdev_device *mdev,
+ struct vhost_vring_state *nu...