virtio: barrier rework+fixes
Subsystems (5)
Michael S. Tsirkin
maintainerThe following changes since commit afd2ff9b7e1b367172f18ba7f693dfb62bdcb2dc:
Linux 4.4 (2016-01-10 15:01:32 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus
for you to fetch changes up to 43e361f23c49dbddf74f56ddf6cdd85c5dbff6da:
checkpatch: add virt barriers (2016-01-12 20:47:08 +0200)
----------------------------------------------------------------
virtio: barrier rework+fixes
This adds a new kind of barrier, and reworks virtio and xen to use it.
Plus some fixes here and there.
----------------------------------------------------------------
Yes I know that the patch by Davidlohr Bueso has a typo in the subject :(
Davidlohr Bueso (1):
lcoking/barriers, arch: Use smp barriers in smp_store_release()
Michael S. Tsirkin (40):
asm-generic: guard smp_store_release/load_acquire
ia64: rename nop->iosapic_nop
ia64: reuse asm-generic/barrier.h
powerpc: reuse asm-generic/barrier.h
s390: reuse asm-generic/barrier.h
sparc: reuse asm-generic/barrier.h
arm: reuse asm-generic/barrier.h
arm64: reuse asm-generic/barrier.h
metag: reuse asm-generic/barrier.h
mips: reuse asm-generic/barrier.h
x86/um: reuse asm-generic/barrier.h
x86: reuse asm-generic/barrier.h
asm-generic: add __smp_xxx wrappers
powerpc: define __smp_xxx
arm64: define __smp_xxx
arm: define __smp_xxx
blackfin: define __smp_xxx
ia64: define __smp_xxx
metag: define __smp_xxx
mips: define __smp_xxx
s390: define __smp_xxx
sh: define __smp_xxx, fix smp_store_mb for !SMP
sparc: define __smp_xxx
tile: define __smp_xxx
xtensa: define __smp_xxx
x86: define __smp_xxx
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
checkpatch: add virt barriers
Minchan Kim (2):
virtio_balloon: fix race by fill and leak
virtio_balloon: fix race between migration and ballooning
Stefan Hajnoczi (1):
virtio: make find_vqs() checkpatch.pl-friendly
arch/arm/include/asm/barrier.h | 35 ++--------- arch/arm64/include/asm/barrier.h | 19 ++---- arch/blackfin/include/asm/barrier.h | 4 +- arch/ia64/include/asm/barrier.h | 24 +++----- arch/metag/include/asm/barrier.h | 55 +++++------------ arch/mips/include/asm/barrier.h | 51 +++++----------- arch/powerpc/include/asm/barrier.h | 33 ++++------ arch/s390/include/asm/barrier.h | 23 ++++--- arch/sh/include/asm/barrier.h | 3 +- arch/sh/include/asm/cmpxchg-grb.h | 22 +++++++ arch/sh/include/asm/cmpxchg-irq.h | 11 ++++ arch/sh/include/asm/cmpxchg-llsc.h | 25 +------- arch/sh/include/asm/cmpxchg-xchg.h | 51 ++++++++++++++++ arch/sh/include/asm/cmpxchg.h | 3 + arch/sparc/include/asm/barrier_32.h | 1 - arch/sparc/include/asm/barrier_64.h | 29 ++------- arch/sparc/include/asm/processor.h | 3 - arch/tile/include/asm/barrier.h | 9 +-- arch/x86/include/asm/barrier.h | 36 +++++------ arch/x86/um/asm/barrier.h | 9 +-- arch/xtensa/include/asm/barrier.h | 4 +- drivers/virtio/virtio_pci_common.h | 2 +- include/asm-generic/barrier.h | 106 ++++++++++++++++++++++++++++++--- include/linux/virtio_config.h | 2 +- include/linux/virtio_ring.h | 21 +++++-- include/xen/interface/io/ring.h | 16 ++--- arch/ia64/kernel/iosapic.c | 6 +- drivers/gpu/drm/virtio/virtgpu_kms.c | 2 +- drivers/misc/mic/card/mic_virtio.c | 2 +- drivers/remoteproc/remoteproc_virtio.c | 2 +- drivers/rpmsg/virtio_rpmsg_bus.c | 2 +- drivers/s390/virtio/kvm_virtio.c | 2 +- drivers/s390/virtio/virtio_ccw.c | 2 +- drivers/virtio/virtio_balloon.c | 4 +- drivers/virtio/virtio_input.c | 2 +- drivers/virtio/virtio_mmio.c | 2 +- drivers/virtio/virtio_pci_common.c | 4 +- drivers/virtio/virtio_pci_modern.c | 2 +- drivers/virtio/virtio_ring.c | 15 +++-- drivers/xen/events/events_fifo.c | 3 +- drivers/xen/xenbus/xenbus_comms.c | 8 +-- mm/balloon_compaction.c | 4 +- Documentation/memory-barriers.txt | 28 +++++++-- scripts/checkpatch.pl | 33 +++++++++- 44 files changed, 401 insertions(+), 319 deletions(-) create mode 100644 arch/sh/include/asm/cmpxchg-xchg.h
Michael S. Tsirkin
maintainervirtio pull for 4.5 (was Re: [PULL] virtio: barrier rework+fixes)
Hi Linus,
Just making sure nothing's wrong with this pull request. If there's an issue, pls let me know!
Thanks!
Quoted 123 lines · Michael S. Tsirkin
The following changes since commit
afd2ff9b7e1b367172f18ba7f693dfb62bdcb2dc:Linux 4.4 (2016-01-10 15:01:32 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.gittags/for_linusfor you to fetch changes up to
43e361f23c49dbddf74f56ddf6cdd85c5dbff6da:checkpatch: add virt barriers (2016-01-12 20:47:08 +0200)
----------------------------------------------------------------
virtio: barrier rework+fixesThis adds a new kind of barrier, and reworks virtio and xen to use it.
Plus some fixes here and there.Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Yes I know that the patch by Davidlohr Bueso has a typo in the subject :(
Davidlohr Bueso (1):
lcoking/barriers, arch: Use smp barriers insmp_store_release()Michael S. Tsirkin (40):
asm-generic: guard smp_store_release/load_acquire
ia64: renamenop->iosapic_nop
ia64: reuseasm-generic/barrier.h
powerpc: reuseasm-generic/barrier.h
s390: reuseasm-generic/barrier.h
sparc: reuseasm-generic/barrier.h
arm: reuseasm-generic/barrier.h
arm64: reuseasm-generic/barrier.h
metag: reuseasm-generic/barrier.h
mips: reuseasm-generic/barrier.h
x86/um: reuseasm-generic/barrier.h
x86: reuseasm-generic/barrier.h
asm-generic: add__smp_xxxwrappers
powerpc: define__smp_xxx
arm64: define__smp_xxx
arm: define__smp_xxx
blackfin: define__smp_xxx
ia64: define__smp_xxx
metag: define__smp_xxx
mips: define__smp_xxx
s390: define__smp_xxx
sh: define__smp_xxx, fixsmp_store_mbfor !SMP
sparc: define__smp_xxx
tile: define__smp_xxx
xtensa: define__smp_xxx
x86: define__smp_xxx
asm-generic: implementvirt_xxxmemory barriers Revert "virtio_ring: Update weak barriers to use dma_wmb/rmb"
virtio_ring: update weak barriers to usevirt_xxx
sh: support 1 and 2 byte xchg
sh: movexchg_cmpxchgto a header by itself
virtio_ring: usevirt_store_mb
xenbus: usevirt_xxxbarriers
xen/io: usevirt_xxxbarriers
xen/events: usevirt_xxxbarriers
s390: use generic memory barriers
s390: more efficient smp barriers
checkpatch.pl: add missing memory barriers
checkpatch: check for__smpoutsidebarrier.h
checkpatch: add virt barriersMinchan Kim (2):
virtio_balloon: fix race by fill and leak
virtio_balloon: fix race between migration and ballooningStefan Hajnoczi (1):
virtio: makefind_vqs()checkpatch.pl-friendlyarch/arm/include/asm/barrier.h | 35 ++--------- arch/arm64/include/asm/barrier.h | 19 ++---- arch/blackfin/include/asm/barrier.h | 4 +- arch/ia64/include/asm/barrier.h | 24 +++----- arch/metag/include/asm/barrier.h | 55 +++++------------ arch/mips/include/asm/barrier.h | 51 +++++----------- arch/powerpc/include/asm/barrier.h | 33 ++++------ arch/s390/include/asm/barrier.h | 23 ++++--- arch/sh/include/asm/barrier.h | 3 +- arch/sh/include/asm/cmpxchg-grb.h | 22 +++++++ arch/sh/include/asm/cmpxchg-irq.h | 11 ++++ arch/sh/include/asm/cmpxchg-llsc.h | 25 +------- arch/sh/include/asm/cmpxchg-xchg.h | 51 ++++++++++++++++ arch/sh/include/asm/cmpxchg.h | 3 + arch/sparc/include/asm/barrier_32.h | 1 - arch/sparc/include/asm/barrier_64.h | 29 ++------- arch/sparc/include/asm/processor.h | 3 - arch/tile/include/asm/barrier.h | 9 +-- arch/x86/include/asm/barrier.h | 36 +++++------ arch/x86/um/asm/barrier.h | 9 +-- arch/xtensa/include/asm/barrier.h | 4 +- drivers/virtio/virtio_pci_common.h | 2 +- include/asm-generic/barrier.h | 106 ++++++++++++++++++++++++++++++--- include/linux/virtio_config.h | 2 +- include/linux/virtio_ring.h | 21 +++++-- include/xen/interface/io/ring.h | 16 ++--- arch/ia64/kernel/iosapic.c | 6 +- drivers/gpu/drm/virtio/virtgpu_kms.c | 2 +- drivers/misc/mic/card/mic_virtio.c | 2 +- drivers/remoteproc/remoteproc_virtio.c | 2 +- drivers/rpmsg/virtio_rpmsg_bus.c | 2 +- drivers/s390/virtio/kvm_virtio.c | 2 +- drivers/s390/virtio/virtio_ccw.c | 2 +- drivers/virtio/virtio_balloon.c | 4 +- drivers/virtio/virtio_input.c | 2 +- drivers/virtio/virtio_mmio.c | 2 +- drivers/virtio/virtio_pci_common.c | 4 +- drivers/virtio/virtio_pci_modern.c | 2 +- drivers/virtio/virtio_ring.c | 15 +++-- drivers/xen/events/events_fifo.c | 3 +- drivers/xen/xenbus/xenbus_comms.c | 8 +-- mm/balloon_compaction.c | 4 +- Documentation/memory-barriers.txt | 28 +++++++-- scripts/checkpatch.pl | 33 +++++++++- 44 files changed, 401 insertions(+), 319 deletions(-) create mode 100644 arch/sh/include/asm/cmpxchg-xchg.h
Re: virtio pull for 4.5 (was Re: [PULL] virtio: barrier rework+fixes)
Quoted 5 lines · Michael S. Tsirkin
Hi Linus,
Just making sure nothing's wrong with this pull request. If there's an issue, pls let me know!
Thanks!
Quoted 28 lines
Quoted 27 lines · Michael S. Tsirkin
The following changes since commit
afd2ff9b7e1b367172f18ba7f693dfb62bdcb2dc:Linux 4.4 (2016-01-10 15:01:32 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.gittags/for_linusfor you to fetch changes up to
43e361f23c49dbddf74f56ddf6cdd85c5dbff6da:checkpatch: add virt barriers (2016-01-12 20:47:08 +0200)
----------------------------------------------------------------
virtio: barrier rework+fixesThis adds a new kind of barrier, and reworks virtio and xen to use it.
Plus some fixes here and there.Signed-off-by Michael S. Tsirkin <[email protected]>----------------------------------------------------------------
Yes I know that the patch by Davidlohr Bueso has a typo in the subject :(
Davidlohr Bueso (1):
lcoking/barriers, arch: Use smp barriers insmp_store_release()
fyi this arrived in Linus' tree through Ingo's pull request for -tip:
Re: virtio pull for 4.5 (was Re: [PULL] virtio: barrier rework+fixes)
In reply to Michael S. TsirkinQuoted 3 lines · Michael S. Tsirkin
Hi Linus,
Just making sure nothing's wrong with this pull request. If there's an issue, pls let me know!
It was just pulled because I wasn't 100% sure I wanted the extra indirection. Oh well, pulled now.
One question:
- the arch/sh/ part of the pacth looks dubious. Why does it do that
#define smp_store_mb(var, value) __smp_store_mb(var, value)
despite the commit log saying it's done by asm-generic?
I haven't pushed out yet, my allmodconfig sanity-check build is still going..
Linus
Michael S. Tsirkin
maintainerRe: virtio pull for 4.5 (was Re: [PULL] virtio: barrier rework+fixes)
Quoted 12 lines · Linus Torvalds
Quoted 3 lines · Michael S. Tsirkin
Hi Linus,
Just making sure nothing's wrong with this pull request. If there's an issue, pls let me know!It was just pulled because I wasn't 100% sure I wanted the extra indirection. Oh well, pulled now.
One question:
- the
arch/sh/part of the pacth looks dubious. Why does it do that
Quoted 7 lines
#define smp_store_mb(var, value) __smp_store_mb(var, value)despite the commit log saying it's done by asm-generic?
I haven't pushed out yet, my allmodconfig sanity-check build is still going..
Linus
Oh that's because that's what the existing code did, so the original version of the patch left the bug in place. I wanted to include the fix and I wrote this in the commit message, but I forgot to include it in the code :(
Thankfully this just means that the commit log is wrong, the code is just unchanged from 4.4, and I'll include a fix in my tree shortly.
Signature · 1 line
MST
Re: virtio pull for 4.5 (was Re: [PULL] virtio: barrier rework+fixes)
In reply to Michael S. TsirkinQuoted 3 lines · Michael S. Tsirkin
Hi Linus,
Just making sure nothing's wrong with this pull request. If there's an issue, pls let me know!
It was just pulled because I wasn't 100% sure I wanted the extra indirection. Oh well, pulled now.
One question:
- the arch/sh/ part of the pacth looks dubious. Why does it do that
#define smp_store_mb(var, value) __smp_store_mb(var, value)
despite the commit log saying it's done by asm-generic?
I haven't pushed out yet, my allmodconfig sanity-check build is still going..
Linus