All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pranith Kumar <bobby.prani@gmail.com>
To: qemu-devel@nongnu.org, alex.bennee@linaro.org
Cc: pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH] mttcg: Handle EXCP_ATOMIC exception
Date: Wed,  2 Nov 2016 10:25:59 -0400	[thread overview]
Message-ID: <20161102142559.23395-1-bobby.prani@gmail.com> (raw)

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

             reply	other threads:[~2016-11-02 14:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-02 14:25 Pranith Kumar [this message]
2016-11-02 16:22 ` [Qemu-devel] [PATCH] mttcg: Handle EXCP_ATOMIC exception 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161102142559.23395-1-bobby.prani@gmail.com \
    --to=bobby.prani@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.