It turns out the lguest (and possibly kvm) want the addresses in the
ring buffer to only cover a certain part of memory, and be offset.
It makes sense that this be an ioctl.
Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
@@ -208,12 +232,15 @@ int vring_get_buffer(struct vring_info *
out_len = &dummy;
*in_len = *out_len = 0;
-
- if (unlikely(get_user(head, &vr->ring.avail->ring[head]) != 0))
+
+ if (unlikely(get_user(head, &vr->ring.avail->ring[vr->last_avail
+ % vr->ring.num])))