]> Git Repo - qemu.git/commitdiff
target-arm: Fix segfault on startup when KVM enabled
authorChristoffer Dall <[email protected]>
Tue, 27 May 2014 12:37:43 +0000 (14:37 +0200)
committerPeter Maydell <[email protected]>
Tue, 27 May 2014 12:55:39 +0000 (13:55 +0100)
Commit 50a2c6e55fa introduced a bug where QEMU would segfault on startup
when using KVM on ARM hosts, because kvm_arm_reset_cpu() accesses
cpu->cpreg_reset_values, which is not allocated before
kvm_arch_init_vcpu(). Fix this by not calling cpu_reset() until after
qemu_init_vcpu().

Acked-by: Paolo Bonzini <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Andreas Faerber <[email protected]>
Signed-off-by: Christoffer Dall <[email protected]>
Message-id: 1401194263[email protected]
Signed-off-by: Peter Maydell <[email protected]>
target-arm/cpu.c

index 6c6f2b3d4661708df6f31282b50989d793d1df9e..794dcb9fb70102ab74b116db818447d6687765f2 100644 (file)
@@ -370,8 +370,8 @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
 
     init_cpreg_list(cpu);
 
-    cpu_reset(cs);
     qemu_init_vcpu(cs);
+    cpu_reset(cs);
 
     acc->parent_realize(dev, errp);
 }
This page took 0.030066 seconds and 4 git commands to generate.