cmm: do not generate code for smp_rmb/smp_wmb on x86_64
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 10 Sep 2011 19:29:56 +0000 (12:29 -0700)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 10 Sep 2011 19:29:56 +0000 (12:29 -0700)
commit4e029f656588009dec8ce6c47e57b11e658bf2d5
tree207b723831d946c8f140428cb492377cd626db95
parent0bd48ad389868e7b98f14fb88f9b4a81ff93b6d0
cmm: do not generate code for smp_rmb/smp_wmb on x86_64

We can assume, on x86, that no accesses to write-combining memory occur,
and also that there are no non-temporal load/stores (people would
presumably write those with assembly or intrinsics and put appropriate
lfence/sfence manually). In this case rmb and wmb are no-ops on x86.
according to the updated x86 memory models:

INTEL CORPORATION. Intel 64 Architecture Memory Ordering White Paper,
2007.
http://developer.intel.com/products/processor/manuals/318147.pdf

ADVANCED MICRO DEVICES. AMD x86-64 Architecture Programmer’s Manual
Volume 2: System Programming, 2007.

Paul E. McKenney. Memory Ordering in Modern Microprocessors
www.rdrop.com/users/paulmck/scalability/paper/ordering.2007.09.19a.pdf

x86 does not reorder loads vs loads, and stores vs stores when using
normal memory accesses, with the notable exceptions of Pentium Pro
(reorders reads) and WinChip (reorders writes). Therefore, it is safe
not to emit fence instructions for x86_64 cmm_smp_rmb()/cmm_smp_wmb(),
but we leave the memory fences in place for x86_32 for those two
special-cases.

Define cmm_smp_rmb and cmm_smp_wmb to be the "common" operations that
do not require fence instruction, while leaving cmm_rmb and cmm_wmb in
place for more sophisticated uses.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/arch/x86.h
This page took 0.025456 seconds and 4 git commands to generate.