From 00d0f7cb6617f50be90e7dbb90a83d87b33f7695 Mon Sep 17 00:00:00 2001 From: Christoffer Dall Date: Tue, 27 May 2014 14:37:43 +0200 Subject: target-arm: Fix segfault on startup when KVM enabled 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 Reviewed-by: Peter Maydell Reviewed-by: Andreas Faerber Signed-off-by: Christoffer Dall Message-id: 1401194263-13010-1-git-send-email-christoffer.dall@linaro.org Signed-off-by: Peter Maydell --- target-arm/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'target-arm') diff --git a/target-arm/cpu.c b/target-arm/cpu.c index 6c6f2b3d46..794dcb9fb7 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c @@ -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); } -- cgit v1.2.3-55-g7522