]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
target/ppc/excp_helper: Take BQL before calling cpu_interrupt()
authorThomas Huth <thuth@redhat.com>
Tue, 13 Jun 2017 10:55:29 +0000 (12:55 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 30 Jun 2017 04:03:31 +0000 (14:03 +1000)
Since the introduction of MTTCG, using the msgsnd instruction
abort()s if being called without holding the BQL. So let's protect
that part of the code now with qemu_mutex_lock_iothread().

Buglink: https://bugs.launchpad.net/qemu/+bug/1694998
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target/ppc/excp_helper.c

index 9cb21231870c78f22c4d7a9b6bfb319612630758..3a9f0861e7737e13f9c34d47b4714e2c1acc01ba 100644 (file)
@@ -17,6 +17,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include "qemu/main-loop.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/exec-all.h"
@@ -1132,6 +1133,7 @@ void helper_msgsnd(target_ulong rb)
         return;
     }
 
+    qemu_mutex_lock_iothread();
     CPU_FOREACH(cs) {
         PowerPCCPU *cpu = POWERPC_CPU(cs);
         CPUPPCState *cenv = &cpu->env;
@@ -1141,5 +1143,6 @@ void helper_msgsnd(target_ulong rb)
             cpu_interrupt(cs, CPU_INTERRUPT_HARD);
         }
     }
+    qemu_mutex_unlock_iothread();
 }
 #endif