search for: weak_barri

Displaying 20 results from an estimated 310 matches for "weak_barri".

Did you mean: weak_barrier
2018 Apr 19
4
[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg
...inux/virtio_ring.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index bbf3252..fab0213 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -35,7 +35,7 @@ static inline void virtio_rmb(bool weak_barriers) if (weak_barriers) virt_rmb(); else - rmb(); + dma_rmb(); } static inline void virtio_wmb(bool weak_barriers) @@ -43,7 +43,7 @@ static inline void virtio_wmb(bool weak_barriers) if (weak_barriers) virt_wmb(); else - wmb(); + dma_wmb(); } static inline void virtio_store...
2018 Apr 19
4
[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg
...inux/virtio_ring.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index bbf3252..fab0213 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -35,7 +35,7 @@ static inline void virtio_rmb(bool weak_barriers) if (weak_barriers) virt_rmb(); else - rmb(); + dma_rmb(); } static inline void virtio_wmb(bool weak_barriers) @@ -43,7 +43,7 @@ static inline void virtio_wmb(bool weak_barriers) if (weak_barriers) virt_wmb(); else - wmb(); + dma_wmb(); } static inline void virtio_store...
2015 Apr 08
3
[PATCH] virtio_ring: Update weak barriers to use dma_wmb/rmb
...deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 67e06fe18c03..8e50888a6d59 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -21,19 +21,20 @@ * actually quite cheap. */ -#ifdef CONFIG_SMP static inline void virtio_mb(bool weak_barriers) { +#ifdef CONFIG_SMP if (weak_barriers) smp_mb(); else +#endif mb(); } static inline void virtio_rmb(bool weak_barriers) { if (weak_barriers) - smp_rmb(); + dma_rmb(); else rmb(); } @@ -41,26 +42,10 @@ static inline void virtio_rmb(bool weak_barriers) static inline vo...
2015 Apr 08
3
[PATCH] virtio_ring: Update weak barriers to use dma_wmb/rmb
...deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 67e06fe18c03..8e50888a6d59 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -21,19 +21,20 @@ * actually quite cheap. */ -#ifdef CONFIG_SMP static inline void virtio_mb(bool weak_barriers) { +#ifdef CONFIG_SMP if (weak_barriers) smp_mb(); else +#endif mb(); } static inline void virtio_rmb(bool weak_barriers) { if (weak_barriers) - smp_rmb(); + dma_rmb(); else rmb(); } @@ -41,26 +42,10 @@ static inline void virtio_rmb(bool weak_barriers) static inline vo...
2015 Dec 17
4
[PATCH] virtio_ring: use smp_store_mb
...g.c | 15 +++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 0135c16..8912189 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -47,6 +47,20 @@ static inline void virtio_wmb(bool weak_barriers) wmb(); } +static inline void virtio_store_mb(bool weak_barriers, + __virtio16 *p, __virtio16 v) +{ +#ifdef CONFIG_SMP + if (weak_barriers) + smp_store_mb(*p, v); + else +#endif + { + WRITE_ONCE(*p, v); + mb(); + } +} + static inline __virtio16 virtio_load_acquire(bool weak_barri...
2015 Dec 17
4
[PATCH] virtio_ring: use smp_store_mb
...g.c | 15 +++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 0135c16..8912189 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -47,6 +47,20 @@ static inline void virtio_wmb(bool weak_barriers) wmb(); } +static inline void virtio_store_mb(bool weak_barriers, + __virtio16 *p, __virtio16 v) +{ +#ifdef CONFIG_SMP + if (weak_barriers) + smp_store_mb(*p, v); + else +#endif + { + WRITE_ONCE(*p, v); + mb(); + } +} + static inline __virtio16 virtio_load_acquire(bool weak_barri...
2016 Jan 01
0
[PATCH v2 30/32] virtio_ring: update weak barriers to use __smp_xxx
...windows, so smp_mb() et al are + * accesses through relaxed memory I/O windows, so virt_mb() et al are * sufficient. * * For using virtio to talk to real devices (eg. other heterogeneous @@ -21,11 +21,10 @@ * actually quite cheap. */ -#ifdef CONFIG_SMP static inline void virtio_mb(bool weak_barriers) { if (weak_barriers) - smp_mb(); + virt_mb(); else mb(); } @@ -33,7 +32,7 @@ static inline void virtio_mb(bool weak_barriers) static inline void virtio_rmb(bool weak_barriers) { if (weak_barriers) - smp_rmb(); + virt_rmb(); else rmb(); } @@ -41,26 +40,10 @@ static inline...
2015 Dec 17
2
[PATCH] virtio_ring: use smp_store_mb
On Thu, Dec 17, 2015 at 11:52:38AM +0100, Peter Zijlstra wrote: > On Thu, Dec 17, 2015 at 12:32:53PM +0200, Michael S. Tsirkin wrote: > > +static inline void virtio_store_mb(bool weak_barriers, > > + __virtio16 *p, __virtio16 v) > > +{ > > +#ifdef CONFIG_SMP > > + if (weak_barriers) > > + smp_store_mb(*p, v); > > + else > > +#endif > > + { > > + WRITE_ONCE(*p, v); > > + mb(); > > + } > > +} > > Thi...
2015 Dec 17
2
[PATCH] virtio_ring: use smp_store_mb
On Thu, Dec 17, 2015 at 11:52:38AM +0100, Peter Zijlstra wrote: > On Thu, Dec 17, 2015 at 12:32:53PM +0200, Michael S. Tsirkin wrote: > > +static inline void virtio_store_mb(bool weak_barriers, > > + __virtio16 *p, __virtio16 v) > > +{ > > +#ifdef CONFIG_SMP > > + if (weak_barriers) > > + smp_store_mb(*p, v); > > + else > > +#endif > > + { > > + WRITE_ONCE(*p, v); > > + mb(); > > + } > > +} > > Thi...
2015 Apr 08
0
[PATCH] virtio_ring: Update weak barriers to use dma_wmb/rmb
...io_ring.h b/include/linux/virtio_ring.h > index 67e06fe18c03..8e50888a6d59 100644 > --- a/include/linux/virtio_ring.h > +++ b/include/linux/virtio_ring.h > @@ -21,19 +21,20 @@ > * actually quite cheap. > */ > > -#ifdef CONFIG_SMP > static inline void virtio_mb(bool weak_barriers) > { > +#ifdef CONFIG_SMP > if (weak_barriers) > smp_mb(); > else > +#endif > mb(); > } > > static inline void virtio_rmb(bool weak_barriers) > { > if (weak_barriers) > - smp_rmb(); > + dma_rmb(); > else > rmb(); > } &g...
2020 Jul 10
1
[PATCH] virtio_ring: sparse warning fixup
...++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 3dc70adfe5f5..b485b13fa50b 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -46,16 +46,15 @@ static inline void virtio_wmb(bool weak_barriers) dma_wmb(); } -static inline void virtio_store_mb(bool weak_barriers, - __virtio16 *p, __virtio16 v) -{ - if (weak_barriers) { - virt_store_mb(*p, v); - } else { - WRITE_ONCE(*p, v); - mb(); - } -} +#define virtio_store_mb(weak_barriers, p, v) \ +do { \ + if (weak_barriers) { \ +...
2015 Dec 17
2
[PATCH] virtio: use smp_load_acquire/smp_store_release
...20 ++++++++++---------- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 8e50888..0135c16 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -47,6 +47,36 @@ static inline void virtio_wmb(bool weak_barriers) wmb(); } +static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p) +{ + if (!weak_barriers) { + rmb(); + return READ_ONCE(*p); + } +#ifdef CONFIG_SMP + return smp_load_acquire(p); +#else + dma_rmb(); + return READ_ONCE(*p); +#endif +} + +static inline void virtio_...
2015 Dec 17
2
[PATCH] virtio: use smp_load_acquire/smp_store_release
...20 ++++++++++---------- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 8e50888..0135c16 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -47,6 +47,36 @@ static inline void virtio_wmb(bool weak_barriers) wmb(); } +static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p) +{ + if (!weak_barriers) { + rmb(); + return READ_ONCE(*p); + } +#ifdef CONFIG_SMP + return smp_load_acquire(p); +#else + dma_rmb(); + return READ_ONCE(*p); +#endif +} + +static inline void virtio_...
2018 Apr 19
4
[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg
...#39;s good in theory, but could one of RPMSG maintainers please review > > and ack this patch? Or even better test it? > > > > All these barriers are useless on Intel anyway ... > > This should be okay, but I wonder if there should be a virtio_wmb(...) > or an "if (weak_barriers) wmb()" before the "writel" in vm_notify > (drivers/virtio/virtio_mmio.c). > > Thanks, > > Paolo That one uses weak barriers AFAIK. IIUC you mean rproc_virtio_notify. I suspect it works because specific kick callbacks have a barrier internally. > > &gt...
2018 Apr 19
4
[PATCH] virtio_ring: switch to dma_XX barriers for rpmsg
...#39;s good in theory, but could one of RPMSG maintainers please review > > and ack this patch? Or even better test it? > > > > All these barriers are useless on Intel anyway ... > > This should be okay, but I wonder if there should be a virtio_wmb(...) > or an "if (weak_barriers) wmb()" before the "writel" in vm_notify > (drivers/virtio/virtio_mmio.c). > > Thanks, > > Paolo That one uses weak barriers AFAIK. IIUC you mean rproc_virtio_notify. I suspect it works because specific kick callbacks have a barrier internally. > > &gt...
2016 Jan 01
1
[PATCH v2 32/32] virtio_ring: use virt_store_mb
...iles changed, 21 insertions(+), 6 deletions(-) > > diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h > index f3fa55b..3a74d91 100644 > --- a/include/linux/virtio_ring.h > +++ b/include/linux/virtio_ring.h > @@ -45,6 +45,18 @@ static inline void virtio_wmb(bool weak_barriers) > wmb(); > } > > +static inline void virtio_store_mb(bool weak_barriers, > + __virtio16 *p, __virtio16 v) > +{ > + if (weak_barriers) > + virt_store_mb(*p, v); > + else > + { The kernel coding style dictates: if (weak_barriers) { virt_store_mb...
2016 Jan 01
1
[PATCH v2 32/32] virtio_ring: use virt_store_mb
...iles changed, 21 insertions(+), 6 deletions(-) > > diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h > index f3fa55b..3a74d91 100644 > --- a/include/linux/virtio_ring.h > +++ b/include/linux/virtio_ring.h > @@ -45,6 +45,18 @@ static inline void virtio_wmb(bool weak_barriers) > wmb(); > } > > +static inline void virtio_store_mb(bool weak_barriers, > + __virtio16 *p, __virtio16 v) > +{ > + if (weak_barriers) > + virt_store_mb(*p, v); > + else > + { The kernel coding style dictates: if (weak_barriers) { virt_store_mb...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...t vring_interrupt(int irq, void *_vq) > } > EXPORT_SYMBOL_GPL(vring_interrupt); > > -struct virtqueue *vring_new_virtqueue(unsigned int index, > - unsigned int num, > - unsigned int vring_align, > - struct virtio_device *vdev, > - bool weak_barriers, > - void *pages, > - bool (*notify)(struct virtqueue *), > - void (*callback)(struct virtqueue *), > - const char *name) > +struct virtqueue *__vring_new_virtqueue(unsigned int index, > + struct vring vring, > + struct virtio_devi...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...t vring_interrupt(int irq, void *_vq) > } > EXPORT_SYMBOL_GPL(vring_interrupt); > > -struct virtqueue *vring_new_virtqueue(unsigned int index, > - unsigned int num, > - unsigned int vring_align, > - struct virtio_device *vdev, > - bool weak_barriers, > - void *pages, > - bool (*notify)(struct virtqueue *), > - void (*callback)(struct virtqueue *), > - const char *name) > +struct virtqueue *__vring_new_virtqueue(unsigned int index, > + struct vring vring, > + struct virtio_devi...
2018 Sep 07
1
[PATCH net-next v2 4/5] virtio_ring: add event idx support in packed ring
...eue *vq = to_vvq(_vq); > - u16 flags; > + u16 new, old, off_wrap, flags, wrap_counter, event_idx; > bool needs_kick; > u32 snapshot; > > @@ -1059,9 +1059,19 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq) > * suppressions. */ > virtio_mb(vq->weak_barriers); > > + old = vq->next_avail_idx - vq->num_added; > + new = vq->next_avail_idx; > + vq->num_added = 0; > + > snapshot = READ_ONCE(*(u32 *)vq->vring_packed.device); > + off_wrap = virtio16_to_cpu(_vq->vdev, (__virtio16)(snapshot & 0xffff)); > fl...