summaryrefslogtreecommitdiff
path: root/include/qom/cpu.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-07-10 12:32:32 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-09-09 15:34:55 +0200
commit376692b9dc6f02303ee07a4146d08d8727d79c0c (patch)
tree4e67dcac05713579e92b0a38935165e3cd2fd4e7 /include/qom/cpu.h
parent0c71d41e2aa3c7356500ae624166f3bb8c201aee (diff)
downloadqemu-376692b9dc6f02303ee07a4146d08d8727d79c0c.zip
cpus: protect work list with work_mutex
Protect the list of queued work items with something other than the BQL, as a preparation for running the work items outside it. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qom/cpu.h')
-rw-r--r--include/qom/cpu.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 2b4936ad2f..c3d610b988 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -243,6 +243,8 @@ struct kvm_run;
* @mem_io_pc: Host Program Counter at which the memory was accessed.
* @mem_io_vaddr: Target virtual address at which the memory was accessed.
* @kvm_fd: vCPU file descriptor for KVM.
+ * @work_mutex: Lock to prevent multiple access to queued_work_*.
+ * @queued_work_first: First asynchronous work pending.
*
* State of one CPU core or thread.
*/
@@ -263,7 +265,6 @@ struct CPUState {
uint32_t host_tid;
bool running;
struct QemuCond *halt_cond;
- struct qemu_work_item *queued_work_first, *queued_work_last;
bool thread_kicked;
bool created;
bool stop;
@@ -274,6 +275,9 @@ struct CPUState {
int64_t icount_extra;
sigjmp_buf jmp_env;
+ QemuMutex work_mutex;
+ struct qemu_work_item *queued_work_first, *queued_work_last;
+
AddressSpace *as;
struct AddressSpaceDispatch *memory_dispatch;
MemoryListener *tcg_as_listener;