[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH target-arm v4 01/16] cpus: Don't kick un-realized cp
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [PATCH target-arm v4 01/16] cpus: Don't kick un-realized cpus. |
Date: |
Mon, 23 Mar 2015 04:05:10 -0700 |
following a464982499b2f637f6699e3d03e0a9d2e0b5288b, it's now possible for
there to be attempts to take the BQL before CPUs have been realized in
cases where a machine model inits peripherals before the first CPU.
BQL lock aquisition kicks the first_cpu, leading to a segfault if this
happens pre-realize. Guard the CPU kick routine to perform no action for
a CPU that doesn't exist or doesn't have a thread yet.
There was a fix to this with commit
6b49809c597331803ea941eadda813e5bb4e8fe2, but the check there misses
the case where the CPU has been inited and not realized. Strengthen the
check to make sure that the first_cpu has a thread (i.e. it is
realized) before allowing the kick.
Signed-off-by: Peter Crosthwaite <address@hidden>
---
cpus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index 314df16..e6dcae3 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1119,7 +1119,7 @@ bool qemu_in_vcpu_thread(void)
void qemu_mutex_lock_iothread(void)
{
atomic_inc(&iothread_requesting_mutex);
- if (!tcg_enabled() || !first_cpu) {
+ if (!tcg_enabled() || !first_cpu || !first_cpu->thread) {
qemu_mutex_lock(&qemu_global_mutex);
atomic_dec(&iothread_requesting_mutex);
} else {
--
2.3.1.2.g90df61e.dirty
- [Qemu-devel] [PATCH target-arm v4 00/16] Next Generation Xilinx Zynq SoC, Peter Crosthwaite, 2015/03/23
- [Qemu-devel] [PATCH target-arm v4 01/16] cpus: Don't kick un-realized cpus.,
Peter Crosthwaite <=
- [Qemu-devel] [PATCH target-arm v4 02/16] target-arm: cpu64: Factor out ARM cortex init, Peter Crosthwaite, 2015/03/23
- [Qemu-devel] [PATCH target-arm v4 04/16] arm: Introduce Xilinx ZynqMP SoC, Peter Crosthwaite, 2015/03/23
- [Qemu-devel] [PATCH target-arm v4 03/16] target-arm: cpu64: Add support for cortex-a53, Peter Crosthwaite, 2015/03/23
- [Qemu-devel] [PATCH target-arm v4 05/16] arm: xlnx-zynqmp: Add GIC, Peter Crosthwaite, 2015/03/23
- [Qemu-devel] [PATCH target-arm v4 08/16] net: cadence_gem: Split state struct and type into header, Peter Crosthwaite, 2015/03/23
- [Qemu-devel] [PATCH target-arm v4 07/16] net: cadence_gem: Clean up variable names, Peter Crosthwaite, 2015/03/23
- [Qemu-devel] [PATCH target-arm v4 13/16] arm: Add xlnx-ep108 machine, Peter Crosthwaite, 2015/03/23