lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 30 Jun 2020 18:37:19 +0100
From:   Will Deacon <>
Cc:     Will Deacon <>,
        Sami Tolvanen <>,
        Nick Desaulniers <>,
        Kees Cook <>,
        Marco Elver <>,
        "Paul E. McKenney" <>,
        Josh Triplett <>,
        Matt Turner <>,
        Ivan Kokshaysky <>,
        Richard Henderson <>,
        Peter Zijlstra <>,
        Alan Stern <>,
        "Michael S. Tsirkin" <>,
        Jason Wang <>,
        Arnd Bergmann <>,
        Boqun Feng <>,
        Catalin Marinas <>,
        Mark Rutland <>,,,,
Subject: [PATCH 03/18] asm/rwonce: Allow __READ_ONCE to be overridden by the architecture

The meat and potatoes of READ_ONCE() is defined by the __READ_ONCE()
macro, which uses a volatile casts in an attempt to avoid tearing of
byte, halfword, word and double-word accesses. Allow this to be
overridden by the architecture code in the case that things like memory
barriers are also required.

Acked-by: Paul E. McKenney <>
Signed-off-by: Will Deacon <>
 include/asm-generic/rwonce.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/asm-generic/rwonce.h b/include/asm-generic/rwonce.h
index 92cc2f223cb3..f9dfa88fc04d 100644
--- a/include/asm-generic/rwonce.h
+++ b/include/asm-generic/rwonce.h
@@ -33,7 +33,9 @@
  * atomicity or dependency ordering guarantees. Note that this may result
  * in tears!
+#ifndef __READ_ONCE
 #define __READ_ONCE(x)	(*(const volatile __unqual_scalar_typeof(x) *)&(x))
 #define __READ_ONCE_SCALAR(x)						\
 ({									\

Powered by blists - more mailing lists