[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/31] docs/atomics: update comparison with Linux
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 20/31] docs/atomics: update comparison with Linux |
Date: |
Fri, 27 May 2016 12:06:33 +0200 |
Over time, some differences between QEMU and Linux atomics are getting
smoothed. In particular, Linux grew atomic_fetch_or (and in general
the differences regarding RMW operations were not described accurately)
and smp_load_acquire/smp_store_release. Also, set_mb was renamed to
smp_store_mb(). Include these changes in the documentation.
Signed-off-by: Paolo Bonzini <address@hidden>
---
docs/atomics.txt | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/docs/atomics.txt b/docs/atomics.txt
index 67a27ad..c95950b 100644
--- a/docs/atomics.txt
+++ b/docs/atomics.txt
@@ -340,17 +340,27 @@ and memory barriers, and the equivalents in QEMU:
properly aligned.
No barriers are implied by atomic_read/set in either Linux or QEMU.
-- most atomic read-modify-write operations in Linux return void;
- in QEMU, all of them return the old value of the variable.
+- atomic read-modify-write operations in Linux are of three kinds:
+
+ atomic_OP returns void
+ atomic_OP_return returns new value of the variable
+ atomic_fetch_OP returns the old value of the variable
+ atomic_cmpxchg returns the old value of the variable
+
+ In QEMU, the second kind does not exist. Currently Linux has
+ atomic_fetch_or only. QEMU provides and, or, inc, dec, add, sub.
- different atomic read-modify-write operations in Linux imply
a different set of memory barriers; in QEMU, all of them enforce
sequential consistency, which means they imply full memory barriers
before and after the operation.
-- Linux does not have an equivalent of atomic_mb_read() and
- atomic_mb_set(). In particular, note that set_mb() is a little
- weaker than atomic_mb_set().
+- Linux does not have an equivalent of atomic_mb_set(). In particular,
+ note that smp_store_mb() is a little weaker than atomic_mb_set().
+ atomic_mb_read() compiles to the same instructions as Linux's
+ smp_load_acquire(), but this should be treated as an implementation
+ detail. If required, QEMU might later add atomic_load_acquire() and
+ atomic_store_release() macros.
SOURCES
--
2.5.5
- [Qemu-devel] [PULL 02/31] Revert "memory: Drop FlatRange.romd_mode", (continued)
- [Qemu-devel] [PULL 02/31] Revert "memory: Drop FlatRange.romd_mode", Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 07/31] hw/char: QOM'ify milkymist-uart.c, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 11/31] scsi: mptsas: infinite loop while fetching requests, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 13/31] scsi: megasas: initialise local configuration data buffer, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 14/31] scsi: megasas: check 'read_queue_head' index value, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 10/31] scsi: pvscsi: check command descriptor ring buffer size (CVE-2016-4952), Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 09/31] kvm_stat: Remove, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 12/31] scsi: megasas: use appropriate property buffer size, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 15/31] block/iscsi: avoid potential overflow of acb->task->cdb, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 18/31] atomics: emit an smp_read_barrier_depends() barrier only for Alpha and Thread Sanitizer, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 20/31] docs/atomics: update comparison with Linux,
Paolo Bonzini <=
- [Qemu-devel] [PULL 17/31] docs/atomics: update atomic_read/set comparison with Linux, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 16/31] bt: rewrite csrhci_write to avoid out-of-bounds writes, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 24/31] scsi-disk: add need_fua_emulation to SCSIDiskClass, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 19/31] atomics: do not emit consume barrier for atomic_rcu_read, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 21/31] xen-hvm: ignore background I/O sections, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 22/31] scsi-disk: introduce a common base class, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 25/31] scsi-disk: introduce scsi_disk_req_check_error, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 26/31] scsi-block: always use SG_IO, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 23/31] scsi-disk: introduce dma_readv and dma_writev, Paolo Bonzini, 2016/05/27
- [Qemu-devel] [PULL 27/31] scsi-generic: Merge block max xfer len in INQUIRY response, Paolo Bonzini, 2016/05/27