Skip to contentSkip to conversation

cpus: initialize cpu->memory_dispatch

PATCH New Paolo Bonzini 1 participant 1 message Mar 9, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpus: initialize cpu->memory_dispatch

This fixes a NULL pointer dereference in s390x-softmmu.

On pretty much all other architectures, creating an MMIO region calls cpu_reload_memory_map. On s390, however, there are no MMIO regions and everything is done via hypercalls.

Fixes 9d82b5a792236db31a75b9db5c93af69ac07c7c5
---
 exec.c | 1 +
 1 file changed, 1 insertion(+)
exec.c +1 -0
index c85321a..3280e57 100644
@@ -548,6 +548,7 @@ void cpu_exec_init(CPUArchState *env)
 #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)
Signature · 1 line
2.3.0