Displaying 5 results from an estimated 5 matches for "virtio_load_acquire".
Did you mean:
virt_load_acquire
2015 Dec 17
2
[PATCH] virtio: use smp_load_acquire/smp_store_release
...+), 10 deletions(-)
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index 8e50888..0135c16 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -47,6 +47,36 @@ static inline void virtio_wmb(bool weak_barriers)
wmb();
}
+static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p)
+{
+ if (!weak_barriers) {
+ rmb();
+ return READ_ONCE(*p);
+ }
+#ifdef CONFIG_SMP
+ return smp_load_acquire(p);
+#else
+ dma_rmb();
+ return READ_ONCE(*p);
+#endif
+}
+
+static inline void virtio_store_release(bool weak_barriers,
+ __virtio16 *p, __virtio16...
2015 Dec 17
2
[PATCH] virtio: use smp_load_acquire/smp_store_release
...+), 10 deletions(-)
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index 8e50888..0135c16 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -47,6 +47,36 @@ static inline void virtio_wmb(bool weak_barriers)
wmb();
}
+static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p)
+{
+ if (!weak_barriers) {
+ rmb();
+ return READ_ONCE(*p);
+ }
+#ifdef CONFIG_SMP
+ return smp_load_acquire(p);
+#else
+ dma_rmb();
+ return READ_ONCE(*p);
+#endif
+}
+
+static inline void virtio_store_release(bool weak_barriers,
+ __virtio16 *p, __virtio16...
2015 Dec 17
0
[PATCH] virtio: use smp_load_acquire/smp_store_release
On Thu, Dec 17, 2015 at 12:29:03PM +0200, Michael S. Tsirkin wrote:
> +static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p)
> +{
> + if (!weak_barriers) {
> + rmb();
> + return READ_ONCE(*p);
> + }
> +#ifdef CONFIG_SMP
> + return smp_load_acquire(p);
> +#else
> + dma_rmb();
> + return READ_ONCE(*p);
> +#endif
> +}
This too is wrong. Look for examp...
2015 Dec 17
4
[PATCH] virtio_ring: use smp_store_mb
...ine void virtio_wmb(bool weak_barriers)
wmb();
}
+static inline void virtio_store_mb(bool weak_barriers,
+ __virtio16 *p, __virtio16 v)
+{
+#ifdef CONFIG_SMP
+ if (weak_barriers)
+ smp_store_mb(*p, v);
+ else
+#endif
+ {
+ WRITE_ONCE(*p, v);
+ mb();
+ }
+}
+
static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p)
{
if (!weak_barriers) {
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index f822cab..b0aea67 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -517,10 +517,10 @@ void *virtqueue_get_buf(struct virtqueue *...
2015 Dec 17
4
[PATCH] virtio_ring: use smp_store_mb
...ine void virtio_wmb(bool weak_barriers)
wmb();
}
+static inline void virtio_store_mb(bool weak_barriers,
+ __virtio16 *p, __virtio16 v)
+{
+#ifdef CONFIG_SMP
+ if (weak_barriers)
+ smp_store_mb(*p, v);
+ else
+#endif
+ {
+ WRITE_ONCE(*p, v);
+ mb();
+ }
+}
+
static inline __virtio16 virtio_load_acquire(bool weak_barriers, __virtio16 *p)
{
if (!weak_barriers) {
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index f822cab..b0aea67 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -517,10 +517,10 @@ void *virtqueue_get_buf(struct virtqueue *...