diff options
author | Thomas Huth <thuth@redhat.com> | 2017-06-13 12:55:29 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-06-30 14:03:31 +1000 |
commit | f1c29ebc51be77bd64178c8d9fc98a8f91a69d25 (patch) | |
tree | 5855d3c575b66cdb7b6402fa10e8b28ae1e34cf6 | |
parent | d39c90f5f3ae23a6c8202eb6e1204ea84991e7f5 (diff) | |
download | qemu-f1c29ebc51be77bd64178c8d9fc98a8f91a69d25.zip qemu-f1c29ebc51be77bd64178c8d9fc98a8f91a69d25.tar.gz qemu-f1c29ebc51be77bd64178c8d9fc98a8f91a69d25.tar.bz2 |
target/ppc/excp_helper: Take BQL before calling cpu_interrupt()
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>
-rw-r--r-- | target/ppc/excp_helper.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 9cb2123..3a9f086 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -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 |