[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 27/27] target-ppc: take global mutex for set_irq
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v7 27/27] target-ppc: take global mutex for set_irq |
Date: |
Thu, 19 Jan 2017 17:05:07 +0000 |
We have to do this conditionally as the reset paths can trigger IRQ
setting when the machine is first brought up.
Signed-off-by: Alex Bennée <address@hidden>
---
hw/ppc/ppc.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index 8945869009..59c3faa6c8 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -62,7 +62,16 @@ void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level)
{
CPUState *cs = CPU(cpu);
CPUPPCState *env = &cpu->env;
- unsigned int old_pending = env->pending_interrupts;
+ unsigned int old_pending;
+ bool locked = false;
+
+ /* We may already have the BQL if coming from the reset path */
+ if (!qemu_mutex_iothread_locked()) {
+ locked = true;
+ qemu_mutex_lock_iothread();
+ }
+
+ old_pending = env->pending_interrupts;
if (level) {
env->pending_interrupts |= 1 << n_IRQ;
@@ -80,9 +89,14 @@ void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level)
#endif
}
+
LOG_IRQ("%s: %p n_IRQ %d level %d => pending %08" PRIx32
"req %08x\n", __func__, env, n_IRQ, level,
env->pending_interrupts, CPU(cpu)->interrupt_request);
+
+ if (locked) {
+ qemu_mutex_unlock_iothread();
+ }
}
/* PowerPC 6xx / 7xx internal IRQ controller */
--
2.11.0
- [Qemu-devel] [PATCH v7 16/27] cputlb: add tlb_flush_by_mmuidx async routines, (continued)
- [Qemu-devel] [PATCH v7 16/27] cputlb: add tlb_flush_by_mmuidx async routines, Alex Bennée, 2017/01/19
- [Qemu-devel] [PATCH v7 26/27] tcg: enable MTTCG by default for ARM on x86 hosts, Alex Bennée, 2017/01/19
- [Qemu-devel] [PATCH v7 18/27] cputlb: introduce tlb_flush_*_all_cpus, Alex Bennée, 2017/01/19
- [Qemu-devel] [PATCH v7 20/27] target-arm: ensure BQL taken for ARM_CP_IO register access, Alex Bennée, 2017/01/19
- [Qemu-devel] [PATCH v7 19/27] target-arm/powerctl: defer cpu reset work to CPU context, Alex Bennée, 2017/01/19
- [Qemu-devel] [PATCH v7 27/27] target-ppc: take global mutex for set_irq,
Alex Bennée <=
- [Qemu-devel] [PATCH v7 24/27] target-arm: introduce ARM_CP_EXIT_PC, Alex Bennée, 2017/01/19
- [Qemu-devel] [PATCH v7 21/27] target-arm: helpers which may affect global state need the BQL, Alex Bennée, 2017/01/19
- [Qemu-devel] [PATCH v7 23/27] target-arm/cpu.h: make ARM_CP defined consistent, Alex Bennée, 2017/01/19
- [Qemu-devel] [PATCH v7 22/27] target-arm: don't generate WFE/YIELD calls for MTTCG, Alex Bennée, 2017/01/19
- [Qemu-devel] [PATCH v7 25/27] target-arm: ensure all cross vCPUs TLB flushes complete, Alex Bennée, 2017/01/19
- [Qemu-devel] [PATCH v7 17/27] cputlb: atomically update tlb fields used by tlb_reset_dirty, Alex Bennée, 2017/01/19