Skip to contentSkip to conversation

"KVM: PPC: booke: Improve timer register emulation" breaks Book3s HV

DISCUSSION Paul Mackerras 2 participants 3 messages Dec 6, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I'm not sure why yet, but commit 8a97c432 ("KVM: PPC: booke: Improve timer register emulation") in Alex's kvm-ppc-next branch is breaking Book3S HV KVM on POWER7. Guest cpus fail to spin up, and even with just one cpu, the guest stalls every so often. If I stop the guest and inspect the state with qemu, PC is at 0x900. Reverting 8a97c432 makes it work properly again.

Paul.

#1 lore raw

Re: "KVM: PPC: booke: Improve timer register emulation" breaks

Quoted 6 lines · Paul Mackerras

I'm not sure why yet, but commit 8a97c432 ("KVM: PPC: booke: Improve timer register emulation") in Alex's kvm-ppc-next branch is breaking Book3S HV KVM on POWER7. Guest cpus fail to spin up, and even with just one cpu, the guest stalls every so often. If I stop the guest and inspect the state with qemu, PC is at 0x900. Reverting 8a97c432 makes it work properly again.

This fixes it:

arch/powerpc/kvm/powerpc.c +1 -1
index 534cbe1..83bcb44 100644
@@ -560,7 +560,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
 
 void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
 {
-	if (waitqueue_active(&vcpu->wq)) {
+	if (waitqueue_active(vcpu->arch.wqp)) {
 		wake_up_interruptible(vcpu->arch.wqp);
 		vcpu->stat.halt_wakeup++;
 	} else if (vcpu->cpu != -1) {

Alex, do you want to roll that in with Scott's patch, or do you want me to send a separate patch on top?

Paul.

#2 lore raw
Quoted 15 lines · Paul Mackerras
Quoted 6 lines · Paul Mackerras

I'm not sure why yet, but commit 8a97c432 ("KVM: PPC: booke: Improve timer register emulation") in Alex's kvm-ppc-next branch is breaking Book3S HV KVM on POWER7. Guest cpus fail to spin up, and even with just one cpu, the guest stalls every so often. If I stop the guest and inspect the state with qemu, PC is at 0x900. Reverting 8a97c432 makes it work properly again.

This fixes it:

arch/powerpc/kvm/powerpc.c +0 -0
index 534cbe1..83bcb44 100644

arch/powerpc/kvm/powerpc.c int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) · line 563

Quoted 5 lines
arch/powerpc/kvm/powerpc.c +1 -1
@@ -560,7 +560,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
 
 void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
 {
-	if (waitqueue_active(&vcpu->wq)) {
+	if (waitqueue_active(vcpu->arch.wqp)) {

:(

Quoted 6 lines
arch/powerpc/kvm/powerpc.c +0 -0
 		wake_up_interruptible(vcpu->arch.wqp);
 		vcpu->stat.halt_wakeup++;
 	} else if (vcpu->cpu != -1) {

Alex, do you want to roll that in with Scott's patch, or do you want me to send a separate patch on top?

I usually like praise where praise belongs, so I'll put this right after Scott's patch if you give me a nice and shiny patch description with a signed-off-by line :)

Alex