[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [mttcg RFC v4 1/6] cpus: async_run_on_cpu: kick only if nee
From: |
Alvise Rigo |
Subject: |
[Qemu-devel] [mttcg RFC v4 1/6] cpus: async_run_on_cpu: kick only if needed |
Date: |
Fri, 14 Aug 2015 17:55:27 +0200 |
In some unique situations a vCPU can be kicked even if it's not ready to
execute TCG code i.e. when current_tb has never been set before.
This can happen with the atomic stress test (not kvm-unit-test based),
where a vCPU can query some work to a not yet started vCPU.
Signed-off-by: Alvise Rigo <address@hidden>
---
cpus.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index f61530c..3d90142 100644
--- a/cpus.c
+++ b/cpus.c
@@ -935,7 +935,9 @@ void async_run_on_cpu(CPUState *cpu, void (*func)(void
*data), void *data)
wi->done = false;
qemu_mutex_unlock(&cpu->work_mutex);
- qemu_cpu_kick(cpu);
+ if (tcg_enabled() && (atomic_read(&cpu->tcg_exec_flag) == 1)) {
+ qemu_cpu_kick(cpu);
+ }
}
void async_run_safe_work_on_cpu(CPUState *cpu, void (*func)(void *data),
--
2.5.0
- [Qemu-devel] [mttcg RFC v4 0/6] Atomic slow-path for mttcg, Alvise Rigo, 2015/08/14
- [Qemu-devel] [mttcg RFC v4 4/6] softmmu_llsc_template.h: move to multithreading, Alvise Rigo, 2015/08/14
- [Qemu-devel] [mttcg RFC v4 1/6] cpus: async_run_on_cpu: kick only if needed,
Alvise Rigo <=
- [Qemu-devel] [mttcg RFC v4 2/6] cputlb: wrap tlb_flush with the a new function, Alvise Rigo, 2015/08/14
- [Qemu-devel] [mttcg RFC v4 3/6] exec: ram_addr: Fix exclusive bitmap accessor, Alvise Rigo, 2015/08/14
- [Qemu-devel] [mttcg RFC v4 6/6] target-arm: Use a runtime helper for excl accesses, Alvise Rigo, 2015/08/14
- [Qemu-devel] [mttcg RFC v4 5/6] softmmu_template.h: move to multithreading, Alvise Rigo, 2015/08/14