As discussed on LKML
ACCESS_ONCE might fail with specific compiler for non-scalar accesses.

Here is a set of patches to tackle that problem.

We first introduce READ_ONCE/ASSIGN_ONCE as suggested by Linus. These
wrappers will make all accesses via scalar wrappers and will also check
that accesses are <= the word size of the system.
The next changes will modify current users of ACCESS_ONCE on non-scalar
types to use READ_ONCE/ASSIGN_ONCE or barrier where necessary.
The 2nd to last patch will force ACCESS_ONCE to error-out if it is used
on non-scalar accesses.

The series is cross-compiled the resulting kernel with defconfig for
microblaze, m68k, alpha, s390,x86_64, i686, sparc, sparc64, mips,
ia64, arm and arm64.
KVM: s390: change ipte lock from barrier to READ_ONCE

Now that we have the READ_ONCE solution, we can change the ipte lock
from a barrier solution to READ_ONCE. The barrier and the explanation
of the bug was introduced in commit 1365039d0cb3 ("KVM: s390: Fix
ipte locking")

Cc: Paolo Bonzini <>
Signed-off-by: Christian Borntraeger <>
1 file changed