[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 12/25] tcg: handle EXCP_ATOMIC exception for syst
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v8 12/25] tcg: handle EXCP_ATOMIC exception for system emulation |
Date: |
Fri, 27 Jan 2017 10:39:09 +0000 |
From: Pranith Kumar <address@hidden>
The patch enables handling atomic code in the guest. This should be
preferably done in cpu_handle_exception(), but the current assumptions
regarding when we can execute atomic sections cause a deadlock.
Signed-off-by: Pranith Kumar <address@hidden>
[AJB: tweak title]
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
cpus.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/cpus.c b/cpus.c
index ecd1ec08d3..e3d9f3fe21 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1346,6 +1346,11 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg)
if (r == EXCP_DEBUG) {
cpu_handle_guest_debug(cpu);
break;
+ } else if (r == EXCP_ATOMIC) {
+ qemu_mutex_unlock_iothread();
+ cpu_exec_step_atomic(cpu);
+ qemu_mutex_lock_iothread();
+ break;
}
} else if (cpu->stop) {
if (cpu->unplug) {
@@ -1456,6 +1461,10 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
*/
g_assert(cpu->halted);
break;
+ case EXCP_ATOMIC:
+ qemu_mutex_unlock_iothread();
+ cpu_exec_step_atomic(cpu);
+ qemu_mutex_lock_iothread();
default:
/* Ignore everything else? */
break;
--
2.11.0
- Re: [Qemu-devel] [PATCH v8 15/25] cputlb: introduce tlb_flush_* async work., (continued)
- [Qemu-devel] [PATCH v8 14/25] cputlb: tweak qemu_ram_addr_from_host_nofail reporting, Alex Bennée, 2017/01/27
- [Qemu-devel] [PATCH v8 20/25] target-arm/powerctl: defer cpu reset work to CPU context, Alex Bennée, 2017/01/27
- [Qemu-devel] [PATCH v8 12/25] tcg: handle EXCP_ATOMIC exception for system emulation,
Alex Bennée <=
- [Qemu-devel] [PATCH v8 06/25] tcg: add kick timer for single-threaded vCPU emulation, Alex Bennée, 2017/01/27
- [Qemu-devel] [PATCH v8 09/25] tcg: remove global exit_request, Alex Bennée, 2017/01/27
- [Qemu-devel] [PATCH v8 16/25] cputlb and arm/sparc targets: convert mmuidx flushes from varg to bitmap, Alex Bennée, 2017/01/27
- [Qemu-devel] [PATCH v8 22/25] target-arm/cpu.h: make ARM_CP defined consistent, Alex Bennée, 2017/01/27
- [Qemu-devel] [PATCH v8 18/25] cputlb: atomically update tlb fields used by tlb_reset_dirty, Alex Bennée, 2017/01/27
- [Qemu-devel] [PATCH v8 23/25] target-arm: introduce ARM_CP_EXIT_PC, Alex Bennée, 2017/01/27
- [Qemu-devel] [PATCH v8 24/25] target-arm: ensure all cross vCPUs TLB flushes complete, Alex Bennée, 2017/01/27