search for: vhost_get_vring_big_endian

Displaying 9 results from an estimated 9 matches for "vhost_get_vring_big_endian".

2015 Apr 21
2
[PATCH v4 7/8] vhost: feature to set the vring endianness
...e_data) > + return -EBUSY; > + > + if (copy_from_user(&s, argp, sizeof(s))) > + return -EFAULT; > + > + if (s.num && s.num != 1) s.num & ~0x1 > + return -EINVAL; > + > + vq->user_be = s.num; > + > + return 0; > +} > + > +static long vhost_get_vring_big_endian(struct vhost_virtqueue *vq, u32 idx, > + int __user *argp) > +{ > + struct vhost_vring_state s = { > + .index = idx, > + .num = vq->user_be > + }; > + > + if (copy_to_user(argp, &s, sizeof(s))) > + return -EFAULT; > + > + return 0; > +} > +...
2015 Apr 21
2
[PATCH v4 7/8] vhost: feature to set the vring endianness
...e_data) > + return -EBUSY; > + > + if (copy_from_user(&s, argp, sizeof(s))) > + return -EFAULT; > + > + if (s.num && s.num != 1) s.num & ~0x1 > + return -EINVAL; > + > + vq->user_be = s.num; > + > + return 0; > +} > + > +static long vhost_get_vring_big_endian(struct vhost_virtqueue *vq, u32 idx, > + int __user *argp) > +{ > + struct vhost_vring_state s = { > + .index = idx, > + .num = vq->user_be > + }; > + > + if (copy_to_user(argp, &s, sizeof(s))) > + return -EFAULT; > + > + return 0; > +} > +...
2015 Apr 10
0
[PATCH v4 7/8] vhost: feature to set the vring endianness
...*vq, + int __user *argp) +{ + struct vhost_vring_state s; + + if (vq->private_data) + return -EBUSY; + + if (copy_from_user(&s, argp, sizeof(s))) + return -EFAULT; + + if (s.num && s.num != 1) + return -EINVAL; + + vq->user_be = s.num; + + return 0; +} + +static long vhost_get_vring_big_endian(struct vhost_virtqueue *vq, u32 idx, + int __user *argp) +{ + struct vhost_vring_state s = { + .index = idx, + .num = vq->user_be + }; + + if (copy_to_user(argp, &s, sizeof(s))) + return -EFAULT; + + return 0; +} +#else +static long vhost_set_vring_big_endian(struct vhost_virtqu...
2015 Apr 21
2
[PATCH v4 7/8] vhost: feature to set the vring endianness
...e replace 0 and 1 with defines. So ignore my advice, keep code as is but use defines. > > > > > + return -EINVAL; > > > + > > > + vq->user_be = s.num; > > > + > > > + return 0; > > > +} > > > + > > > +static long vhost_get_vring_big_endian(struct vhost_virtqueue *vq, u32 idx, > > > + int __user *argp) > > > +{ > > > + struct vhost_vring_state s = { > > > + .index = idx, > > > + .num = vq->user_be > > > + }; > > > + > > > + if (copy_to_user(argp, &a...
2015 Apr 21
2
[PATCH v4 7/8] vhost: feature to set the vring endianness
...e replace 0 and 1 with defines. So ignore my advice, keep code as is but use defines. > > > > > + return -EINVAL; > > > + > > > + vq->user_be = s.num; > > > + > > > + return 0; > > > +} > > > + > > > +static long vhost_get_vring_big_endian(struct vhost_virtqueue *vq, u32 idx, > > > + int __user *argp) > > > +{ > > > + struct vhost_vring_state s = { > > > + .index = idx, > > > + .num = vq->user_be > > > + }; > > > + > > > + if (copy_to_user(argp, &a...
2015 Apr 21
0
[PATCH v4 7/8] vhost: feature to set the vring endianness
....num & ~0x1 > Since s.num is unsigned and I assume this won't change, what about s.num > 1 as suggested by Cornelia ? > > > + return -EINVAL; > > + > > + vq->user_be = s.num; > > + > > + return 0; > > +} > > + > > +static long vhost_get_vring_big_endian(struct vhost_virtqueue *vq, u32 idx, > > + int __user *argp) > > +{ > > + struct vhost_vring_state s = { > > + .index = idx, > > + .num = vq->user_be > > + }; > > + > > + if (copy_to_user(argp, &s, sizeof(s))) > > + return -E...
2015 Apr 10
16
[PATCH v4 0/8] vhost: support for cross endian guests
Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patch 7 got rewritten according to Cornelia's and Michael's comments. I have also introduced patch 8 that brings BE vnet headers support to tun/macvtap. This series is enough to have vhost_net working flawlessly. I could succesfully reboot guests from ppc64 to ppc64le and
2015 Apr 10
16
[PATCH v4 0/8] vhost: support for cross endian guests
Hi, This patchset allows vhost to be used with legacy virtio when guest and host have a different endianness. Patch 7 got rewritten according to Cornelia's and Michael's comments. I have also introduced patch 8 that brings BE vnet headers support to tun/macvtap. This series is enough to have vhost_net working flawlessly. I could succesfully reboot guests from ppc64 to ppc64le and
2015 Apr 22
0
[PATCH v4 7/8] vhost: feature to set the vring endianness
...e saying that not all kernel configurations support this ioctl, > but all configurations that support SET also support GET. > Ok. > > > > + */ > > > > +#define VHOST_SET_VRING_BIG_ENDIAN _IOW(VHOST_VIRTIO, 0x13, struct vhost_vring_state) > > > > +#define VHOST_GET_VRING_BIG_ENDIAN _IOW(VHOST_VIRTIO, 0x14, struct vhost_vring_state) > > > > + > > > > /* The following ioctls use eventfd file descriptors to signal and poll > > > > * for events. */ > > > > > > > > > I'm inclined to think VHOST_SET_VRING_END...