All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: commit 50a2c6e breaks KVM/ARM (reset/init vcpu order)
@ 2014-05-26  9:18 ` Christoffer Dall
  0 siblings, 0 replies; 14+ messages in thread
From: Christoffer Dall @ 2014-05-26  9:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: kvm, Peter Maydell, Alexander Graf, afaerber, Paolo Bonzini

Hi,

I noticed that commit 50a2c6e55fa2ce5a2916a2c206bad2c6b0e06df1 broke
KVM/ARM, because the realize function (arm_cpu_realizefn()) now calls
cpu_reset() before qemu_init_vcpu(), which causes kvm_arm_reset_cpu() to
segfault because it dereferences cpu->cpreg_reset_values, which is not
allocated before kvm_arch_init_vcpu().

Simply changing the order of the reset/init calls (see the tiny patch
below) seems to fix it, but I'm not completely sure this is a clean and
correct fix:


diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 6c6f2b3..794dcb9 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);
 }



Please adivce :)

Thanks,
-Christoffer

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-05-26 21:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-26  9:18 BUG: commit 50a2c6e breaks KVM/ARM (reset/init vcpu order) Christoffer Dall
2014-05-26  9:18 ` [Qemu-devel] " Christoffer Dall
2014-05-26  9:55 ` Paolo Bonzini
2014-05-26  9:55   ` [Qemu-devel] " Paolo Bonzini
2014-05-26  9:57   ` Alexander Graf
2014-05-26  9:57     ` [Qemu-devel] " Alexander Graf
2014-05-26 10:20     ` Andreas Färber
2014-05-26 10:20       ` [Qemu-devel] " Andreas Färber
2014-05-26 10:31       ` Alexander Graf
2014-05-26 10:31         ` [Qemu-devel] " Alexander Graf
2014-05-26 12:36         ` Andreas Färber
2014-05-26 21:04           ` Alexander Graf
2014-05-26 12:39       ` 回复: " 管雪涛
2014-05-26 17:28       ` Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.