qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] mttcg: Handle EXCP_ATOMIC exception
@ 2016-11-02 14:25 Pranith Kumar
  2016-11-02 16:22 ` Alex Bennée
  2016-11-02 16:40 ` [Qemu-devel] [PATCH v2] " Pranith Kumar
  0 siblings, 2 replies; 6+ messages in thread
From: Pranith Kumar @ 2016-11-02 14:25 UTC (permalink / raw)
  To: qemu-devel, alex.bennee; +Cc: pbonzini

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 <bobby.prani@gmail.com>
---
 cpus.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/cpus.c b/cpus.c
index 8f98060..c4ba7d8 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1315,6 +1315,9 @@ 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) {
+                    cpu_exec_step_atomic(cpu);
+                    break;
                 }
             } else if (cpu->stop) {
                 if (cpu->unplug) {
@@ -1385,6 +1388,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.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-02 18:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-02 14:25 [Qemu-devel] [PATCH] mttcg: Handle EXCP_ATOMIC exception Pranith Kumar
2016-11-02 16:22 ` Alex Bennée
2016-11-02 16:30   ` Pranith Kumar
2016-11-02 16:40 ` [Qemu-devel] [PATCH v2] " Pranith Kumar
2016-11-02 16:49   ` Paolo Bonzini
2016-11-02 18:17     ` Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).