All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Prevent evaluation of WRITE_ONCE()
@ 2019-05-24 10:35 Andrea Parri
  2019-05-24 10:35 ` [PATCH 1/2] vmw_vmci: Clean up uses of atomic*_set() Andrea Parri
  2019-05-24 10:35 ` [PATCH 2/2] compiler: Prevent evaluation of WRITE_ONCE() Andrea Parri
  0 siblings, 2 replies; 9+ messages in thread
From: Andrea Parri @ 2019-05-24 10:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrea Parri, Arnd Bergmann, Greg Kroah-Hartman, Jorgen Hansen,
	Peter Zijlstra, Will Deacon, Mark Rutland, Paul E. McKenney

Hi all,

This all started when we realized that

  atomic64_t v;
  ...
  typeof(v.counter) my_val = atomic64_set(&v, VAL);

is a valid assignment on some architectures, but not on others [1]:
in particular, the assignment is valid on all architectures #define
-ing their atomic64_set() macro to WRITE_ONCE() (which is currently
evaluated).

Mark suggested to clean up all non-portable users of atomic*_set(),
and to prevent WRITE_ONCE() from being evaluated [2]; this resulted
in this first attempt/patchset based on Mark's atomics/type-cleanup
branch [3].

Cheers Andrea

[1] https://lkml.kernel.org/r/20190523083013.GA4616@andrea
[2] https://lkml.kernel.org/r/20190523141851.GA7523@lakrids.cambridge.arm.com
[3] git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git atomics/type-cleanup

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jorgen Hansen <jhansen@vmware.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>

Andrea Parri (2):
  vmw_vmci: Clean up uses of atomic*_set()
  compiler: Prevent evaluation of WRITE_ONCE()

 include/linux/compiler.h      | 5 ++---
 include/linux/vmw_vmci_defs.h | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-05-24 11:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-24 10:35 [PATCH 0/2] Prevent evaluation of WRITE_ONCE() Andrea Parri
2019-05-24 10:35 ` [PATCH 1/2] vmw_vmci: Clean up uses of atomic*_set() Andrea Parri
2019-05-24 10:39   ` Peter Zijlstra
2019-05-24 11:40     ` Greg Kroah-Hartman
2019-05-24 11:59       ` Andrea Parri
2019-05-24 11:56     ` Andrea Parri
2019-05-24 10:35 ` [PATCH 2/2] compiler: Prevent evaluation of WRITE_ONCE() Andrea Parri
2019-05-24 10:53   ` Mark Rutland
2019-05-24 11:24     ` Andrea Parri

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.