Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Pull virtio barrier rework+fixes from Michael Tsirkin: "This adds a new kind of barrier, and reworks virtio and xen to use it. Plus some fixes here and there" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (44 commits) checkpatch: add virt barriers checkpatch: check for __smp outside barrier.h checkpatch.pl: add missing memory barriers virtio: make find_vqs() checkpatch.pl-friendly virtio_balloon: fix race between migration and ballooning virtio_balloon: fix race by fill and leak s390: more efficient smp barriers s390: use generic memory barriers xen/events: use virt_xxx barriers xen/io: use virt_xxx barriers xenbus: use virt_xxx barriers virtio_ring: use virt_store_mb sh: move xchg_cmpxchg to a header by itself sh: support 1 and 2 byte xchg virtio_ring: update weak barriers to use virt_xxx Revert "virtio_ring: Update weak barriers to use dma_wmb/rmb" asm-generic: implement virt_xxx memory barriers x86: define __smp_xxx xtensa: define __smp_xxx tile: define __smp_xxx ...
This commit is contained in:
@@ -70,7 +70,7 @@ struct virtio_config_ops {
|
||||
int (*find_vqs)(struct virtio_device *, unsigned nvqs,
|
||||
struct virtqueue *vqs[],
|
||||
vq_callback_t *callbacks[],
|
||||
const char *names[]);
|
||||
const char * const names[]);
|
||||
void (*del_vqs)(struct virtio_device *);
|
||||
u64 (*get_features)(struct virtio_device *vdev);
|
||||
int (*finalize_features)(struct virtio_device *vdev);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
* anyone care?
|
||||
*
|
||||
* For virtio_pci on SMP, we don't need to order with respect to MMIO
|
||||
* accesses through relaxed memory I/O 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
|
||||
@@ -23,18 +23,16 @@
|
||||
|
||||
static inline void virtio_mb(bool weak_barriers)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
if (weak_barriers)
|
||||
smp_mb();
|
||||
virt_mb();
|
||||
else
|
||||
#endif
|
||||
mb();
|
||||
}
|
||||
|
||||
static inline void virtio_rmb(bool weak_barriers)
|
||||
{
|
||||
if (weak_barriers)
|
||||
dma_rmb();
|
||||
virt_rmb();
|
||||
else
|
||||
rmb();
|
||||
}
|
||||
@@ -42,11 +40,22 @@ static inline void virtio_rmb(bool weak_barriers)
|
||||
static inline void virtio_wmb(bool weak_barriers)
|
||||
{
|
||||
if (weak_barriers)
|
||||
dma_wmb();
|
||||
virt_wmb();
|
||||
else
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
struct virtio_device;
|
||||
struct virtqueue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user