diff options
| author | Paolo Bonzini | 2018-08-14 09:57:16 +0200 |
|---|---|---|
| committer | Paolo Bonzini | 2018-08-23 18:46:25 +0200 |
| commit | 94377115b2458506579907f3ebf1ffbfea12b216 (patch) | |
| tree | 401e56cc1152cca4c83e59cc8d70855285f68011 /include | |
| parent | seqlock: add QemuLockable support (diff) | |
| download | qemu-94377115b2458506579907f3ebf1ffbfea12b216.tar.gz qemu-94377115b2458506579907f3ebf1ffbfea12b216.tar.xz qemu-94377115b2458506579907f3ebf1ffbfea12b216.zip | |
cpus: protect TimerState writes with a spinlock
In the next patch, we will need to write cpu_ticks_offset from any
thread, even outside the BQL. Currently, it is protected by the BQL
just because cpu_enable_ticks and cpu_disable_ticks happen to hold it,
but the critical sections are well delimited and it's easy to remove
the BQL dependency.
Add a spinlock that matches vm_clock_seqlock, and hold it when writing
to the TimerState. This also lets us fix cpu_update_icount when 64-bit
atomics are not available.
Fields of TiemrState are reordered to avoid padding.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
