]> www.infradead.org Git - users/jedix/linux-maple.git/commit
asm-generic: add __smp_xxx wrappers
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 27 Dec 2015 11:50:07 +0000 (13:50 +0200)
committerSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Thu, 31 Aug 2017 17:26:20 +0000 (10:26 -0700)
commit6c5f73767ddfd1949c492441f9cd64d2a6e7d156
tree0e33395cea85f51f98f7ec77f5592eb173ed084a
parent5fc0a4629f9e0afe018d51b09cbe7ee6710e2112
asm-generic: add __smp_xxx wrappers

Orabug: 26668113

On !SMP, most architectures define their
barriers as compiler barriers.
On SMP, most need an actual barrier.

Make it possible to remove the code duplication for
!SMP by defining low-level __smp_xxx barriers
which do not depend on the value of SMP, then
use them from asm-generic conditionally.

Besides reducing code duplication, these low level APIs will also be
useful for virtualization, where a barrier is sometimes needed even if
!SMP since we might be talking to another kernel on the same SMP system.

Both virtio and Xen drivers will benefit.

The smp_xxx variants should use __smp_XXX ones or barrier() depending on
SMP, identically for all architectures.

We keep ifndef guards around them for now - once/if all
architectures are converted to use the generic
code, we'll be able to remove these.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
(cherry picked from commit a9e4252a9b147043142282ebb65da94dcb951e2a)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Conflicts:
include/asm-generic/barrier.h
include/asm-generic/barrier.h