Updated host/vhost/vhost.h to use READ_ONCE() macro instead of ACCESS_ONCE().
authorAaron Taylor <ataylor@subgeniuskitty.com>
Fri, 30 Apr 2021 21:14:40 +0000 (14:14 -0700)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Fri, 30 Apr 2021 21:14:40 +0000 (14:14 -0700)
See also:

  - https://github.com/torvalds/linux/commit/b899a850431e2dd0943205a63a68573f3e312d0d

host/vhost/vhost.h

index 9bb1653..c478391 100644 (file)
@@ -206,20 +206,9 @@ int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq);
        } while (0)
 
 #ifndef __rcu_dereference_index_check
        } while (0)
 
 #ifndef __rcu_dereference_index_check
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0))
 #define __rcu_dereference_index_check(p, c) \
        ({ \
 #define __rcu_dereference_index_check(p, c) \
        ({ \
-        typeof(p) _________p1 = ACCESS_ONCE(p); \
-        rcu_lockdep_assert(c, \
-                "suspicious rcu_dereference_index_check()" \
-                " usage"); \
-        smp_read_barrier_depends(); \
-        (_________p1); \
-        })
-#else
-#define __rcu_dereference_index_check(p, c) \
-       ({ \
-        typeof(p) _________p1 = ACCESS_ONCE(p); \
+        typeof(p) _________p1 = READ_ONCE(p); \
         RCU_LOCKDEP_WARN(c, \
                 "suspicious rcu_dereference_index_check()" \
                 " usage"); \
         RCU_LOCKDEP_WARN(c, \
                 "suspicious rcu_dereference_index_check()" \
                 " usage"); \
@@ -227,7 +216,6 @@ int vhost_zerocopy_signal_used(struct vhost_virtqueue *vq);
         (_________p1); \
        })
 #endif
         (_________p1); \
        })
 #endif
-#endif
 
 enum {
        VHOST_FEATURES = (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |
 
 enum {
        VHOST_FEATURES = (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) |