You need to sign in or sign up before continuing.
提交 81931012 编写于 作者: D Davidlohr Bueso 提交者: Michael S. Tsirkin

tools/virtio: remove smp_read_barrier_depends()

This gets rid of the last references to smp_read_barrier_depends()
 which for the kernel side was removed in v5.9. The serialization
required for Alpha is done inside READ_ONCE() instead of having
users deal with it. Simply use a full barrier, the architecture
does not have rmb in the first place.
Signed-off-by: NDavidlohr Bueso <dave@stgolabs.net>
Message-Id: <20221128034347.990-3-dave@stgolabs.net>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: NXuan Zhuo <xuanzhuo@linux.alibaba.com>
上级 8aeac42d
...@@ -140,12 +140,6 @@ static inline void busy_wait(void) ...@@ -140,12 +140,6 @@ static inline void busy_wait(void)
#define smp_wmb() smp_release() #define smp_wmb() smp_release()
#endif #endif
#ifdef __alpha__
#define smp_read_barrier_depends() smp_acquire()
#else
#define smp_read_barrier_depends() do {} while(0)
#endif
static __always_inline static __always_inline
void __read_once_size(const volatile void *p, void *res, int size) void __read_once_size(const volatile void *p, void *res, int size)
{ {
...@@ -175,13 +169,22 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s ...@@ -175,13 +169,22 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
} }
} }
#ifdef __alpha__
#define READ_ONCE(x) \ #define READ_ONCE(x) \
({ \ ({ \
union { typeof(x) __val; char __c[1]; } __u; \ union { typeof(x) __val; char __c[1]; } __u; \
__read_once_size(&(x), __u.__c, sizeof(x)); \ __read_once_size(&(x), __u.__c, sizeof(x)); \
smp_read_barrier_depends(); /* Enforce dependency ordering from x */ \ smp_mb(); /* Enforce dependency ordering from x */ \
__u.__val; \ __u.__val; \
}) })
#else
#define READ_ONCE(x) \
({ \
union { typeof(x) __val; char __c[1]; } __u; \
__read_once_size(&(x), __u.__c, sizeof(x)); \
__u.__val; \
})
#endif
#define WRITE_ONCE(x, val) \ #define WRITE_ONCE(x, val) \
({ \ ({ \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册