search for: smp_mb

Displaying 20 results from an estimated 519 matches for "smp_mb".

Did you mean: smp_wmb
2016 Jan 05
3
[PATCH v2 22/32] s390: define __smp_xxx
..., Michael S. Tsirkin wrote: > > > This defines __smp_xxx barriers for s390, > > > for use by virtualization. > > > > > > Some smp_xxx barriers are removed as they are > > > defined correctly by asm-generic/barriers.h > > > > > > Note: smp_mb, smp_rmb and smp_wmb are defined as full barriers > > > unconditionally on this architecture. > > > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > > Acked-by: Arnd Bergmann <arnd at arndb.de> > > > --- > > > arch/s...
2016 Jan 05
3
[PATCH v2 22/32] s390: define __smp_xxx
..., Michael S. Tsirkin wrote: > > > This defines __smp_xxx barriers for s390, > > > for use by virtualization. > > > > > > Some smp_xxx barriers are removed as they are > > > defined correctly by asm-generic/barriers.h > > > > > > Note: smp_mb, smp_rmb and smp_wmb are defined as full barriers > > > unconditionally on this architecture. > > > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > > Acked-by: Arnd Bergmann <arnd at arndb.de> > > > --- > > > arch/s...
2016 Jan 05
2
[PATCH v2 22/32] s390: define __smp_xxx
...p_xxx barriers for s390, > > > > > for use by virtualization. > > > > > > > > > > Some smp_xxx barriers are removed as they are > > > > > defined correctly by asm-generic/barriers.h > > > > > > > > > > Note: smp_mb, smp_rmb and smp_wmb are defined as full barriers > > > > > unconditionally on this architecture. > > > > > > > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > > > > Acked-by: Arnd Bergmann <arnd at arndb.de> &...
2016 Jan 05
2
[PATCH v2 22/32] s390: define __smp_xxx
...p_xxx barriers for s390, > > > > > for use by virtualization. > > > > > > > > > > Some smp_xxx barriers are removed as they are > > > > > defined correctly by asm-generic/barriers.h > > > > > > > > > > Note: smp_mb, smp_rmb and smp_wmb are defined as full barriers > > > > > unconditionally on this architecture. > > > > > > > > > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > > > > > Acked-by: Arnd Bergmann <arnd at arndb.de> &...
2018 Jan 25
2
[PATCH net-next 12/12] tools/virtio: fix smp_mb on x86
...letion(-) diff --git a/tools/virtio/ringtest/main.h b/tools/virtio/ringtest/main.h index 593a328..301d59b 100644 --- a/tools/virtio/ringtest/main.h +++ b/tools/virtio/ringtest/main.h @@ -111,7 +111,7 @@ static inline void busy_wait(void) } #if defined(__x86_64__) || defined(__i386__) -#define smp_mb() asm volatile("lock; addl $0,-128(%%rsp)" ::: "memory", "cc") +#define smp_mb() asm volatile("lock; addl $0,-132(%%rsp)" ::: "memory", "cc") #else /* * Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized -...
2018 Jan 25
2
[PATCH net-next 12/12] tools/virtio: fix smp_mb on x86
...letion(-) diff --git a/tools/virtio/ringtest/main.h b/tools/virtio/ringtest/main.h index 593a328..301d59b 100644 --- a/tools/virtio/ringtest/main.h +++ b/tools/virtio/ringtest/main.h @@ -111,7 +111,7 @@ static inline void busy_wait(void) } #if defined(__x86_64__) || defined(__i386__) -#define smp_mb() asm volatile("lock; addl $0,-128(%%rsp)" ::: "memory", "cc") +#define smp_mb() asm volatile("lock; addl $0,-132(%%rsp)" ::: "memory", "cc") #else /* * Not using __ATOMIC_SEQ_CST since gcc docs say they are only synchronized -...
2015 Dec 31
54
[PATCH v2 00/34] arch: barrier cleanup + barriers for virt
...e? Note to arch maintainers: please don't cherry-pick patches out of this patchset as it's been structured in this order to avoid breaking bisect. Please send acks instead! Sometimes, virtualization is weird. For example, virtio does this (conceptually): #ifdef CONFIG_SMP smp_mb(); #else mb(); #endif Similarly, Xen calls mb() when it's not doing any MMIO at all. Of course it's wrong in the sense that it's suboptimal. What we would really like is to have, on UP, exactly the same barrier as on SMP. This is because a UP guest can run on an SMP h...
2015 Dec 31
54
[PATCH v2 00/34] arch: barrier cleanup + barriers for virt
...e? Note to arch maintainers: please don't cherry-pick patches out of this patchset as it's been structured in this order to avoid breaking bisect. Please send acks instead! Sometimes, virtualization is weird. For example, virtio does this (conceptually): #ifdef CONFIG_SMP smp_mb(); #else mb(); #endif Similarly, Xen calls mb() when it's not doing any MMIO at all. Of course it's wrong in the sense that it's suboptimal. What we would really like is to have, on UP, exactly the same barrier as on SMP. This is because a UP guest can run on an SMP h...
2016 Jan 04
1
[PATCH v2 17/32] arm: define __smp_xxx
...assuming everybody does include asm-generic/barrier.h, you could > simply #undef the __smp version at the end of that, once we've generated > all the regular primitives from it, no? Not so simple - that's why I mentioned using inline functions. The new smp_* _macros_ are: +#define smp_mb() __smp_mb() which means if we simply #undef __smp_mb(), smp_mb() then points at something which is no longer available, and we'll end up with errors saying that __smp_mb() doesn't exist. My suggestion was to change: #ifndef smp_mb #define smp_mb() __smp_mb() #endif to: #ifndef s...
2016 Jan 04
1
[PATCH v2 17/32] arm: define __smp_xxx
...assuming everybody does include asm-generic/barrier.h, you could > simply #undef the __smp version at the end of that, once we've generated > all the regular primitives from it, no? Not so simple - that's why I mentioned using inline functions. The new smp_* _macros_ are: +#define smp_mb() __smp_mb() which means if we simply #undef __smp_mb(), smp_mb() then points at something which is no longer available, and we'll end up with errors saying that __smp_mb() doesn't exist. My suggestion was to change: #ifndef smp_mb #define smp_mb() __smp_mb() #endif to: #ifndef s...
2015 Dec 30
46
[PATCH 00/34] arch: barrier cleanup + __smp_XXX barriers for virt
...e? Note to arch maintainers: please don't cherry-pick patches out of this patchset as it's been structured in this order to avoid breaking bisect. Please send acks instead! Sometimes, virtualization is weird. For example, virtio does this (conceptually): #ifdef CONFIG_SMP smp_mb(); #else mb(); #endif Similarly, Xen calls mb() when it's not doing any MMIO at all. Of course it's wrong in the sense that it's suboptimal. What we would really like is to have, on UP, exactly the same barrier as on SMP. This is because a UP guest can run on an SMP h...
2015 Dec 30
46
[PATCH 00/34] arch: barrier cleanup + __smp_XXX barriers for virt
...e? Note to arch maintainers: please don't cherry-pick patches out of this patchset as it's been structured in this order to avoid breaking bisect. Please send acks instead! Sometimes, virtualization is weird. For example, virtio does this (conceptually): #ifdef CONFIG_SMP smp_mb(); #else mb(); #endif Similarly, Xen calls mb() when it's not doing any MMIO at all. Of course it's wrong in the sense that it's suboptimal. What we would really like is to have, on UP, exactly the same barrier as on SMP. This is because a UP guest can run on an SMP h...
2016 Jan 10
48
[PATCH v3 00/41] arch: barrier cleanup + barriers for virt
...e to arch maintainers: please don't cherry-pick patches out of this patchset as it's been structured in this order to avoid breaking bisect. Please send acks instead! ===== Sometimes, virtualization is weird. For example, virtio does this (conceptually): #ifdef CONFIG_SMP smp_mb(); #else mb(); #endif Similarly, Xen calls mb() when it's not doing any MMIO at all. Of course it's wrong in the sense that it's suboptimal. What we would really like is to have, on UP, exactly the same barrier as on SMP. This is because a UP guest can run on an SMP h...
2016 Jan 10
48
[PATCH v3 00/41] arch: barrier cleanup + barriers for virt
...e to arch maintainers: please don't cherry-pick patches out of this patchset as it's been structured in this order to avoid breaking bisect. Please send acks instead! ===== Sometimes, virtualization is weird. For example, virtio does this (conceptually): #ifdef CONFIG_SMP smp_mb(); #else mb(); #endif Similarly, Xen calls mb() when it's not doing any MMIO at all. Of course it's wrong in the sense that it's suboptimal. What we would really like is to have, on UP, exactly the same barrier as on SMP. This is because a UP guest can run on an SMP h...
2020 Jul 02
2
[PATCH 5/8] powerpc/64s: implement queued spinlocks and rwlocks
...ck.h > @@ -0,0 +1,20 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _ASM_POWERPC_QSPINLOCK_H > +#define _ASM_POWERPC_QSPINLOCK_H > + > +#include <asm-generic/qspinlock_types.h> > + > +#define _Q_PENDING_LOOPS (1 << 9) /* not tuned */ > + > +#define smp_mb__after_spinlock() smp_mb() > + > +static __always_inline int queued_spin_is_locked(struct qspinlock *lock) > +{ > + smp_mb(); > + return atomic_read(&lock->val); > +} Why do you need the smp_mb() here? Will
2020 Jul 02
2
[PATCH 5/8] powerpc/64s: implement queued spinlocks and rwlocks
...ck.h > @@ -0,0 +1,20 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +#ifndef _ASM_POWERPC_QSPINLOCK_H > +#define _ASM_POWERPC_QSPINLOCK_H > + > +#include <asm-generic/qspinlock_types.h> > + > +#define _Q_PENDING_LOOPS (1 << 9) /* not tuned */ > + > +#define smp_mb__after_spinlock() smp_mb() > + > +static __always_inline int queued_spin_is_locked(struct qspinlock *lock) > +{ > + smp_mb(); > + return atomic_read(&lock->val); > +} Why do you need the smp_mb() here? Will
2016 Jan 04
3
[PATCH v2 06/32] s390: reuse asm-generic/barrier.h
On Thu, Dec 31, 2015 at 09:06:30PM +0200, Michael S. Tsirkin wrote: > On s390 read_barrier_depends, smp_read_barrier_depends > smp_store_mb(), smp_mb__before_atomic and smp_mb__after_atomic match the > asm-generic variants exactly. Drop the local definitions and pull in > asm-generic/barrier.h instead. > > This is in preparation to refactoring this code area. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> &gt...
2016 Jan 04
3
[PATCH v2 06/32] s390: reuse asm-generic/barrier.h
On Thu, Dec 31, 2015 at 09:06:30PM +0200, Michael S. Tsirkin wrote: > On s390 read_barrier_depends, smp_read_barrier_depends > smp_store_mb(), smp_mb__before_atomic and smp_mb__after_atomic match the > asm-generic variants exactly. Drop the local definitions and pull in > asm-generic/barrier.h instead. > > This is in preparation to refactoring this code area. > > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> &gt...
2017 Oct 27
1
[PATCH v6] x86: use lock+addl for smp_mb()
...- which avoids this problem since we build with the red zone disabled. For userspace, use an address just below the redzone. The one difference between lock+add and mfence is that lock+addl does not affect clflush, previous patches converted all uses of clflush to call mb(), such that changes to smp_mb won't affect it. Update mb/rmb/wmb on 32 bit to use the negative offset, too, for consistency. As a follow-up, it might be worth considering switching users of clflush to another API (e.g. clflush_mb?) - we will then be able to convert mb to smp_mb. Also arguably, gcc should switch to use lo...
2017 Oct 27
1
[PATCH v6] x86: use lock+addl for smp_mb()
...- which avoids this problem since we build with the red zone disabled. For userspace, use an address just below the redzone. The one difference between lock+add and mfence is that lock+addl does not affect clflush, previous patches converted all uses of clflush to call mb(), such that changes to smp_mb won't affect it. Update mb/rmb/wmb on 32 bit to use the negative offset, too, for consistency. As a follow-up, it might be worth considering switching users of clflush to another API (e.g. clflush_mb?) - we will then be able to convert mb to smp_mb. Also arguably, gcc should switch to use lo...