diff options
author | Alexander Graf <agraf@suse.de> | 2011-12-09 09:20:46 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-03-05 07:52:30 -0500 |
commit | ae21216bece0a623d09980c120b9c98790a860b9 (patch) | |
tree | 0025f86a16c8cff37fecc01f7565c929102061bc | |
parent | 468a12c2b53776721ff83517d4a195b85c5fce54 (diff) |
KVM: PPC: align vcpu_kick with x86
Our vcpu kick implementation differs a bit from x86 which resulted in us not
disabling preemption during the kick. Get it a bit closer to what x86 does.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index fd8d3b16eaf3..e1ef4d6d972a 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c | |||
@@ -558,12 +558,17 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run) | |||
558 | 558 | ||
559 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu) | 559 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu) |
560 | { | 560 | { |
561 | int me; | ||
562 | int cpu = vcpu->cpu; | ||
563 | |||
564 | me = get_cpu(); | ||
561 | if (waitqueue_active(&vcpu->wq)) { | 565 | if (waitqueue_active(&vcpu->wq)) { |
562 | wake_up_interruptible(vcpu->arch.wqp); | 566 | wake_up_interruptible(vcpu->arch.wqp); |
563 | vcpu->stat.halt_wakeup++; | 567 | vcpu->stat.halt_wakeup++; |
564 | } else if (vcpu->cpu != -1) { | 568 | } else if (cpu != me && cpu != -1) { |
565 | smp_send_reschedule(vcpu->cpu); | 569 | smp_send_reschedule(vcpu->cpu); |
566 | } | 570 | } |
571 | put_cpu(); | ||
567 | } | 572 | } |
568 | 573 | ||
569 | int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_interrupt *irq) | 574 | int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_interrupt *irq) |