search for: virt_store_mb

Displaying 20 results from an estimated 20 matches for "virt_store_mb".

Did you mean: virtio_store_mb
2016 Jan 01
1
[PATCH v2 32/32] virtio_ring: use virt_store_mb
Hello. On 12/31/2015 10:09 PM, Michael S. Tsirkin wrote: > We need a full barrier after writing out event index, using > virt_store_mb there seems better than open-coding. As usual, we need a > wrapper to account for strong barriers. > > It's tempting to use this in vhost as well, for that, we'll > need a variant of smp_store_mb that works on __user pointers. > > Signed-off-by: Michael S. Tsirkin <mst...
2016 Jan 01
1
[PATCH v2 32/32] virtio_ring: use virt_store_mb
Hello. On 12/31/2015 10:09 PM, Michael S. Tsirkin wrote: > We need a full barrier after writing out event index, using > virt_store_mb there seems better than open-coding. As usual, we need a > wrapper to account for strong barriers. > > It's tempting to use this in vhost as well, for that, we'll > need a variant of smp_store_mb that works on __user pointers. > > Signed-off-by: Michael S. Tsirkin <mst...
2015 Dec 31
0
[PATCH v2 32/32] virtio_ring: use virt_store_mb
We need a full barrier after writing out event index, using virt_store_mb there seems better than open-coding. As usual, we need a wrapper to account for strong barriers. It's tempting to use this in vhost as well, for that, we'll need a variant of smp_store_mb that works on __user pointers. Signed-off-by: Michael S. Tsirkin <mst at redhat.com> --- incl...
2020 Jul 10
1
[PATCH] virtio_ring: sparse warning fixup
....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) { \ + virt_store_mb(*p, v); \ + } else { \ + WRITE_ONCE(*p, v); \ + mb(); \ + } \ +} while (0) \ struct virtio_device; struct virtqueue; -- MST
2020 Aug 03
0
[PATCH v2 02/24] virtio_ring: sparse warning fixup
....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) { \ + virt_store_mb(*p, v); \ + } else { \ + WRITE_ONCE(*p, v); \ + mb(); \ + } \ +} while (0) \ struct virtio_device; struct virtqueue; -- MST
2020 Aug 05
0
[PATCH v3 02/38] virtio_ring: sparse warning fixup
....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) { \ + virt_store_mb(*p, v); \ + } else { \ + WRITE_ONCE(*p, v); \ + mb(); \ + } \ +} while (0) \ struct virtio_device; struct virtqueue; -- MST
2016 Jan 13
3
[PULL] virtio: barrier rework+fixes
...xx asm-generic: implement virt_xxx memory barriers Revert "virtio_ring: Update weak barriers to use dma_wmb/rmb" virtio_ring: update weak barriers to use virt_xxx sh: support 1 and 2 byte xchg sh: move xchg_cmpxchg to a header by itself virtio_ring: use virt_store_mb xenbus: use virt_xxx barriers xen/io: use virt_xxx barriers xen/events: use virt_xxx barriers s390: use generic memory barriers s390: more efficient smp barriers checkpatch.pl: add missing memory barriers checkpatch: check for __smp outside barrier.h...
2016 Jan 13
3
[PULL] virtio: barrier rework+fixes
...xx asm-generic: implement virt_xxx memory barriers Revert "virtio_ring: Update weak barriers to use dma_wmb/rmb" virtio_ring: update weak barriers to use virt_xxx sh: support 1 and 2 byte xchg sh: move xchg_cmpxchg to a header by itself virtio_ring: use virt_store_mb xenbus: use virt_xxx barriers xen/io: use virt_xxx barriers xen/events: use virt_xxx barriers s390: use generic memory barriers s390: more efficient smp barriers checkpatch.pl: add missing memory barriers checkpatch: check for __smp outside barrier.h...
2016 Jan 20
0
[PATCH] tools/virtio: use virt_xxx barriers
...dma_rmb() barrier() -# define dma_wmb() barrier() -# define smp_rmb() barrier() -# define smp_wmb() barrier() +#define virt_mb() __sync_synchronize() +#define virt_rmb() barrier() +#define virt_wmb() barrier() +/* Atomic store should be enough, but gcc generates worse code in that case. */ +#define virt_store_mb(var, value) do { \ + typeof(var) virt_store_mb_value = (value); \ + __atomic_exchange(&(var), &virt_store_mb_value, &virt_store_mb_value, \ + __ATOMIC_SEQ_CST); \ + barrier(); \ +} while (0); /* Weak barriers should be used. If not - it's a bug */ -# define rmb() abort() -# de...
2016 Jan 20
0
[PATCH] tools/virtio: use virt_xxx barriers
...dma_rmb() barrier() -# define dma_wmb() barrier() -# define smp_rmb() barrier() -# define smp_wmb() barrier() +#define virt_mb() __sync_synchronize() +#define virt_rmb() barrier() +#define virt_wmb() barrier() +/* Atomic store should be enough, but gcc generates worse code in that case. */ +#define virt_store_mb(var, value) do { \ + typeof(var) virt_store_mb_value = (value); \ + __atomic_exchange(&(var), &virt_store_mb_value, &virt_store_mb_value, \ + __ATOMIC_SEQ_CST); \ + barrier(); \ +} while (0); /* Weak barriers should be used. If not - it's a bug */ -# define rmb() abort() -# de...
2016 Jan 18
0
virtio pull for 4.5 (was Re: [PULL] virtio: barrier rework+fixes)
...lement virt_xxx memory barriers > Revert "virtio_ring: Update weak barriers to use dma_wmb/rmb" > virtio_ring: update weak barriers to use virt_xxx > sh: support 1 and 2 byte xchg > sh: move xchg_cmpxchg to a header by itself > virtio_ring: use virt_store_mb > xenbus: use virt_xxx barriers > xen/io: use virt_xxx barriers > xen/events: use virt_xxx barriers > s390: use generic memory barriers > s390: more efficient smp barriers > checkpatch.pl: add missing memory barriers > checkpatch: check...
2015 Dec 31
54
[PATCH v2 00/34] arch: barrier cleanup + barriers for virt
...or __smp_, and documents them. After all this work, this requires very few lines of code in the generic header. -. Patches 29,30,33,34 convert virtio xen drivers to use the virt_xxx APIs xen patches are untested virtio ones have been tested on x86 -. Patches 31-32 teach virtio to use virt_store_mb sh architecture was missing a 2-byte smp_store_mb, the fix is trivial although my code is not optimal: if anyone cares, pls send me a patch to apply on top. I didn't build this architecture, but intel's 0-day infrastructure builds it. tested on x86 Davidlohr Bueso (1):...
2015 Dec 31
54
[PATCH v2 00/34] arch: barrier cleanup + barriers for virt
...or __smp_, and documents them. After all this work, this requires very few lines of code in the generic header. -. Patches 29,30,33,34 convert virtio xen drivers to use the virt_xxx APIs xen patches are untested virtio ones have been tested on x86 -. Patches 31-32 teach virtio to use virt_store_mb sh architecture was missing a 2-byte smp_store_mb, the fix is trivial although my code is not optimal: if anyone cares, pls send me a patch to apply on top. I didn't build this architecture, but intel's 0-day infrastructure builds it. tested on x86 Davidlohr Bueso (1):...
2016 Jan 10
48
[PATCH v3 00/41] arch: barrier cleanup + barriers for virt
...xxx APIs to work for virt: -. Patch 28 adds virt_ wrappers for __smp_, and documents them. After all this work, this requires very few lines of code in the generic header. -. Patches 29,30 convert virtio drivers to use the virt_xxx APIs tested on x86 -. Patches 31-33 teach virtio to use virt_store_mb sh architecture was missing a 2-byte xchg, needed for 2 byte smp_store_mb, so I had to add this support for sh -. Patches 34-36 teach checkpatch to warn about misuse of the new barriers -. Patches 37-39 convert xen drivers to use the virt_xxx APIs compiled only (by intel 0-day infr...
2016 Jan 10
48
[PATCH v3 00/41] arch: barrier cleanup + barriers for virt
...xxx APIs to work for virt: -. Patch 28 adds virt_ wrappers for __smp_, and documents them. After all this work, this requires very few lines of code in the generic header. -. Patches 29,30 convert virtio drivers to use the virt_xxx APIs tested on x86 -. Patches 31-33 teach virtio to use virt_store_mb sh architecture was missing a 2-byte xchg, needed for 2 byte smp_store_mb, so I had to add this support for sh -. Patches 34-36 teach checkpatch to warn about misuse of the new barriers -. Patches 37-39 convert xen drivers to use the virt_xxx APIs compiled only (by intel 0-day infr...
2020 Aug 03
51
[PATCH v2 00/24] virtio: config space endian-ness cleanup
Config space endian-ness is currently a mess: fields are not tagged with the correct endian-ness so it's easy to make mistakes like instanciating config space in native endian-ness. The following patches adding sparse tagging are currently in my tree. Lightly tested. As a follow-up, I plan to add new APIs that handle modern config space in a more efficient way (bypassing the version check).
2019 Nov 08
15
[PATCH 00/13] Finish off [smp_]read_barrier_depends()
Hi all, Although [smp_]read_barrier_depends() became part of READ_ONCE() in commit 76ebbe78f739 ("locking/barriers: Add implicit smp_read_barrier_depends() to READ_ONCE()"), it still limps on in the Linux memory model with the sinister hope of attracting innocent new users so that it becomes impossible to remove altogether. Let's strike before it's too late: there's only
2020 Jul 10
24
[PATCH 00/18] Allow architectures to override __READ_ONCE()
Hi all, This is version three of the patches I previously posted here: v1: https://lore.kernel.org/lkml/20191108170120.22331-1-will at kernel.org/ v2: https://lore.kernel.org/r/20200630173734.14057-1-will at kernel.org Changes since v2 include: * Actually add the barrier in READ_ONCE() for Alpha! * Implement Alpha's smp_load_acquire() using __READ_ONCE(), rather than the other
2020 Jun 30
32
[PATCH 00/18] Allow architectures to override __READ_ONCE()
Hi everyone, This is the long-awaited version two of the patches I previously posted in November last year: https://lore.kernel.org/lkml/20191108170120.22331-1-will at kernel.org/ I ended up parking the series while the READ_ONCE() implementation was being overhauled, but with that merged during the recent merge window and LTO patches being posted again [1], it was time for a refresh. The
2020 Jun 30
32
[PATCH 00/18] Allow architectures to override __READ_ONCE()
Hi everyone, This is the long-awaited version two of the patches I previously posted in November last year: https://lore.kernel.org/lkml/20191108170120.22331-1-will at kernel.org/ I ended up parking the series while the READ_ONCE() implementation was being overhauled, but with that merged during the recent merge window and LTO patches being posted again [1], it was time for a refresh. The