[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/22] cpu: Reorder cpu->as, cpu->thread_id, cpu->mem
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 03/22] cpu: Reorder cpu->as, cpu->thread_id, cpu->memory_dispatch init |
Date: |
Tue, 7 Jul 2015 01:13:46 +0200 |
From: Eduardo Habkost <address@hidden>
Instead of initializing cpu->as, cpu->thread_id, and reloading memory
map while holding cpu_list_lock(), do it earlier, before locking the CPU
list and initializing cpu_index.
This allows the code handling cpu_index and global CPU list to be
isolated from the rest.
Cc: Paolo Bonzini <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
exec.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/exec.c b/exec.c
index b5ff469..06f6cb4 100644
--- a/exec.c
+++ b/exec.c
@@ -533,6 +533,12 @@ void cpu_exec_init(CPUArchState *env)
CPUState *some_cpu;
int cpu_index;
+#ifndef CONFIG_USER_ONLY
+ cpu->as = &address_space_memory;
+ cpu->thread_id = qemu_get_thread_id();
+ cpu_reload_memory_map(cpu);
+#endif
+
#if defined(CONFIG_USER_ONLY)
cpu_list_lock();
#endif
@@ -541,11 +547,6 @@ void cpu_exec_init(CPUArchState *env)
cpu_index++;
}
cpu->cpu_index = cpu_index;
-#ifndef CONFIG_USER_ONLY
- cpu->as = &address_space_memory;
- cpu->thread_id = qemu_get_thread_id();
- cpu_reload_memory_map(cpu);
-#endif
QTAILQ_INSERT_TAIL(&cpus, cpu, node);
#if defined(CONFIG_USER_ONLY)
cpu_list_unlock();
--
2.1.4
- [Qemu-devel] [PULL 00/22] QOM CPUState patch queue 2015-07-06, Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 01/22] cpu: No need to zero-initialize CPUState::numa_node, Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 02/22] cpu: Initialize breakpoint/watchpoint lists in cpu_common_initfn(), Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 03/22] cpu: Reorder cpu->as, cpu->thread_id, cpu->memory_dispatch init,
Andreas Färber <=
- [Qemu-devel] [PULL 05/22] cpu: Convert cpu_index into a bitmap, Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 06/22] target-ppc: Move cpu_exec_init() call to realize function, Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 04/22] cpu: Add Error argument to cpu_exec_init(), Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 09/22] cpu: Change tcg_cpu_exec() arg to cpu, not env, Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 12/22] cpu: Add wrapper for the set_pc() hook, Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 07/22] translate-all: Change tb_flush() env argument to cpu, Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 08/22] gdbstub: Change gdbserver_fork() to accept cpu instead of env, Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 15/22] microblaze: boot: Use cpu_set_pc(), Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 13/22] gdbstub: Use cpu_set_pc() helper, Andreas Färber, 2015/07/06
- [Qemu-devel] [PULL 14/22] hw/arm/boot: Use cpu_set_pc(), Andreas Färber, 2015/07/06