diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-08-14 09:31:58 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-08-23 18:46:25 +0200 |
commit | c1ff073cd88eddce5a0870791431878b96d08157 (patch) | |
tree | ffe953a1e92d208a9151bdf3c67cee4ea10a9a45 /qemu-nbd.c | |
parent | 900610e631c0371070aad4d9482fd42915166948 (diff) |
cpus: protect all icount computation with seqlock
Move the icount->ns computation to cpu_get_icount, and make
cpu_get_icount_locked return the raw value. This makes the
atomic_read__nocheck safe, because it now happens always inside a
seqlock and any torn reads will be retried. qemu_icount_bias and
icount_time_shift also need to be accessed with atomics. At the
same time, however, you don't need atomic_read within the writer,
because no concurrent writes are possible.
The fix to vmstate lets us keep the struct nicely packed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-nbd.c')
0 files changed, 0 insertions, 0 deletions