Displaying 6 results from an estimated 6 matches for "trasnlate_desc".
Did you mean:
translate_desc
2019 Oct 16
4
read_barrier_depends() usage in vhost.c
Hi all,
In an attempt to remove the remaining traces of [smp_]read_barrier_depends()
following my previous patches to strengthen READ_ONCE() for Alpha [1], I
ended up trying to decipher the read_barrier_depends() usage in the vhost
driver:
--->8
// drivers/vhost/vhost.c
static int get_indirect(struct vhost_virtqueue *vq,
struct iovec iov[], unsigned int iov_size,
unsigned int *out_num,
2019 Oct 16
4
read_barrier_depends() usage in vhost.c
Hi all,
In an attempt to remove the remaining traces of [smp_]read_barrier_depends()
following my previous patches to strengthen READ_ONCE() for Alpha [1], I
ended up trying to decipher the read_barrier_depends() usage in the vhost
driver:
--->8
// drivers/vhost/vhost.c
static int get_indirect(struct vhost_virtqueue *vq,
struct iovec iov[], unsigned int iov_size,
unsigned int *out_num,
2019 Oct 18
2
read_barrier_depends() usage in vhost.c
...ybody know which accesses are being ordered here? Usually you'd need
> > a READ_ONCE()/rcu_dereference() beginning the chain, but I haven't managed
> > to find one...
> >
>
> I guess it was because we will read from the address stored in the iov like:
>
> 1) trasnlate_desc() that stores the userspace buffer pointer in the iov
>
> 2) copy_from_iter() that reads from those pointers
Isn't that exactly the same flow as vhost_copy_from_user(), which doesn't
have the barrier? Staring at the code some more, my best bet at the moment
is that the load of '...
2019 Oct 18
2
read_barrier_depends() usage in vhost.c
...ybody know which accesses are being ordered here? Usually you'd need
> > a READ_ONCE()/rcu_dereference() beginning the chain, but I haven't managed
> > to find one...
> >
>
> I guess it was because we will read from the address stored in the iov like:
>
> 1) trasnlate_desc() that stores the userspace buffer pointer in the iov
>
> 2) copy_from_iter() that reads from those pointers
Isn't that exactly the same flow as vhost_copy_from_user(), which doesn't
have the barrier? Staring at the code some more, my best bet at the moment
is that the load of '...
2019 Oct 17
0
read_barrier_depends() usage in vhost.c
...is).
>
> Does anybody know which accesses are being ordered here? Usually you'd need
> a READ_ONCE()/rcu_dereference() beginning the chain, but I haven't managed
> to find one...
>
> Thanks,
I guess it was because we will read from the address stored in the iov like:
1) trasnlate_desc() that stores the userspace buffer pointer in the iov
2) copy_from_iter() that reads from those pointers
So we need a data dependency barrier in the middle as explained in the
memory-barriers.txt? (since READ_ONCE is not used in iov iterator).
Thanks
>
> Will
>
> [1] c2bc66082e10...
2019 Oct 21
0
read_barrier_depends() usage in vhost.c
...ich accesses are being ordered here? Usually you'd need
>>> a READ_ONCE()/rcu_dereference() beginning the chain, but I haven't managed
>>> to find one...
>>>
>> I guess it was because we will read from the address stored in the iov like:
>>
>> 1) trasnlate_desc() that stores the userspace buffer pointer in the iov
>>
>> 2) copy_from_iter() that reads from those pointers
> Isn't that exactly the same flow as vhost_copy_from_user(), which doesn't
> have the barrier?
There's a rmb before calling vhost_copy_from_user() (vhost_g...