[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/11] s390x/misc_helper.c: wrap IO instructions in B
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PULL 05/11] s390x/misc_helper.c: wrap IO instructions in BQL |
Date: |
Thu, 9 Mar 2017 11:17:08 +0000 |
Helpers that can trigger IO events (including interrupts) need to be
protected by the BQL. I've updated all the helpers that call into an
ioinst_handle_* functions.
Reported-by: Thomas Huth <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
target/s390x/misc_helper.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c
index 3cb942e8bb..93b0e61366 100644
--- a/target/s390x/misc_helper.c
+++ b/target/s390x/misc_helper.c
@@ -19,6 +19,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/main-loop.h"
#include "cpu.h"
#include "exec/memory.h"
#include "qemu/host-utils.h"
@@ -551,61 +552,81 @@ uint32_t HELPER(sigp)(CPUS390XState *env, uint64_t
order_code, uint32_t r1,
void HELPER(xsch)(CPUS390XState *env, uint64_t r1)
{
S390CPU *cpu = s390_env_get_cpu(env);
+ qemu_mutex_lock_iothread();
ioinst_handle_xsch(cpu, r1);
+ qemu_mutex_unlock_iothread();
}
void HELPER(csch)(CPUS390XState *env, uint64_t r1)
{
S390CPU *cpu = s390_env_get_cpu(env);
+ qemu_mutex_lock_iothread();
ioinst_handle_csch(cpu, r1);
+ qemu_mutex_unlock_iothread();
}
void HELPER(hsch)(CPUS390XState *env, uint64_t r1)
{
S390CPU *cpu = s390_env_get_cpu(env);
+ qemu_mutex_lock_iothread();
ioinst_handle_hsch(cpu, r1);
+ qemu_mutex_unlock_iothread();
}
void HELPER(msch)(CPUS390XState *env, uint64_t r1, uint64_t inst)
{
S390CPU *cpu = s390_env_get_cpu(env);
+ qemu_mutex_lock_iothread();
ioinst_handle_msch(cpu, r1, inst >> 16);
+ qemu_mutex_unlock_iothread();
}
void HELPER(rchp)(CPUS390XState *env, uint64_t r1)
{
S390CPU *cpu = s390_env_get_cpu(env);
+ qemu_mutex_lock_iothread();
ioinst_handle_rchp(cpu, r1);
+ qemu_mutex_unlock_iothread();
}
void HELPER(rsch)(CPUS390XState *env, uint64_t r1)
{
S390CPU *cpu = s390_env_get_cpu(env);
+ qemu_mutex_lock_iothread();
ioinst_handle_rsch(cpu, r1);
+ qemu_mutex_unlock_iothread();
}
void HELPER(ssch)(CPUS390XState *env, uint64_t r1, uint64_t inst)
{
S390CPU *cpu = s390_env_get_cpu(env);
+ qemu_mutex_lock_iothread();
ioinst_handle_ssch(cpu, r1, inst >> 16);
+ qemu_mutex_unlock_iothread();
}
void HELPER(stsch)(CPUS390XState *env, uint64_t r1, uint64_t inst)
{
S390CPU *cpu = s390_env_get_cpu(env);
+ qemu_mutex_lock_iothread();
ioinst_handle_stsch(cpu, r1, inst >> 16);
+ qemu_mutex_unlock_iothread();
}
void HELPER(tsch)(CPUS390XState *env, uint64_t r1, uint64_t inst)
{
S390CPU *cpu = s390_env_get_cpu(env);
+ qemu_mutex_lock_iothread();
ioinst_handle_tsch(cpu, r1, inst >> 16);
+ qemu_mutex_unlock_iothread();
}
void HELPER(chsc)(CPUS390XState *env, uint64_t inst)
{
S390CPU *cpu = s390_env_get_cpu(env);
+ qemu_mutex_lock_iothread();
ioinst_handle_chsc(cpu, inst >> 16);
+ qemu_mutex_unlock_iothread();
}
#endif
--
2.11.0
- [Qemu-devel] [PULL 00/11] MTTCG Fix-ups for 2.9, Alex Bennée, 2017/03/09
- [Qemu-devel] [PULL 02/11] target/i386/cpu.h: declare TCG_GUEST_DEFAULT_MO, Alex Bennée, 2017/03/09
- [Qemu-devel] [PULL 01/11] vl/cpus: be smarter with icount and MTTCG, Alex Bennée, 2017/03/09
- [Qemu-devel] [PULL 03/11] cpus.c: add additional error_report when !TARGET_SUPPORT_MTTCG, Alex Bennée, 2017/03/09
- [Qemu-devel] [PULL 04/11] sparc/sparc64: grab BQL before calling cpu_check_irqs, Alex Bennée, 2017/03/09
- [Qemu-devel] [PULL 07/11] translate-all: exit cpu_restore_state early if translating, Alex Bennée, 2017/03/09
- [Qemu-devel] [PULL 05/11] s390x/misc_helper.c: wrap IO instructions in BQL,
Alex Bennée <=
- [Qemu-devel] [PULL 06/11] target/xtensa: hold BQL for interrupt processing, Alex Bennée, 2017/03/09
- [Qemu-devel] [PULL 10/11] target/arm/helper: make it clear the EC field is also in hex, Alex Bennée, 2017/03/09
- [Qemu-devel] [PULL 09/11] target-i386: defer VMEXIT to do_interrupt, Alex Bennée, 2017/03/09
- [Qemu-devel] [PULL 08/11] target/mips: hold BQL for timer interrupts, Alex Bennée, 2017/03/09
- [Qemu-devel] [PULL 11/11] hw/intc/arm_gic: modernise the DPRINTF, Alex Bennée, 2017/03/09
- Re: [Qemu-devel] [PULL 00/11] MTTCG Fix-ups for 2.9, Peter Maydell, 2017/03/13