Re: [PATCH 0/3] virtio/vringh: kill off ACCESS_ONCE()

From
Peter Zijlstra <peterz@infradead.org>
Date
2016-11-25 12:44:22
Also in
kvm, lkml, virtualization
Reply to
Peter Zijlstra, 2016-11-25
On Fri, Nov 25, 2016 at 01:40:44PM +0100, Peter Zijlstra wrote:
#define SINGLE_LOAD(x)						\
{(								\
	compiletime_assert_atomic_type(typeof(x));		\
Should be:

	compiletime_assert_atomic_type(x);
	WARN_SINGLE_COPY_ALIGNMENT(&(x));			\
	READ_ONCE(x);						\
})

#define SINGLE_STORE(x, v)					\
({								\
	compiletime_assert_atomic_type(typeof(x));		\
idem
	WARN_SINGLE_COPY_ALIGNMENT(&(x));			\
	WRITE_ONCE(x, v);					\
})
Thread (34 messages) 34 messages, 9 authors, last reply 2016-11-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help