@@ -492,7 +492,6 @@ void cpu_exec_init(CPUArchState *env)
QTAILQ_INIT(&cpu->breakpoints);
QTAILQ_INIT(&cpu->watchpoints);
#ifndef CONFIG_USER_ONLY
- cpu->as = &address_space_memory;
cpu->thread_id = qemu_get_thread_id();
#endif
QTAILQ_INSERT_TAIL(&cpus, cpu, node);
@@ -305,6 +305,11 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp)
{
CPUState *cpu = CPU(dev);
+#ifndef CONFIG_USER_ONLY
+ cpu->as = cpu->mr ? address_space_init_shareable(cpu->mr, NULL)
+ : &address_space_memory;
+#endif
+
if (dev->hotplugged) {
cpu_synchronize_post_init(cpu);
notifier_list_notify(&cpu_added_notifiers, dev);
To allow it to be set by the user after init. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> --- exec.c | 1 - qom/cpu.c | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-)