[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 09/19] tcg: handle EXCP_ATOMIC exception for syst
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v6 09/19] tcg: handle EXCP_ATOMIC exception for system emulation |
Date: |
Wed, 9 Nov 2016 14:57:38 +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>
---
cpus.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/cpus.c b/cpus.c
index b8d8b87..1ebe518 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1315,6 +1315,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) {
@@ -1385,6 +1390,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.10.1
- [Qemu-devel] [PATCH v6 00/19] Remaining MTTCG Base patches and ARM enablement, Alex Bennée, 2016/11/09
- [Qemu-devel] [PATCH v6 01/19] docs: new design document multi-thread-tcg.txt, Alex Bennée, 2016/11/09
- [Qemu-devel] [PATCH v6 03/19] tcg: add kick timer for single-threaded vCPU emulation, Alex Bennée, 2016/11/09
- [Qemu-devel] [PATCH v6 04/19] tcg: rename tcg_current_cpu to tcg_current_rr_cpu, Alex Bennée, 2016/11/09
- [Qemu-devel] [PATCH v6 05/19] tcg: drop global lock during TCG code execution, Alex Bennée, 2016/11/09
- [Qemu-devel] [PATCH v6 09/19] tcg: handle EXCP_ATOMIC exception for system emulation,
Alex Bennée <=
- [Qemu-devel] [PATCH v6 02/19] tcg: add options for enabling MTTCG, Alex Bennée, 2016/11/09
- [Qemu-devel] [PATCH v6 08/19] tcg: enable thread-per-vCPU, Alex Bennée, 2016/11/09
- [Qemu-devel] [PATCH v6 06/19] tcg: remove global exit_request, Alex Bennée, 2016/11/09
- [Qemu-devel] [PATCH v6 12/19] cputlb: tweak qemu_ram_addr_from_host_nofail reporting, Alex Bennée, 2016/11/09
- [Qemu-devel] [PATCH v6 07/19] tcg: enable tb_lock() for SoftMMU, Alex Bennée, 2016/11/09
- [Qemu-devel] [PATCH v6 10/19] cputlb: add assert_cpu_is_self checks, Alex Bennée, 2016/11/09