]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
KVM: PPC: booke: check for signals in kvmppc_vcpu_run
authorScott Wood <scottwood@freescale.com>
Tue, 8 Nov 2011 22:11:59 +0000 (16:11 -0600)
committerAvi Kivity <avi@redhat.com>
Mon, 5 Mar 2012 12:52:25 +0000 (14:52 +0200)
Currently we check prior to returning from a lightweight exit,
but not prior to initial entry.

book3s already does a similar test.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/kvm/booke.c

index b64220079d561a4fc6f0b9324d0deeedfc1df787..9c785896e86769a923ac2a06e50b67127da3f4a6 100644 (file)
@@ -322,11 +322,19 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
        }
 
        local_irq_disable();
+
+       if (signal_pending(current)) {
+               kvm_run->exit_reason = KVM_EXIT_INTR;
+               ret = -EINTR;
+               goto out;
+       }
+
        kvm_guest_enter();
        ret = __kvmppc_vcpu_run(kvm_run, vcpu);
        kvm_guest_exit();
-       local_irq_enable();
 
+out:
+       local_irq_enable();
        return ret;
 }